⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268745 in webkit


Ignore:
Timestamp:
Oct 20, 2020, 10:24:38 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Introduce Selection specific mixin of GlobalEventHandlers
https://bugs.webkit.org/show_bug.cgi?id=217248

Patch by Rob Buis <rbuis@igalia.com> on 2020-10-20
Reviewed by Sam Weinig.

Source/WebCore:

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.

LayoutTests:

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:
Location:
trunk
Files:
13 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r268741 r268745  
     12020-10-20  Rob Buis  <rbuis@igalia.com>
     2
     3        Introduce Selection specific mixin of GlobalEventHandlers
     4        https://bugs.webkit.org/show_bug.cgi?id=217248
     5
     6        Reviewed by Sam Weinig.
     7
     8        Adapt test to GlobalEventHandlers change.
     9
     10        * fast/dom/event-attribute-availability-expected.txt:
     11        * fast/dom/event-handler-attributes-expected.txt:
     12        * fast/dom/event-handler-attributes.html:
     13
    1142020-10-20  Antti Koivisto  <antti@apple.com>
    215
  • trunk/LayoutTests/fast/dom/event-attribute-availability-expected.txt

    r168358 r268745  
    161161PASS 'onreset' in window is true
    162162PASS 'onsearch' in window is true
    163 FAIL 'onselectstart' in window should be true. Was false.
     163PASS 'onselectstart' in window is true
    164164
    165165Test Text Node
  • trunk/LayoutTests/fast/dom/event-handler-attributes-expected.txt

    r267893 r268745  
    6666PASS testScriptAttribute(window, "seeking") is "window"
    6767PASS testScriptAttribute(window, "select") is "window"
     68PASS testScriptAttribute(window, "selectionchange") is "window"
     69PASS testScriptAttribute(window, "selectstart") is "window"
    6870PASS testScriptAttribute(window, "stalled") is "window"
    6971PASS testScriptAttribute(window, "storage") is "window"
     
    9496PASS testScriptAttribute(window, "paste") is "none"
    9597PASS testScriptAttribute(window, "readystatechange") is "none"
    96 PASS testScriptAttribute(window, "selectionchange") is "none"
    97 PASS testScriptAttribute(window, "selectstart") is "none"
    9898
    9999Event names we expect to be able to set on the document
     
    253253PASS testElementAttribute(element, "seeking") is "target"
    254254PASS testElementAttribute(element, "select") is "target"
     255FAIL testElementAttribute(element, "selectionchange") should be target. Was script: target; content: none.
    255256PASS testElementAttribute(element, "selectstart") is "target"
    256257PASS testElementAttribute(element, "stalled") is "target"
     
    279280PASS testElementAttribute(element, "popstate") is "none"
    280281PASS testElementAttribute(element, "readystatechange") is "none"
    281 PASS testElementAttribute(element, "selectionchange") is "none"
    282282PASS testElementAttribute(element, "storage") is "none"
    283283PASS testElementAttribute(element, "unload") is "none"
     
    346346PASS testElementAttribute(inputElement, "seeking") is "target"
    347347PASS testElementAttribute(inputElement, "select") is "target"
     348FAIL testElementAttribute(inputElement, "selectionchange") should be target. Was script: target; content: none.
    348349PASS testElementAttribute(inputElement, "selectstart") is "target"
    349350PASS testElementAttribute(inputElement, "stalled") is "target"
     
    372373PASS testElementAttribute(inputElement, "popstate") is "none"
    373374PASS testElementAttribute(inputElement, "readystatechange") is "none"
    374 PASS testElementAttribute(inputElement, "selectionchange") is "none"
    375375PASS testElementAttribute(inputElement, "storage") is "none"
    376376PASS testElementAttribute(inputElement, "unload") is "none"
     
    439439PASS testElementAttribute(audioElement, "seeking") is "target"
    440440PASS testElementAttribute(audioElement, "select") is "target"
     441FAIL testElementAttribute(audioElement, "selectionchange") should be target. Was script: target; content: none.
    441442PASS testElementAttribute(audioElement, "selectstart") is "target"
    442443PASS testElementAttribute(audioElement, "stalled") is "target"
     
    465466PASS testElementAttribute(audioElement, "popstate") is "none"
    466467PASS testElementAttribute(audioElement, "readystatechange") is "none"
    467 PASS testElementAttribute(audioElement, "selectionchange") is "none"
    468468PASS testElementAttribute(audioElement, "storage") is "none"
    469469PASS testElementAttribute(audioElement, "unload") is "none"
     
    532532PASS testElementAttribute(videoElement, "seeking") is "target"
    533533PASS testElementAttribute(videoElement, "select") is "target"
     534FAIL testElementAttribute(videoElement, "selectionchange") should be target. Was script: target; content: none.
    534535PASS testElementAttribute(videoElement, "selectstart") is "target"
    535536PASS testElementAttribute(videoElement, "stalled") is "target"
     
    558559PASS testElementAttribute(videoElement, "popstate") is "none"
    559560PASS testElementAttribute(videoElement, "readystatechange") is "none"
    560 PASS testElementAttribute(videoElement, "selectionchange") is "none"
    561561PASS testElementAttribute(videoElement, "storage") is "none"
    562562PASS testElementAttribute(videoElement, "unload") is "none"
     
    683683Event names we expect to be forwarded from <frameset> element to document)
    684684
    685 FAIL testElementAttribute(framesetElement, "selectionchange") should be document. Was none.
     685FAIL testElementAttribute(framesetElement, "selectionchange") should be document. Was script: target; content: none.
    686686
    687687Non-forwarded event names on <frameset> element
     
    823823PASS testElementAttribute(rectElement, "seeking") is "target"
    824824PASS testElementAttribute(rectElement, "select") is "target"
     825FAIL testElementAttribute(rectElement, "selectionchange") should be target. Was script: target; content: none.
    825826PASS testElementAttribute(rectElement, "selectstart") is "target"
    826827PASS testElementAttribute(rectElement, "stalled") is "target"
     
    849850PASS testElementAttribute(rectElement, "popstate") is "none"
    850851PASS testElementAttribute(rectElement, "readystatechange") is "none"
    851 PASS testElementAttribute(rectElement, "selectionchange") is "none"
    852852PASS testElementAttribute(rectElement, "storage") is "none"
    853853PASS testElementAttribute(rectElement, "unload") is "none"
     
    927927PASS testElementAttribute(nonHTMLElement, "select") is "none"
    928928PASS testElementAttribute(nonHTMLElement, "selectionchange") is "none"
    929 FAIL testElementAttribute(nonHTMLElement, "selectstart") should be none. Was script: target; content: none.
     929PASS testElementAttribute(nonHTMLElement, "selectstart") is "none"
    930930PASS testElementAttribute(nonHTMLElement, "stalled") is "none"
    931931PASS testElementAttribute(nonHTMLElement, "storage") is "none"
  • trunk/LayoutTests/fast/dom/event-handler-attributes.html

    r258697 r268745  
    6565    "seeking",
    6666    "select",
     67    "selectionchange",
     68    "selectstart",
    6769    "stalled",
    6870    "submit",
     
    99101    "copy",
    100102    "cut",
    101     "paste",
    102     "selectstart",
     103    "paste"
    103104];
    104105
     
    111112
    112113const uniqueDocumentEvents = [
    113     "selectionchange",
    114114    "readystatechange"
    115115];
  • trunk/Source/WebCore/CMakeLists.txt

    r268735 r268745  
    829829    dom/FocusEvent.idl
    830830    dom/GlobalEventHandlers+PointerEvents.idl
     831    dom/GlobalEventHandlers+Selection.idl
    831832    dom/GlobalEventHandlers.idl
    832833    dom/HashChangeEvent.idl
  • trunk/Source/WebCore/ChangeLog

    r268741 r268745  
     12020-10-20  Rob Buis  <rbuis@igalia.com>
     2
     3        Introduce Selection specific mixin of GlobalEventHandlers
     4        https://bugs.webkit.org/show_bug.cgi?id=217248
     5
     6        Reviewed by Sam Weinig.
     7
     8        Introduce Selection specific mixin of GlobalEventHandlers [1] by
     9        splitting out the interface from Document+Selection.idl. This
     10        also means the HTMLBodyElement specific selectionchange IDL is
     11        superflous and can be removed.
     12
     13        Behavior matches Chrome and Firefox.
     14
     15        Test: fast/dom/event-handler-attributes.html
     16
     17        [1] https://w3c.github.io/selection-api/#dom-globaleventhandlers
     18
     19        * CMakeLists.txt:
     20        * DerivedSources-input.xcfilelist:
     21        * DerivedSources-output.xcfilelist:
     22        * DerivedSources.make:
     23        * WebCore.xcodeproj/project.pbxproj:
     24        * dom/Document+Selection.idl:
     25        * dom/Element.idl:
     26        * dom/GlobalEventHandlers+Selection.idl: Copied from Source/WebCore/dom/Document+Selection.idl.
     27
    1282020-10-20  Antti Koivisto  <antti@apple.com>
    229
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r268735 r268745  
    753753$(PROJECT_DIR)/dom/FocusEvent.idl
    754754$(PROJECT_DIR)/dom/GlobalEventHandlers+PointerEvents.idl
     755$(PROJECT_DIR)/dom/GlobalEventHandlers+Selection.idl
    755756$(PROJECT_DIR)/dom/GlobalEventHandlers.idl
    756757$(PROJECT_DIR)/dom/HashChangeEvent.idl
  • trunk/Source/WebCore/DerivedSources-output.xcfilelist

    r268735 r268745  
    921921$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+PointerEvents.cpp
    922922$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+PointerEvents.h
     923$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+Selection.cpp
     924$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers+Selection.h
    923925$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers.cpp
    924926$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers.h
  • trunk/Source/WebCore/DerivedSources.make

    r268735 r268745  
    710710    $(WebCore)/dom/FocusEvent.idl \
    711711    $(WebCore)/dom/GlobalEventHandlers+PointerEvents.idl \
     712    $(WebCore)/dom/GlobalEventHandlers+Selection.idl \
    712713    $(WebCore)/dom/GlobalEventHandlers.idl \
    713714    $(WebCore)/dom/HashChangeEvent.idl \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r268735 r268745  
    79347934                44A28AAB12DFB8AC00AE923B /* MathMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MathMLElementFactory.h; path = DerivedSources/WebCore/MathMLElementFactory.h; sourceTree = BUILT_PRODUCTS_DIR; };
    79357935                44A28AAE12DFB8BF00AE923B /* MathMLNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MathMLNames.h; path = DerivedSources/WebCore/MathMLNames.h; sourceTree = BUILT_PRODUCTS_DIR; };
     7936        44BD2B36252779780055D95A /* GlobalEventHandlers+Selection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "GlobalEventHandlers+Selection.idl"; sourceTree = "<group>"; };
    79367937                44B38BF42536901A00A4458D /* SelectionRangeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionRangeData.h; sourceTree = "<group>"; };
    79377938                44B38BF925369A8800A4458D /* SelectionRangeData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionRangeData.cpp; sourceTree = "<group>"; };
     
    2967429675                                0720B09F14D3323500642955 /* GenericEventQueue.h */,
    2967529676                                7C2D722E25083A3400539662 /* GlobalEventHandlers+PointerEvents.idl */,
     29677                                44BD2B36252779780055D95A /* GlobalEventHandlers+Selection.idl */,
    2967629678                                7C4189AB1B07C170000FA757 /* GlobalEventHandlers.idl */,
    2967729679                                E3BF19E622AF302A009C9926 /* HashChangeEvent.cpp */,
  • trunk/Source/WebCore/dom/Document+Selection.idl

    r267449 r268745  
    3232    // We should get this resolved in the Selection API spec and move this to the correct IDL file.
    3333    DOMSelection? getSelection();
    34 
    35     // FIXME: Should be moved to GlobalEventHandlers (http://w3c.github.io/selection-api/#extensions-to-globaleventhandlers).
    36     [NotEnumerable] attribute EventHandler onselectstart; // FIXME: Should be enumerable.
    37     [NotEnumerable] attribute EventHandler onselectionchange; // FIXME: Should be enumerable.
    3834};
  • trunk/Source/WebCore/dom/Element.idl

    r267953 r268745  
    7474    // FIXME: Most of the following non-standard event handlers probably make more sense as part of the GlobalEventHandlers mixin.
    7575
    76     // Event handler from Selection API (http://w3c.github.io/selection-api/#extensions-to-globaleventhandlers).
    77     [NotEnumerable] attribute EventHandler onselectstart; // FIXME: Should be enumerable.
    78 
    7976    // Non-standard: Cannot find these in the latest specification (https://w3c.github.io/uievents/#events-focus-types).
    8077    [NotEnumerable] attribute EventHandler onfocusin;
  • trunk/Source/WebCore/dom/GlobalEventHandlers+Selection.idl

    r268741 r268745  
    2424 */
    2525
    26 // https://w3c.github.io/selection-api/#extensions-to-document-interface
    27 partial interface Document {
    28     // FIXME: getSelection is currently defined only to be on Document in the Selection API spec
    29     // https://w3c.github.io/selection-api/#extensions-to-document-interface, but
    30     // previously had been defined to be on DocumentOrShadowRoot in the deprecated Shadow DOM spec
    31     // https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin.
    32     // We should get this resolved in the Selection API spec and move this to the correct IDL file.
    33     DOMSelection? getSelection();
    34 
    35     // FIXME: Should be moved to GlobalEventHandlers (http://w3c.github.io/selection-api/#extensions-to-globaleventhandlers).
    36     [NotEnumerable] attribute EventHandler onselectstart; // FIXME: Should be enumerable.
    37     [NotEnumerable] attribute EventHandler onselectionchange; // FIXME: Should be enumerable.
     26// https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers-interface
     27partial interface mixin GlobalEventHandlers {
     28    attribute EventHandler onselectstart;
     29    attribute EventHandler onselectionchange;
    3830};
  • trunk/Source/WebCore/page/DOMWindow.idl

    r267935 r268745  
    131131    WebKitPoint webkitConvertPointFromNodeToPage(optional Node? node = null, optional WebKitPoint? p = null);
    132132
    133 
    134133    // Internal operations, not exposed to the Web.
    135134    [MayThrowException, EnabledForWorld=shadowRootIsAlwaysOpen] NodeList collectMatchingElementsInFlatTree(Node scope, DOMString selectors);
Note: See TracChangeset for help on using the changeset viewer.