Changeset 202873 in webkit


Ignore:
Timestamp:
Jul 6, 2016 1:09:32 PM (8 years ago)
Author:
Chris Dumez
Message:

[ShadowDOM] assignedSlot property should be on Text, not CharacterData
https://bugs.webkit.org/show_bug.cgi?id=159482
<rdar://problem/27201687>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

  • web-platform-tests/dom/interfaces-expected.txt:

Source/WebCore:

assignedSlot property should be on Text, not CharacterData as per:

Align with the latest specification.

No new tests, rebaselined existing test.

  • CMakeLists.txt:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Element.idl:
  • dom/NonDocumentTypeChildNode.idl:
  • dom/Slotable.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
  • dom/Text.idl:

LayoutTests:

Update / rebaseline a couple of existing tests.

  • fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt.
  • fast/shadow-dom/Slotable-interface-assignedSlot.html: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html.
  • js/dom/dom-static-property-for-in-iteration-expected.txt:
Location:
trunk
Files:
11 edited
1 copied
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202870 r202873  
     12016-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        [ShadowDOM] assignedSlot property should be on Text, not CharacterData
     4        https://bugs.webkit.org/show_bug.cgi?id=159482
     5        <rdar://problem/27201687>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        Update / rebaseline a couple of existing tests.
     10
     11        * fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt.
     12        * fast/shadow-dom/Slotable-interface-assignedSlot.html: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html.
     13        * js/dom/dom-static-property-for-in-iteration-expected.txt:
     14
    1152016-07-06  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot.html

    r202872 r202873  
    22<html>
    33<head>
    4 <title>Shadow DOM: Extensions to NonDocumentTypeChildNode interface</title>
     4<title>Shadow DOM: Slotable interface</title>
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    6 <meta name="assert" content="NonDocumentTypeChildNode interface must have assignedSlot attribute">
     6<meta name="assert" content="Slotable interface must have assignedSlot attribute">
    77<link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#the-slot-element">
    88<script src="../../resources/testharness.js"></script>
     
    1818    assert_true('assignedSlot' in document.createElement('div'), 'assignedSlot must be defined on a div element');
    1919
    20     assert_true('assignedSlot' in CharacterData.prototype, 'assignedSlot must be defined on CharacterData.prototype');
     20    assert_true('assignedSlot' in Text.prototype, 'assignedSlot must be defined on Text.prototype');
    2121    assert_true('assignedSlot' in document.createTextNode(''), 'assignedSlot must be defined on a text node');
    22     assert_true('assignedSlot' in document.createComment(''), 'assignedSlot must be defined on a comment node');
     22    assert_false('assignedSlot' in document.createComment(''), 'assignedSlot must not be defined on a comment node');
     23    assert_false('assignedSlot' in document.createProcessingInstruction('target', 'data'), 'assignedSlot must not be defined on a processing instruction node');
    2324
    2425}, 'assignedSlot attribute must be defined on NonDocumentTypeChildNode interface');
     
    3839    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must be null when a node is not assigned of any slot');
    3940
    40     var commentNode = document.createComment('');
    41     shadowHost.appendChild(commentNode);
    42     assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must be null when a node is not assigned of any slot');
    43 
    4441    var slot = document.createElement('slot');
    4542    slot.name = 'foo';
     
    4744    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must be null when a node does not match any slot');
    4845    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must be null when a node does not match any slot');
    49     assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment must be null when a node does not match any slot');
    5046
    5147}, 'assignedSlot must return null when the node does not have an assigned node');
     
    5955    shadowHost.appendChild(childTextNode);
    6056
    61     var commentNode = document.createComment('');
    62     shadowHost.appendChild(commentNode);
    63 
    64     var processingInstructionNode = document.createProcessingInstruction('target', 'data');
    65     shadowHost.appendChild(processingInstructionNode);
    66 
    6757    var shadowRoot = shadowHost.attachShadow({mode: 'open'});
    6858    var slot = document.createElement('slot');
     
    7161    assert_equals(childElement.assignedSlot, slot, 'assignedSlot on an element must return the assigned default slot element');
    7262    assert_equals(childTextNode.assignedSlot, slot, 'assignedSlot on a text node must return the assigned default slot element');
    73     assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
    74     assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
    7563
    7664    slot.name = 'foo';
    7765    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must null when the element is unassigned from a slot element');
    7866    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must null when the node is unassigned from a slot element');
    79     assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a text node must null when the node is unassigned from a slot element');
    80     assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a text node must null when the node is unassigned from a slot element');
    8167
    8268    childElement.slot = 'foo';
     
    8571    slot.removeAttribute('name');
    8672    assert_equals(childTextNode.assignedSlot, slot, 'assignedSlot on a text node must return the re-assigned slot element');
    87     assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
    88     assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
    8973
    9074}, 'assignedSlot must return the assigned slot');
     
    9882    shadowHost.appendChild(childTextNode);
    9983
    100     var commentNode = document.createTextNode('');
    101     shadowHost.appendChild(commentNode);
    102 
    103     var processingInstructionNode = document.createProcessingInstruction('target', 'data');
    104     shadowHost.appendChild(processingInstructionNode);
    105 
    10684    var shadowRoot = shadowHost.attachShadow({mode: 'closed'});
    10785    var slot = document.createElement('slot');
     
    11088    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must return null if the slot is inside a closed shadow tree.');
    11189    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must return null if the slot is inside a closed shadow tree.');
    112     assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must always return null.');
    113     assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a processing instruction must always return null.');
    11490
    11591}, 'assignedSlot must return null when the assigned slot element is inside a closed shadow tree');
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r202870 r202873  
     12016-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        [ShadowDOM] assignedSlot property should be on Text, not CharacterData
     4        https://bugs.webkit.org/show_bug.cgi?id=159482
     5        <rdar://problem/27201687>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        Rebaseline W3C test now that one more check is passing.
     10
     11        * web-platform-tests/dom/interfaces-expected.txt:
     12
    1132016-07-06  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt

    r202870 r202873  
    11791179PASS Text interface: operation splitText(unsigned long)
    11801180PASS Text interface: attribute wholeText
    1181 FAIL Text interface: attribute assignedSlot assert_own_property: expected property "assignedSlot" missing
     1181PASS Text interface: attribute assignedSlot
    11821182PASS Text must be primary interface of document.createTextNode("abc")
    11831183PASS Stringification of document.createTextNode("abc")
  • trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt

    r202870 r202873  
    128128PASS a["previousElementSibling"] is [object HTMLDivElement]
    129129PASS a["nextElementSibling"] is [object HTMLScriptElement]
    130 PASS a["assignedSlot"] is null
    131130PASS a["children"] is [object HTMLCollection]
    132131PASS a["firstElementChild"] is null
    133132PASS a["lastElementChild"] is null
    134133PASS a["childElementCount"] is 0
     134PASS a["assignedSlot"] is null
    135135PASS a["ALLOW_KEYBOARD_INPUT"] is 1
    136136PASS a["nodeName"] is A
  • trunk/Source/WebCore/CMakeLists.txt

    r202656 r202873  
    412412    dom/SecurityPolicyViolationEvent.idl
    413413    dom/ShadowRoot.idl
     414    dom/Slotable.idl
    414415    dom/StringCallback.idl
    415416    dom/Text.idl
  • trunk/Source/WebCore/ChangeLog

    r202872 r202873  
     12016-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        [ShadowDOM] assignedSlot property should be on Text, not CharacterData
     4        https://bugs.webkit.org/show_bug.cgi?id=159482
     5        <rdar://problem/27201687>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        assignedSlot property should be on Text, not CharacterData as per:
     10        - https://dom.spec.whatwg.org/#mixin-slotable
     11
     12        Align with the latest specification.
     13
     14        No new tests, rebaselined existing test.
     15
     16        * CMakeLists.txt:
     17        * DerivedSources.make:
     18        * WebCore.xcodeproj/project.pbxproj:
     19        * dom/Element.idl:
     20        * dom/NonDocumentTypeChildNode.idl:
     21        * dom/Slotable.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
     22        * dom/Text.idl:
     23
    1242016-07-06  Jeremy Jones  <jeremyj@apple.com>
    225
  • trunk/Source/WebCore/DerivedSources.make

    r202309 r202873  
    335335    $(WebCore)/dom/SecurityPolicyViolationEvent.idl \
    336336    $(WebCore)/dom/ShadowRoot.idl \
     337    $(WebCore)/dom/Slotable.idl \
    337338    $(WebCore)/dom/StringCallback.idl \
    338339    $(WebCore)/dom/Text.idl \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r202656 r202873  
    1068810688                83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
    1068910689                835D363619FF6193004C93AB /* StyleBuilderCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderCustom.h; sourceTree = "<group>"; };
     10690                835F8B261D2D90BA00E408EC /* Slotable.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Slotable.idl; sourceTree = "<group>"; };
    1069010691                8369E58F1AFDD0300087DF68 /* NonDocumentTypeChildNode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NonDocumentTypeChildNode.idl; sourceTree = "<group>"; };
    1069110692                836BAD1F1BD1CA670037356A /* HTMLTableHeaderCellElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableHeaderCellElement.h; sourceTree = "<group>"; };
     
    2481824819                                9B532EA11BA928570038A827 /* SlotAssignment.cpp */,
    2481924820                                9B532EA21BA928570038A827 /* SlotAssignment.h */,
     24821                                835F8B261D2D90BA00E408EC /* Slotable.idl */,
    2482024822                                D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */,
    2482124823                                D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */,
  • trunk/Source/WebCore/dom/Element.idl

    r202539 r202873  
    242242
    243243Element implements ChildNode;
     244Element implements NonDocumentTypeChildNode;
    244245Element implements ParentNode;
    245 Element implements NonDocumentTypeChildNode;
     246Element implements Slotable;
  • trunk/Source/WebCore/dom/NonDocumentTypeChildNode.idl

    r202091 r202873  
    3131    readonly attribute Element previousElementSibling;
    3232    readonly attribute Element nextElementSibling;
    33 
    34 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    35     [EnabledAtRuntime=ShadowDOM, ImplementedAs=assignedSlotForBindings] readonly attribute HTMLSlotElement assignedSlot;
    36 #endif
    3733};
  • trunk/Source/WebCore/dom/Slotable.idl

    r202872 r202873  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2016 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2525 */
    2626
    27 // https://dom.spec.whatwg.org/#interface-nondocumenttypechildnode
    2827[
    2928    NoInterfaceObject,
    30 ] interface NonDocumentTypeChildNode {
    31     readonly attribute Element previousElementSibling;
    32     readonly attribute Element nextElementSibling;
    33 
     29    EnabledAtRuntime=ShadowDOM,
     30] interface Slotable {
    3431#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    35     [EnabledAtRuntime=ShadowDOM, ImplementedAs=assignedSlotForBindings] readonly attribute HTMLSlotElement assignedSlot;
     32    [ImplementedAs=assignedSlotForBindings] readonly attribute HTMLSlotElement? assignedSlot;
    3633#endif
    3734};
  • trunk/Source/WebCore/dom/Text.idl

    r200934 r202873  
    3434};
    3535
     36Text implements Slotable;
Note: See TracChangeset for help on using the changeset viewer.