haikuwebkit/LayoutTests/transitions/transition-end-event-prefix...

75 lines
2.8 KiB
HTML
Raw Permalink Normal View History

Regression: Event#stopPropagation() does not halt bubbling for webkitTransitionEnd https://bugs.webkit.org/show_bug.cgi?id=115656 Reviewed by Darin Adler. Source/WebCore: If we create a prefixed event to dispatch it (in the case we have only prefixed event listeners in client's code) then we need to make sure to keep it in sync with the original unprefixed event after it has been dispatched. While being dispatched the event can be modified by client's code and when propagated back to outer elements, attributes were not updated. This patch changes the old design of creating a separate event for the prefixed case and now change the type of the event (so the name) before dispatching it, keeping the attributes if changed and then rename it back to unprefixed when the dispatching is finished. Tests: transitions/transition-end-event-prefixed-01.html transitions/transition-end-event-prefixed-02.html transitions/transition-end-event-prefixed-03.html * dom/Event.h: (WebCore::Event::setType): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): LayoutTests: Added new tests to cover the bug. * transitions/transition-end-event-prefixed-03-expected.txt: Added. * transitions/transition-end-event-prefixed-03.html: Added. * transitions/transition-end-event-prefixed-02-expected.txt: Added. * transitions/transition-end-event-prefixed-02.html: Added. * transitions/transition-end-event-prefixed-01-expected.txt: Added. * transitions/transition-end-event-prefixed-01.html: Added. Canonical link: https://commits.webkit.org/134661@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-05-17 03:26:58 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.box {
position: relative;
left: 0;
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
-webkit-transition-property: width;
-webkit-transition-duration: 0.5s;
}
</style>
<script src="transition-end-event-helpers.js"></script>
Change LayoutTests' t* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120899. Rubber stamped by Filip Pizlo. * touchadjustment/big-div.html: * touchadjustment/block-testing.html: * touchadjustment/context-menu-select-text.html: * touchadjustment/context-menu-shadow-node.html: * touchadjustment/context-menu-text-subtargets.html: * touchadjustment/context-menu.html: * touchadjustment/disabled-formelements.html: * touchadjustment/editable-content.html: * touchadjustment/event-triggered-widgets.html: * touchadjustment/html-label.html: * touchadjustment/iframe.html: * touchadjustment/nested-shadow-node.html: * touchadjustment/nested-touch.html: * touchadjustment/plugin.html: * touchadjustment/rotated-node.html: * touchadjustment/scroll-delegation/iframe-with-mainframe-scroll-offset.html: * touchadjustment/scroll-offset.html: * touchadjustment/search-cancel.html: * touchadjustment/small-target-test.html: * touchadjustment/touch-inlines.html: * touchadjustment/touch-links-active.html: * touchadjustment/touch-links-longpress.html: * touchadjustment/touch-links-two-finger-tap.html: * touchadjustment/zoom-basic.html: * touchadjustment/zoom-fatfinger.html: * transforms/2d/computed-style-origin.html: * transforms/2d/transform-value-types.html: * transforms/cssmatrix-2d-interface.xhtml: * transforms/cssmatrix-3d-interface.xhtml: * transitions/transition-end-event-create.html: * transitions/transition-end-event-prefixed-01.html: * transitions/transition-end-event-prefixed-02.html: * transitions/transition-end-event-prefixed-03.html: * transitions/transitions-parsing.html: * traversal/acid3-test-2.html: * traversal/exception-forwarding.html: * traversal/script-tests/TEMPLATE.html: Canonical link: https://commits.webkit.org/138889@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-08 05:47:54 +00:00
<script src="../resources/js-test-pre.js"></script>
Regression: Event#stopPropagation() does not halt bubbling for webkitTransitionEnd https://bugs.webkit.org/show_bug.cgi?id=115656 Reviewed by Darin Adler. Source/WebCore: If we create a prefixed event to dispatch it (in the case we have only prefixed event listeners in client's code) then we need to make sure to keep it in sync with the original unprefixed event after it has been dispatched. While being dispatched the event can be modified by client's code and when propagated back to outer elements, attributes were not updated. This patch changes the old design of creating a separate event for the prefixed case and now change the type of the event (so the name) before dispatching it, keeping the attributes if changed and then rename it back to unprefixed when the dispatching is finished. Tests: transitions/transition-end-event-prefixed-01.html transitions/transition-end-event-prefixed-02.html transitions/transition-end-event-prefixed-03.html * dom/Event.h: (WebCore::Event::setType): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): LayoutTests: Added new tests to cover the bug. * transitions/transition-end-event-prefixed-03-expected.txt: Added. * transitions/transition-end-event-prefixed-03.html: Added. * transitions/transition-end-event-prefixed-02-expected.txt: Added. * transitions/transition-end-event-prefixed-02.html: Added. * transitions/transition-end-event-prefixed-01-expected.txt: Added. * transitions/transition-end-event-prefixed-01.html: Added. Canonical link: https://commits.webkit.org/134661@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-05-17 03:26:58 +00:00
<script type="text/javascript">
function runAnimation() {
var box = document.getElementById('box1');
box.style.width = '200px';
}
</script>
</head>
<body onLoad="runAnimation()">
<script type="text/javascript">
description("Test to make sure that if prefixed transition events are modified we correctly modify unprefixed events.");
if (window.testRunner)
testRunner.waitUntilDone();
var testContainer = document.createElement("div");
document.body.appendChild(testContainer);
testContainer.innerHTML = '<div id="box1" class="box"></div>';
var box = document.getElementById('box1');
var transitionEventContainer;
var transitionEventBox;
function innerTransitionEndEvent(e)
{
transitionEventBox = e;
}
function outerTransitionEndEvent(e)
{
transitionEventContainer = e;
shouldBe("transitionEventContainer.type", "transitionEventBox.type");
shouldBe("transitionEventContainer.bubbles", "transitionEventBox.bubbles");
shouldBe("transitionEventContainer.timeStamp", "transitionEventBox.timeStamp");
shouldBe("transitionEventContainer.cancelable", "transitionEventBox.cancelable");
shouldBe("transitionEventContainer.srcElement", "transitionEventBox.srcElement");
shouldBe("transitionEventContainer.returnValue", "transitionEventBox.returnValue");
shouldBe("transitionEventContainer.cancelBubble", "transitionEventBox.cancelBubble");
shouldBe("transitionEventContainer.defaultPrevented", "transitionEventBox.defaultPrevented");
shouldBe("transitionEventContainer.target", "transitionEventBox.target");
shouldBe("transitionEventContainer.currentTarget", "testContainer");
// TransitionEnd event specific properties.
shouldBe("transitionEventContainer.pseudoElement", "transitionEventBox.pseudoElement");
shouldBe("transitionEventContainer.elapsedTime", "transitionEventBox.elapsedTime");
shouldBe("transitionEventContainer.propertyName", "transitionEventBox.propertyName");
if (window.testRunner)
testRunner.notifyDone();
document.body.removeChild(testContainer);
}
testContainer.addEventListener('webkitTransitionEnd', outerTransitionEndEvent, false);
box.addEventListener('webkitTransitionEnd', innerTransitionEndEvent, false);
</script>
Change LayoutTests' t* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120899. Rubber stamped by Filip Pizlo. * touchadjustment/big-div.html: * touchadjustment/block-testing.html: * touchadjustment/context-menu-select-text.html: * touchadjustment/context-menu-shadow-node.html: * touchadjustment/context-menu-text-subtargets.html: * touchadjustment/context-menu.html: * touchadjustment/disabled-formelements.html: * touchadjustment/editable-content.html: * touchadjustment/event-triggered-widgets.html: * touchadjustment/html-label.html: * touchadjustment/iframe.html: * touchadjustment/nested-shadow-node.html: * touchadjustment/nested-touch.html: * touchadjustment/plugin.html: * touchadjustment/rotated-node.html: * touchadjustment/scroll-delegation/iframe-with-mainframe-scroll-offset.html: * touchadjustment/scroll-offset.html: * touchadjustment/search-cancel.html: * touchadjustment/small-target-test.html: * touchadjustment/touch-inlines.html: * touchadjustment/touch-links-active.html: * touchadjustment/touch-links-longpress.html: * touchadjustment/touch-links-two-finger-tap.html: * touchadjustment/zoom-basic.html: * touchadjustment/zoom-fatfinger.html: * transforms/2d/computed-style-origin.html: * transforms/2d/transform-value-types.html: * transforms/cssmatrix-2d-interface.xhtml: * transforms/cssmatrix-3d-interface.xhtml: * transitions/transition-end-event-create.html: * transitions/transition-end-event-prefixed-01.html: * transitions/transition-end-event-prefixed-02.html: * transitions/transition-end-event-prefixed-03.html: * transitions/transitions-parsing.html: * traversal/acid3-test-2.html: * traversal/exception-forwarding.html: * traversal/script-tests/TEMPLATE.html: Canonical link: https://commits.webkit.org/138889@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-08 05:47:54 +00:00
<script src="../resources/js-test-post.js"></script>
Regression: Event#stopPropagation() does not halt bubbling for webkitTransitionEnd https://bugs.webkit.org/show_bug.cgi?id=115656 Reviewed by Darin Adler. Source/WebCore: If we create a prefixed event to dispatch it (in the case we have only prefixed event listeners in client's code) then we need to make sure to keep it in sync with the original unprefixed event after it has been dispatched. While being dispatched the event can be modified by client's code and when propagated back to outer elements, attributes were not updated. This patch changes the old design of creating a separate event for the prefixed case and now change the type of the event (so the name) before dispatching it, keeping the attributes if changed and then rename it back to unprefixed when the dispatching is finished. Tests: transitions/transition-end-event-prefixed-01.html transitions/transition-end-event-prefixed-02.html transitions/transition-end-event-prefixed-03.html * dom/Event.h: (WebCore::Event::setType): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): LayoutTests: Added new tests to cover the bug. * transitions/transition-end-event-prefixed-03-expected.txt: Added. * transitions/transition-end-event-prefixed-03.html: Added. * transitions/transition-end-event-prefixed-02-expected.txt: Added. * transitions/transition-end-event-prefixed-02.html: Added. * transitions/transition-end-event-prefixed-01-expected.txt: Added. * transitions/transition-end-event-prefixed-01.html: Added. Canonical link: https://commits.webkit.org/134661@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-05-17 03:26:58 +00:00
</body>
</html>