Modified: trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt (287088 => 287089)
--- trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt 2021-12-15 18:55:46 UTC (rev 287088)
+++ trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt 2021-12-15 19:37:58 UTC (rev 287089)
@@ -581,10 +581,6 @@
PASS testElementAttribute(bodyElement, "storage") is "window"
PASS testElementAttribute(bodyElement, "unload") is "window"
-Event names we expect to be forwarded from <body> element to document)
-
-PASS testElementAttribute(bodyElement, "selectionchange") is "document"
-
Non-forwarded event names on <body> element
PASS testElementAttribute(bodyElement, "abort") is "target"
@@ -641,6 +637,7 @@
PASS testElementAttribute(bodyElement, "seeked") is "target"
PASS testElementAttribute(bodyElement, "seeking") is "target"
PASS testElementAttribute(bodyElement, "select") is "target"
+FAIL testElementAttribute(bodyElement, "selectionchange") should be target. Was script: target; content: document.
PASS testElementAttribute(bodyElement, "selectstart") is "target"
PASS testElementAttribute(bodyElement, "stalled") is "target"
PASS testElementAttribute(bodyElement, "submit") is "target"
@@ -680,10 +677,6 @@
PASS testElementAttribute(framesetElement, "storage") is "window"
PASS testElementAttribute(framesetElement, "unload") is "window"
-Event names we expect to be forwarded from <frameset> element to document)
-
-FAIL testElementAttribute(framesetElement, "selectionchange") should be document. Was target.
-
Non-forwarded event names on <frameset> element
PASS testElementAttribute(framesetElement, "abort") is "target"
@@ -740,6 +733,7 @@
PASS testElementAttribute(framesetElement, "seeked") is "target"
PASS testElementAttribute(framesetElement, "seeking") is "target"
PASS testElementAttribute(framesetElement, "select") is "target"
+PASS testElementAttribute(framesetElement, "selectionchange") is "target"
PASS testElementAttribute(framesetElement, "selectstart") is "target"
PASS testElementAttribute(framesetElement, "stalled") is "target"
PASS testElementAttribute(framesetElement, "submit") is "target"
@@ -942,6 +936,10 @@
PASS testElementAttribute(nonHTMLElement, "webkittransitionend") is "none"
PASS testElementAttribute(nonHTMLElement, "wheel") is "none"
+onselectionchange IDL attribute doesn't forward event listeners from <body> element to document
+
+PASS document.onselectionchange is null
+
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/dom/event-handler-attributes.html (287088 => 287089)
--- trunk/LayoutTests/fast/dom/event-handler-attributes.html 2021-12-15 18:55:46 UTC (rev 287088)
+++ trunk/LayoutTests/fast/dom/event-handler-attributes.html 2021-12-15 19:37:58 UTC (rev 287089)
@@ -143,10 +143,6 @@
"unload",
];
-const bodyElementDocumentForwardedEvents = [
- "selectionchange",
-];
-
const nonEventNames = [
"noneventname",
];
@@ -251,7 +247,7 @@
const documentEvents = arrayUnion(eventsInGlobalEventHandlers, elementAndDocumentEvents, uniqueDocumentEvents);
const elementEvents = arrayUnion(eventsInGlobalEventHandlers, elementAndDocumentEvents, elementAndWindowEvents, elementBodyAndFrameSetEvents, uniqueElementEvents);
-const allEventNames = arrayUnion(windowEvents, documentEvents, elementEvents, bodyElementWindowForwardedEvents, bodyElementDocumentForwardedEvents, nonEventNames);
+const allEventNames = arrayUnion(windowEvents, documentEvents, elementEvents, bodyElementWindowForwardedEvents, nonEventNames);
var sectionOpen = false;
@@ -307,14 +303,12 @@
testArray(arrayDifference(allEventNames, elementEvents), "testElementAttribute(videoElement", "none", "Event names we expect not to be able to set on an element (tested on the <video> element)");
testArray(bodyElementWindowForwardedEvents, "testElementAttribute(bodyElement", "window", "Event names we expect to be forwarded from <body> element to window object)");
-testArray(bodyElementDocumentForwardedEvents, "testElementAttribute(bodyElement", "document", "Event names we expect to be forwarded from <body> element to document)");
-testArray(arrayDifference(elementEvents, arrayUnion(bodyElementWindowForwardedEvents, bodyElementDocumentForwardedEvents)), "testElementAttribute(bodyElement", "target", "Non-forwarded event names on <body> element");
-testArray(arrayDifference(allEventNames, arrayUnion(elementEvents, bodyElementWindowForwardedEvents, bodyElementDocumentForwardedEvents)), "testElementAttribute(bodyElement", "none", "Event names we expect to not be able to set on <body> element");
+testArray(arrayDifference(elementEvents, bodyElementWindowForwardedEvents), "testElementAttribute(bodyElement", "target", "Non-forwarded event names on <body> element");
+testArray(arrayDifference(allEventNames, arrayUnion(elementEvents, bodyElementWindowForwardedEvents)), "testElementAttribute(bodyElement", "none", "Event names we expect to not be able to set on <body> element");
testArray(bodyElementWindowForwardedEvents, "testElementAttribute(framesetElement", "window", "Event names we expect to be forwarded from <frameset> element to window object)");
-testArray(bodyElementDocumentForwardedEvents, "testElementAttribute(framesetElement", "document", "Event names we expect to be forwarded from <frameset> element to document)");
-testArray(arrayDifference(elementEvents, arrayUnion(bodyElementWindowForwardedEvents, bodyElementDocumentForwardedEvents)), "testElementAttribute(framesetElement", "target", "Non-forwarded event names on <frameset> element");
-testArray(arrayDifference(allEventNames, arrayUnion(elementEvents, bodyElementWindowForwardedEvents, bodyElementDocumentForwardedEvents)), "testElementAttribute(framesetElement", "none", "Event names we expect to not be able to set on <frameset> element");
+testArray(arrayDifference(elementEvents, bodyElementWindowForwardedEvents), "testElementAttribute(framesetElement", "target", "Non-forwarded event names on <frameset> element");
+testArray(arrayDifference(allEventNames, arrayUnion(elementEvents, bodyElementWindowForwardedEvents)), "testElementAttribute(framesetElement", "none", "Event names we expect to not be able to set on <frameset> element");
testArray(elementEvents, "testElementAttribute(rectElement", "target", "Event names we expect to be able to set on an element (tested on the SVG <rect> element)");
testArray(arrayDifference(allEventNames, elementEvents), "testElementAttribute(rectElement", "none", "Event names we expect not to be able to set on an element (tested on the SVG <rect> element)");
@@ -321,6 +315,11 @@
testArray(allEventNames, "testElementAttribute(nonHTMLElement", "none", "Event names on a non-HTML element");
+section("onselectionchange IDL attribute doesn't forward event listeners from <body> element to document");
+
+document.body._onselectionchange_ = function() {};
+shouldBe("document.onselectionchange", "null");
+
endSection();
/*