Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/events/Event-dispatch-bubbles-false.html |
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/events/Event-dispatch-bubbles-false.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/events/Event-dispatch-bubbles-false.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..43a6331ba08c3fb73a68e45a5e0d241eb624a0b6 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/events/Event-dispatch-bubbles-false.html |
@@ -0,0 +1,68 @@ |
+<!DOCTYPE html> |
+<meta charset=utf-8> |
+<title> Event.bubbles attribute is set to false </title> |
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-event-initevent"> |
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-event-dispatch"> |
+<script src="../../../../resources/testharness.js"></script> |
+<script src="../../../../resources/testharnessreport.js"></script> |
+<div id=log></div> |
+<table id="table" border="1" style="display: none"> |
+ <tbody id="table-body"> |
+ <tr id="table-row"> |
+ <td id="table-cell">Shady Grove</td> |
+ <td>Aeolian</td> |
+ </tr> |
+ <tr id="parent"> |
+ <td id="target">Over the river, Charlie</td> |
+ <td>Dorian</td> |
+ </tr> |
+ </tbody> |
+</table> |
+<script> |
+test(function() { |
+ var event_type = "click"; |
+ var target = document.getElementById("target"); |
+ var targets = [ |
+ window, |
+ document, |
+ document.documentElement, |
+ document.body, |
+ document.getElementById("table"), |
+ document.getElementById("table-body"), |
+ document.getElementById("parent"), |
+ target, |
+ ]; |
+ var expected_targets = targets.concat(target); |
+ var phases = [ |
+ Event.CAPTURING_PHASE, |
+ Event.CAPTURING_PHASE, |
+ Event.CAPTURING_PHASE, |
+ Event.CAPTURING_PHASE, |
+ Event.CAPTURING_PHASE, |
+ Event.CAPTURING_PHASE, |
+ Event.CAPTURING_PHASE, |
+ Event.AT_TARGET, |
+ Event.AT_TARGET, |
+ ]; |
+ |
+ |
+ var actual_targets = [], actual_phases = []; |
+ var test_event = function(evt) { |
+ actual_targets.push(evt.currentTarget); |
+ actual_phases.push(evt.eventPhase); |
+ } |
+ |
+ for (var i = 0; i < targets.length; i++) { |
+ targets[i].addEventListener(event_type, test_event, true); |
+ targets[i].addEventListener(event_type, test_event, false); |
+ } |
+ |
+ var evt = document.createEvent("Event"); |
+ evt.initEvent(event_type, false, true); |
+ |
+ target.dispatchEvent(evt); |
+ |
+ assert_array_equals(actual_targets, expected_targets, "targets"); |
+ assert_array_equals(actual_phases, phases, "phases"); |
+}, "Event.dispatchEvent with Event.bubbles set to false."); |
+</script> |