Diff
Modified: trunk/LayoutTests/ChangeLog (268744 => 268745)
--- trunk/LayoutTests/ChangeLog 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/LayoutTests/ChangeLog 2020-10-20 17:24:38 UTC (rev 268745)
@@ -1,3 +1,16 @@
+2020-10-20 Rob Buis <rb...@igalia.com>
+
+ Introduce Selection specific mixin of GlobalEventHandlers
+ https://bugs.webkit.org/show_bug.cgi?id=217248
+
+ Reviewed by Sam Weinig.
+
+ Adapt test to GlobalEventHandlers change.
+
+ * fast/dom/event-attribute-availability-expected.txt:
+ * fast/dom/event-handler-attributes-expected.txt:
+ * fast/dom/event-handler-attributes.html:
+
2020-10-20 Antti Koivisto <an...@apple.com>
Implement <forgiving-selector-list> for :is/:where
Modified: trunk/LayoutTests/fast/dom/event-attribute-availability-expected.txt (268744 => 268745)
--- trunk/LayoutTests/fast/dom/event-attribute-availability-expected.txt 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/LayoutTests/fast/dom/event-attribute-availability-expected.txt 2020-10-20 17:24:38 UTC (rev 268745)
@@ -160,7 +160,7 @@
FAIL 'onpaste' in window should be true. Was false.
PASS 'onreset' in window is true
PASS 'onsearch' in window is true
-FAIL 'onselectstart' in window should be true. Was false.
+PASS 'onselectstart' in window is true
Test Text Node
PASS 'onabort' in textNode is false
Modified: trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt (268744 => 268745)
--- trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt 2020-10-20 17:24:38 UTC (rev 268745)
@@ -65,6 +65,8 @@
PASS testScriptAttribute(window, "seeked") is "window"
PASS testScriptAttribute(window, "seeking") is "window"
PASS testScriptAttribute(window, "select") is "window"
+PASS testScriptAttribute(window, "selectionchange") is "window"
+PASS testScriptAttribute(window, "selectstart") is "window"
PASS testScriptAttribute(window, "stalled") is "window"
PASS testScriptAttribute(window, "storage") is "window"
PASS testScriptAttribute(window, "submit") is "window"
@@ -93,8 +95,6 @@
PASS testScriptAttribute(window, "noneventname") is "none"
PASS testScriptAttribute(window, "paste") is "none"
PASS testScriptAttribute(window, "readystatechange") is "none"
-PASS testScriptAttribute(window, "selectionchange") is "none"
-PASS testScriptAttribute(window, "selectstart") is "none"
Event names we expect to be able to set on the document
@@ -252,6 +252,7 @@
PASS testElementAttribute(element, "seeked") is "target"
PASS testElementAttribute(element, "seeking") is "target"
PASS testElementAttribute(element, "select") is "target"
+FAIL testElementAttribute(element, "selectionchange") should be target. Was script: target; content: none.
PASS testElementAttribute(element, "selectstart") is "target"
PASS testElementAttribute(element, "stalled") is "target"
PASS testElementAttribute(element, "submit") is "target"
@@ -278,7 +279,6 @@
PASS testElementAttribute(element, "pageshow") is "none"
PASS testElementAttribute(element, "popstate") is "none"
PASS testElementAttribute(element, "readystatechange") is "none"
-PASS testElementAttribute(element, "selectionchange") is "none"
PASS testElementAttribute(element, "storage") is "none"
PASS testElementAttribute(element, "unload") is "none"
@@ -345,6 +345,7 @@
PASS testElementAttribute(inputElement, "seeked") is "target"
PASS testElementAttribute(inputElement, "seeking") is "target"
PASS testElementAttribute(inputElement, "select") is "target"
+FAIL testElementAttribute(inputElement, "selectionchange") should be target. Was script: target; content: none.
PASS testElementAttribute(inputElement, "selectstart") is "target"
PASS testElementAttribute(inputElement, "stalled") is "target"
PASS testElementAttribute(inputElement, "submit") is "target"
@@ -371,7 +372,6 @@
PASS testElementAttribute(inputElement, "pageshow") is "none"
PASS testElementAttribute(inputElement, "popstate") is "none"
PASS testElementAttribute(inputElement, "readystatechange") is "none"
-PASS testElementAttribute(inputElement, "selectionchange") is "none"
PASS testElementAttribute(inputElement, "storage") is "none"
PASS testElementAttribute(inputElement, "unload") is "none"
@@ -438,6 +438,7 @@
PASS testElementAttribute(audioElement, "seeked") is "target"
PASS testElementAttribute(audioElement, "seeking") is "target"
PASS testElementAttribute(audioElement, "select") is "target"
+FAIL testElementAttribute(audioElement, "selectionchange") should be target. Was script: target; content: none.
PASS testElementAttribute(audioElement, "selectstart") is "target"
PASS testElementAttribute(audioElement, "stalled") is "target"
PASS testElementAttribute(audioElement, "submit") is "target"
@@ -464,7 +465,6 @@
PASS testElementAttribute(audioElement, "pageshow") is "none"
PASS testElementAttribute(audioElement, "popstate") is "none"
PASS testElementAttribute(audioElement, "readystatechange") is "none"
-PASS testElementAttribute(audioElement, "selectionchange") is "none"
PASS testElementAttribute(audioElement, "storage") is "none"
PASS testElementAttribute(audioElement, "unload") is "none"
@@ -531,6 +531,7 @@
PASS testElementAttribute(videoElement, "seeked") is "target"
PASS testElementAttribute(videoElement, "seeking") is "target"
PASS testElementAttribute(videoElement, "select") is "target"
+FAIL testElementAttribute(videoElement, "selectionchange") should be target. Was script: target; content: none.
PASS testElementAttribute(videoElement, "selectstart") is "target"
PASS testElementAttribute(videoElement, "stalled") is "target"
PASS testElementAttribute(videoElement, "submit") is "target"
@@ -557,7 +558,6 @@
PASS testElementAttribute(videoElement, "pageshow") is "none"
PASS testElementAttribute(videoElement, "popstate") is "none"
PASS testElementAttribute(videoElement, "readystatechange") is "none"
-PASS testElementAttribute(videoElement, "selectionchange") is "none"
PASS testElementAttribute(videoElement, "storage") is "none"
PASS testElementAttribute(videoElement, "unload") is "none"
@@ -682,7 +682,7 @@
Event names we expect to be forwarded from <frameset> element to document)
-FAIL testElementAttribute(framesetElement, "selectionchange") should be document. Was none.
+FAIL testElementAttribute(framesetElement, "selectionchange") should be document. Was script: target; content: none.
Non-forwarded event names on <frameset> element
@@ -822,6 +822,7 @@
PASS testElementAttribute(rectElement, "seeked") is "target"
PASS testElementAttribute(rectElement, "seeking") is "target"
PASS testElementAttribute(rectElement, "select") is "target"
+FAIL testElementAttribute(rectElement, "selectionchange") should be target. Was script: target; content: none.
PASS testElementAttribute(rectElement, "selectstart") is "target"
PASS testElementAttribute(rectElement, "stalled") is "target"
PASS testElementAttribute(rectElement, "submit") is "target"
@@ -848,7 +849,6 @@
PASS testElementAttribute(rectElement, "pageshow") is "none"
PASS testElementAttribute(rectElement, "popstate") is "none"
PASS testElementAttribute(rectElement, "readystatechange") is "none"
-PASS testElementAttribute(rectElement, "selectionchange") is "none"
PASS testElementAttribute(rectElement, "storage") is "none"
PASS testElementAttribute(rectElement, "unload") is "none"
@@ -926,7 +926,7 @@
PASS testElementAttribute(nonHTMLElement, "seeking") is "none"
PASS testElementAttribute(nonHTMLElement, "select") is "none"
PASS testElementAttribute(nonHTMLElement, "selectionchange") is "none"
-FAIL testElementAttribute(nonHTMLElement, "selectstart") should be none. Was script: target; content: none.
+PASS testElementAttribute(nonHTMLElement, "selectstart") is "none"
PASS testElementAttribute(nonHTMLElement, "stalled") is "none"
PASS testElementAttribute(nonHTMLElement, "storage") is "none"
PASS testElementAttribute(nonHTMLElement, "submit") is "none"
Modified: trunk/LayoutTests/fast/dom/event-handler-attributes.html (268744 => 268745)
--- trunk/LayoutTests/fast/dom/event-handler-attributes.html 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/LayoutTests/fast/dom/event-handler-attributes.html 2020-10-20 17:24:38 UTC (rev 268745)
@@ -64,6 +64,8 @@
"seeked",
"seeking",
"select",
+ "selectionchange",
+ "selectstart",
"stalled",
"submit",
"suspend",
@@ -98,8 +100,7 @@
"beforepaste",
"copy",
"cut",
- "paste",
- "selectstart",
+ "paste"
];
const elementAndWindowEvents = [
@@ -110,7 +111,6 @@
];
const uniqueDocumentEvents = [
- "selectionchange",
"readystatechange"
];
Modified: trunk/Source/WebCore/CMakeLists.txt (268744 => 268745)
--- trunk/Source/WebCore/CMakeLists.txt 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/CMakeLists.txt 2020-10-20 17:24:38 UTC (rev 268745)
@@ -828,6 +828,7 @@
dom/EventTarget.idl
dom/FocusEvent.idl
dom/GlobalEventHandlers+PointerEvents.idl
+ dom/GlobalEventHandlers+Selection.idl
dom/GlobalEventHandlers.idl
dom/HashChangeEvent.idl
dom/IdleDeadline.idl
Modified: trunk/Source/WebCore/ChangeLog (268744 => 268745)
--- trunk/Source/WebCore/ChangeLog 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/ChangeLog 2020-10-20 17:24:38 UTC (rev 268745)
@@ -1,3 +1,30 @@
+2020-10-20 Rob Buis <rb...@igalia.com>
+
+ Introduce Selection specific mixin of GlobalEventHandlers
+ https://bugs.webkit.org/show_bug.cgi?id=217248
+
+ Reviewed by Sam Weinig.
+
+ Introduce Selection specific mixin of GlobalEventHandlers [1] by
+ splitting out the interface from Document+Selection.idl. This
+ also means the HTMLBodyElement specific selectionchange IDL is
+ superflous and can be removed.
+
+ Behavior matches Chrome and Firefox.
+
+ Test: fast/dom/event-handler-attributes.html
+
+ [1] https://w3c.github.io/selection-api/#dom-globaleventhandlers
+
+ * CMakeLists.txt:
+ * DerivedSources-input.xcfilelist:
+ * DerivedSources-output.xcfilelist:
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document+Selection.idl:
+ * dom/Element.idl:
+ * dom/GlobalEventHandlers+Selection.idl: Copied from Source/WebCore/dom/Document+Selection.idl.
+
2020-10-20 Antti Koivisto <an...@apple.com>
Implement <forgiving-selector-list> for :is/:where
Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (268744 => 268745)
--- trunk/Source/WebCore/DerivedSources-input.xcfilelist 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist 2020-10-20 17:24:38 UTC (rev 268745)
@@ -752,6 +752,7 @@
$(PROJECT_DIR)/dom/EventTargetFactory.in
$(PROJECT_DIR)/dom/FocusEvent.idl
$(PROJECT_DIR)/dom/GlobalEventHandlers+PointerEvents.idl
+$(PROJECT_DIR)/dom/GlobalEventHandlers+Selection.idl
$(PROJECT_DIR)/dom/GlobalEventHandlers.idl
$(PROJECT_DIR)/dom/HashChangeEvent.idl
$(PROJECT_DIR)/dom/IdleDeadline.idl
Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (268744 => 268745)
--- trunk/Source/WebCore/DerivedSources-output.xcfilelist 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist 2020-10-20 17:24:38 UTC (rev 268745)
@@ -920,6 +920,8 @@
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+CSSTransitions.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+PointerEvents.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+PointerEvents.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+Selection.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+Selection.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLAllCollection.cpp
Modified: trunk/Source/WebCore/DerivedSources.make (268744 => 268745)
--- trunk/Source/WebCore/DerivedSources.make 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/DerivedSources.make 2020-10-20 17:24:38 UTC (rev 268745)
@@ -709,6 +709,7 @@
$(WebCore)/dom/EventTarget.idl \
$(WebCore)/dom/FocusEvent.idl \
$(WebCore)/dom/GlobalEventHandlers+PointerEvents.idl \
+ $(WebCore)/dom/GlobalEventHandlers+Selection.idl \
$(WebCore)/dom/GlobalEventHandlers.idl \
$(WebCore)/dom/HashChangeEvent.idl \
$(WebCore)/dom/IdleDeadline.idl \
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (268744 => 268745)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-10-20 17:24:38 UTC (rev 268745)
@@ -7933,6 +7933,7 @@
44A20DB80F84166C00B3E1FE /* WebCoreURLResponseIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreURLResponseIOS.h; sourceTree = "<group>"; };
44A28AAB12DFB8AC00AE923B /* MathMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MathMLElementFactory.h; path = DerivedSources/WebCore/MathMLElementFactory.h; sourceTree = BUILT_PRODUCTS_DIR; };
44A28AAE12DFB8BF00AE923B /* MathMLNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MathMLNames.h; path = DerivedSources/WebCore/MathMLNames.h; sourceTree = BUILT_PRODUCTS_DIR; };
+ 44BD2B36252779780055D95A /* GlobalEventHandlers+Selection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "GlobalEventHandlers+Selection.idl"; sourceTree = "<group>"; };
44B38BF42536901A00A4458D /* SelectionRangeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionRangeData.h; sourceTree = "<group>"; };
44B38BF925369A8800A4458D /* SelectionRangeData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionRangeData.cpp; sourceTree = "<group>"; };
44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollbarThemeIOS.mm; sourceTree = "<group>"; };
@@ -29673,6 +29674,7 @@
0720B09E14D3323500642955 /* GenericEventQueue.cpp */,
0720B09F14D3323500642955 /* GenericEventQueue.h */,
7C2D722E25083A3400539662 /* GlobalEventHandlers+PointerEvents.idl */,
+ 44BD2B36252779780055D95A /* GlobalEventHandlers+Selection.idl */,
7C4189AB1B07C170000FA757 /* GlobalEventHandlers.idl */,
E3BF19E622AF302A009C9926 /* HashChangeEvent.cpp */,
2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
Modified: trunk/Source/WebCore/dom/Document+Selection.idl (268744 => 268745)
--- trunk/Source/WebCore/dom/Document+Selection.idl 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/dom/Document+Selection.idl 2020-10-20 17:24:38 UTC (rev 268745)
@@ -31,8 +31,4 @@
// https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin.
// We should get this resolved in the Selection API spec and move this to the correct IDL file.
DOMSelection? getSelection();
-
- // FIXME: Should be moved to GlobalEventHandlers (http://w3c.github.io/selection-api/#extensions-to-globaleventhandlers).
- [NotEnumerable] attribute EventHandler onselectstart; // FIXME: Should be enumerable.
- [NotEnumerable] attribute EventHandler onselectionchange; // FIXME: Should be enumerable.
};
Modified: trunk/Source/WebCore/dom/Element.idl (268744 => 268745)
--- trunk/Source/WebCore/dom/Element.idl 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/dom/Element.idl 2020-10-20 17:24:38 UTC (rev 268745)
@@ -73,9 +73,6 @@
// FIXME: Most of the following non-standard event handlers probably make more sense as part of the GlobalEventHandlers mixin.
- // Event handler from Selection API (http://w3c.github.io/selection-api/#extensions-to-globaleventhandlers).
- [NotEnumerable] attribute EventHandler onselectstart; // FIXME: Should be enumerable.
-
// Non-standard: Cannot find these in the latest specification (https://w3c.github.io/uievents/#events-focus-types).
[NotEnumerable] attribute EventHandler onfocusin;
[NotEnumerable] attribute EventHandler onfocusout;
Copied: trunk/Source/WebCore/dom/GlobalEventHandlers+Selection.idl (from rev 268741, trunk/Source/WebCore/dom/Document+Selection.idl) (0 => 268745)
--- trunk/Source/WebCore/dom/GlobalEventHandlers+Selection.idl (rev 0)
+++ trunk/Source/WebCore/dom/GlobalEventHandlers+Selection.idl 2020-10-20 17:24:38 UTC (rev 268745)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers-interface
+partial interface mixin GlobalEventHandlers {
+ attribute EventHandler onselectstart;
+ attribute EventHandler onselectionchange;
+};
Modified: trunk/Source/WebCore/page/DOMWindow.idl (268744 => 268745)
--- trunk/Source/WebCore/page/DOMWindow.idl 2020-10-20 17:18:02 UTC (rev 268744)
+++ trunk/Source/WebCore/page/DOMWindow.idl 2020-10-20 17:24:38 UTC (rev 268745)
@@ -130,7 +130,6 @@
WebKitPoint webkitConvertPointFromPageToNode(optional Node? node = null, optional WebKitPoint? p = null);
WebKitPoint webkitConvertPointFromNodeToPage(optional Node? node = null, optional WebKitPoint? p = null);
-
// Internal operations, not exposed to the Web.
[MayThrowException, EnabledForWorld=shadowRootIsAlwaysOpen] NodeList collectMatchingElementsInFlatTree(Node scope, DOMString selectors);
[MayThrowException, EnabledForWorld=shadowRootIsAlwaysOpen] Element? matchingElementInFlatTree(Node scope, DOMString selectors);