| Index: third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-bubbles-true.html
|
| diff --git a/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-bubbles-false.html b/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-bubbles-true.html
|
| similarity index 86%
|
| copy from third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-bubbles-false.html
|
| copy to third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-bubbles-true.html
|
| index 286df98706d6ad63c676153249837a5635398462..c9e4e32768d4b80cf97834696510f101d23caf22 100644
|
| --- a/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-bubbles-false.html
|
| +++ b/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-bubbles-true.html
|
| @@ -19,6 +19,10 @@
|
| </tbody>
|
| </table>
|
| <script>
|
| +function concatReverse(a) {
|
| + return a.concat(a.map(function(x) { return x }).reverse());
|
| +}
|
| +
|
| function targetsForDocumentChain(document) {
|
| return [
|
| document,
|
| @@ -33,7 +37,7 @@ function targetsForDocumentChain(document) {
|
| function testChain(document, targetParents, phases, event_type) {
|
| var target = document.getElementById("target");
|
| var targets = targetParents.concat(target);
|
| - var expected_targets = targets.concat(target);
|
| + var expected_targets = concatReverse(targets);
|
|
|
| var actual_targets = [], actual_phases = [];
|
| var test_event = function(evt) {
|
| @@ -47,7 +51,7 @@ function testChain(document, targetParents, phases, event_type) {
|
| }
|
|
|
| var evt = document.createEvent("Event");
|
| - evt.initEvent(event_type, false, true);
|
| + evt.initEvent(event_type, true, true);
|
|
|
| target.dispatchEvent(evt);
|
|
|
| @@ -64,12 +68,18 @@ var phasesForDocumentChain = [
|
| Event.CAPTURING_PHASE,
|
| Event.AT_TARGET,
|
| Event.AT_TARGET,
|
| + Event.BUBBLING_PHASE,
|
| + Event.BUBBLING_PHASE,
|
| + Event.BUBBLING_PHASE,
|
| + Event.BUBBLING_PHASE,
|
| + Event.BUBBLING_PHASE,
|
| + Event.BUBBLING_PHASE,
|
| ];
|
|
|
| test(function () {
|
| var chainWithWindow = [window].concat(targetsForDocumentChain(document));
|
| - testChain(
|
| - document, chainWithWindow, [Event.CAPTURING_PHASE].concat(phasesForDocumentChain), "click");
|
| + var phases = [Event.CAPTURING_PHASE].concat(phasesForDocumentChain, Event.BUBBLING_PHASE);
|
| + testChain(document, chainWithWindow, phases, "click");
|
| }, "In window.document with click event");
|
|
|
| test(function () {
|
|
|