Changeset 207571 in webkit


Ignore:
Timestamp:
Oct 19, 2016 3:06:47 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Annotate more DOM and HTML IDLs with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163653

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaselined the tests now that more test cases are passing.

  • web-platform-tests/custom-elements/attribute-changed-callback-expected.txt:
  • web-platform-tests/custom-elements/reactions/DOMStringMap-expected.txt:
  • web-platform-tests/custom-elements/reactions/Document-expected.txt:
  • web-platform-tests/custom-elements/reactions/Element-expected.txt:
  • web-platform-tests/custom-elements/reactions/ElementContentEditable-expected.txt:
  • web-platform-tests/custom-elements/reactions/HTMLElement-expected.txt:
  • web-platform-tests/custom-elements/reactions/Selection-expected.txt:

Source/WebCore:

Added CEReactions to more IDL files.

Test: fast/custom-elements/reactions-for-webkit-extensions.html

  • bindings/js/JSDOMStringMapCustom.cpp:

(WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
adding CEReactions in IDL.
(WebCore::JSDOMStringMap::putDelegate): Ditto.

  • dom/Document.idl:
  • dom/Element.idl:
  • html/HTMLElement.idl:
  • page/DOMSelection.idl:

LayoutTests:

Added a regression test to make sure webkitdropzone IDL attribute on HTMLElement
honors CEReactions semantics using the web-platform-tests' infrastructure I added.

  • fast/custom-elements/reactions-for-webkit-extensions-expected.txt: Added.
  • fast/custom-elements/reactions-for-webkit-extensions.html: Added.
Location:
trunk
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207568 r207571  
     12016-10-19  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Annotate more DOM and HTML IDLs with CEReactions
     4        https://bugs.webkit.org/show_bug.cgi?id=163653
     5
     6        Reviewed by Darin Adler.
     7
     8        Added a regression test to make sure webkitdropzone IDL attribute on HTMLElement
     9        honors CEReactions semantics using the web-platform-tests' infrastructure I added.
     10
     11        * fast/custom-elements/reactions-for-webkit-extensions-expected.txt: Added.
     12        * fast/custom-elements/reactions-for-webkit-extensions.html: Added.
     13
    1142016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r207570 r207571  
     12016-10-19  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Annotate more DOM and HTML IDLs with CEReactions
     4        https://bugs.webkit.org/show_bug.cgi?id=163653
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaselined the tests now that more test cases are passing.
     9
     10        * web-platform-tests/custom-elements/attribute-changed-callback-expected.txt:
     11        * web-platform-tests/custom-elements/reactions/DOMStringMap-expected.txt:
     12        * web-platform-tests/custom-elements/reactions/Document-expected.txt:
     13        * web-platform-tests/custom-elements/reactions/Element-expected.txt:
     14        * web-platform-tests/custom-elements/reactions/ElementContentEditable-expected.txt:
     15        * web-platform-tests/custom-elements/reactions/HTMLElement-expected.txt:
     16        * web-platform-tests/custom-elements/reactions/Selection-expected.txt:
     17
    1182016-10-19  Alex Christensen  <achristensen@webkit.org>
    219
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/attribute-changed-callback-expected.txt

    r206999 r207571  
    99PASS attributedChangedCallback must be enqueued for attributes specified in a non-Array iterable observedAttributes
    1010FAIL attributedChangedCallback must be enqueued for style attribute change by mutating inline style declaration assert_equals: expected 1 but got 0
    11 FAIL attributedChangedCallback must not be enqueued when mutating inline style declaration if the style attribute is not observed undefined is not an object (evaluating 'log.type')
     11PASS attributedChangedCallback must not be enqueued when mutating inline style declaration if the style attribute is not observed
    1212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/DOMStringMap-expected.txt

    r207520 r207571  
    11
    2 FAIL setter on DOMStringMap must enqueue an attributeChanged reaction when adding an observed data attribute assert_array_equals: lengths differ, expected 1 got 0
     2PASS setter on DOMStringMap must enqueue an attributeChanged reaction when adding an observed data attribute
    33PASS setter on DOMStringMap must not enqueue an attributeChanged reaction when adding an unobserved data attribute
    4 FAIL setter on DOMStringMap must enqueue an attributeChanged reaction when mutating the value of an observed data attribute assert_array_equals: lengths differ, expected 2 got 1
    5 FAIL setter on DOMStringMap must enqueue an attributeChanged reaction when mutating the value of an observed data attribute to the same value assert_array_equals: lengths differ, expected 2 got 1
     4PASS setter on DOMStringMap must enqueue an attributeChanged reaction when mutating the value of an observed data attribute
     5PASS setter on DOMStringMap must enqueue an attributeChanged reaction when mutating the value of an observed data attribute to the same value
    66PASS setter on DOMStringMap must not enqueue an attributeChanged reaction when mutating the value of an unobserved data attribute
    7 FAIL deleter on DOMStringMap must enqueue an attributeChanged reaction when removing an observed data attribute assert_array_equals: lengths differ, expected 2 got 1
     7PASS deleter on DOMStringMap must enqueue an attributeChanged reaction when removing an observed data attribute
    88PASS deleter on DOMStringMap must not enqueue an attributeChanged reaction when removing an unobserved data attribute
    99PASS deleter on DOMStringMap must not enqueue an attributeChanged reaction when it does not remove a data attribute
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Document-expected.txt

    r207520 r207571  
    22FAIL importNode on Document must construct a new custom element when importing a custom element assert_array_equals: lengths differ, expected 1 got 0
    33PASS adoptNode on Document must enqueue an adopted reaction when importing a custom element
    4 FAIL execCommand on Document must enqueue a disconnected reaction when deleting a custom element from a contenteditable element assert_array_equals: lengths differ, expected 1 got 0
     4PASS execCommand on Document must enqueue a disconnected reaction when deleting a custom element from a contenteditable element
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Element-expected.txt

    r207520 r207571  
    3333PASS insertAdjacentElement on Element must enqueue a connected reaction
    3434PASS insertAdjacentElement on Element must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    35 FAIL innerHTML on Element must enqueue a connected reaction for a newly constructed custom element assert_array_equals: lengths differ, expected 2 got 1
    36 FAIL innerHTML on Element must enqueue a attributeChanged reaction for a newly constructed custom element assert_array_equals: lengths differ, expected 3 got 1
    37 FAIL innerHTML on Element must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
    38 FAIL outerHTML on Element must enqueue a connected reaction for a newly constructed custom element assert_array_equals: lengths differ, expected 2 got 1
    39 FAIL outerHTML on Element must enqueue a attributeChanged reaction for a newly constructed custom element assert_array_equals: lengths differ, expected 3 got 1
    40 FAIL outerHTML on Element must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
    41 FAIL insertAdjacentHTML on Element must enqueue a connected reaction for a newly constructed custom element assert_array_equals: lengths differ, expected 2 got 1
    42 FAIL insertAdjacentHTML on Element must enqueue a attributeChanged reaction for a newly constructed custom element assert_array_equals: lengths differ, expected 3 got 1
     35PASS innerHTML on Element must enqueue a connected reaction for a newly constructed custom element
     36PASS innerHTML on Element must enqueue a attributeChanged reaction for a newly constructed custom element
     37PASS innerHTML on Element must enqueue a disconnected reaction
     38PASS outerHTML on Element must enqueue a connected reaction for a newly constructed custom element
     39PASS outerHTML on Element must enqueue a attributeChanged reaction for a newly constructed custom element
     40PASS outerHTML on Element must enqueue a disconnected reaction
     41PASS insertAdjacentHTML on Element must enqueue a connected reaction for a newly constructed custom element
     42PASS insertAdjacentHTML on Element must enqueue a attributeChanged reaction for a newly constructed custom element
    4343
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/ElementContentEditable-expected.txt

    r207520 r207571  
    11
    2 FAIL contentEditable on ElementContentEditable must enqueue an attributeChanged reaction when adding contenteditable content attribute assert_array_equals: lengths differ, expected 1 got 0
    3 FAIL contentEditable on ElementContentEditable must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
     2PASS contentEditable on ElementContentEditable must enqueue an attributeChanged reaction when adding contenteditable content attribute
     3PASS contentEditable on ElementContentEditable must enqueue an attributeChanged reaction when replacing an existing attribute
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLElement-expected.txt

    r207520 r207571  
    11
    2 FAIL title on HTMLElement must enqueue an attributeChanged reaction when adding title content attribute assert_array_equals: lengths differ, expected 1 got 0
    3 FAIL title on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    4 FAIL lang on HTMLElement must enqueue an attributeChanged reaction when adding lang content attribute assert_array_equals: lengths differ, expected 1 got 0
    5 FAIL lang on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    6 FAIL translate on HTMLElement must enqueue an attributeChanged reaction when adding translate content attribute assert_array_equals: lengths differ, expected 1 got 0
    7 FAIL translate on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    8 FAIL dir on HTMLElement must enqueue an attributeChanged reaction when adding dir content attribute assert_array_equals: lengths differ, expected 1 got 0
    9 FAIL dir on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    10 FAIL hidden on HTMLElement must enqueue an attributeChanged reaction when adding hidden content attribute assert_array_equals: lengths differ, expected 1 got 0
    11 FAIL hidden on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    12 FAIL tabIndex on HTMLElement must enqueue an attributeChanged reaction when adding tabindex content attribute assert_array_equals: lengths differ, expected 1 got 0
    13 FAIL tabIndex on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    14 FAIL accessKey on HTMLElement must enqueue an attributeChanged reaction when adding accesskey content attribute assert_array_equals: lengths differ, expected 1 got 0
    15 FAIL accessKey on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    16 FAIL draggable on HTMLElement must enqueue an attributeChanged reaction when adding draggable content attribute assert_array_equals: lengths differ, expected 1 got 0
    17 FAIL draggable on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
     2PASS title on HTMLElement must enqueue an attributeChanged reaction when adding title content attribute
     3PASS title on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     4PASS lang on HTMLElement must enqueue an attributeChanged reaction when adding lang content attribute
     5PASS lang on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     6PASS translate on HTMLElement must enqueue an attributeChanged reaction when adding translate content attribute
     7PASS translate on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     8PASS dir on HTMLElement must enqueue an attributeChanged reaction when adding dir content attribute
     9PASS dir on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     10PASS hidden on HTMLElement must enqueue an attributeChanged reaction when adding hidden content attribute
     11PASS hidden on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     12PASS tabIndex on HTMLElement must enqueue an attributeChanged reaction when adding tabindex content attribute
     13PASS tabIndex on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     14PASS accessKey on HTMLElement must enqueue an attributeChanged reaction when adding accesskey content attribute
     15PASS accessKey on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     16PASS draggable on HTMLElement must enqueue an attributeChanged reaction when adding draggable content attribute
     17PASS draggable on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
    1818FAIL dropzone on HTMLElement must enqueue an attributeChanged reaction when adding dropzone content attribute assert_array_equals: lengths differ, expected 1 got 0
    1919FAIL dropzone on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    2020FAIL contextMenu on HTMLElement must enqueue an attributeChanged reaction when adding contextmenu content attribute assert_array_equals: lengths differ, expected 1 got 0
    2121FAIL contextMenu on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    22 FAIL spellcheck on HTMLElement must enqueue an attributeChanged reaction when adding spellcheck content attribute assert_array_equals: lengths differ, expected 1 got 0
    23 FAIL spellcheck on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    24 FAIL innerText on HTMLElement must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
    25 FAIL outerText on HTMLElement must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
     22PASS spellcheck on HTMLElement must enqueue an attributeChanged reaction when adding spellcheck content attribute
     23PASS spellcheck on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute
     24PASS innerText on HTMLElement must enqueue a disconnected reaction
     25PASS outerText on HTMLElement must enqueue a disconnected reaction
    2626
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Selection-expected.txt

    r207520 r207571  
    11
    2 FAIL deleteFromDocument on Selection must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
     2PASS deleteFromDocument on Selection must enqueue a disconnected reaction
    33
  • trunk/Source/WebCore/ChangeLog

    r207568 r207571  
     12016-10-19  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Annotate more DOM and HTML IDLs with CEReactions
     4        https://bugs.webkit.org/show_bug.cgi?id=163653
     5
     6        Reviewed by Darin Adler.
     7
     8        Added CEReactions to more IDL files.
     9
     10        Test: fast/custom-elements/reactions-for-webkit-extensions.html
     11
     12        * bindings/js/JSDOMStringMapCustom.cpp:
     13        (WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
     14        adding CEReactions in IDL.
     15        (WebCore::JSDOMStringMap::putDelegate): Ditto.
     16        * dom/Document.idl:
     17        * dom/Element.idl:
     18        * html/HTMLElement.idl:
     19        * page/DOMSelection.idl:
     20
    1212016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
    222
  • trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp

    r206386 r207571  
    2727#include "JSDOMStringMap.h"
    2828
     29#include "CustomElementReactionQueue.h"
    2930#include "DOMStringMap.h"
    3031#include "JSNode.h"
     
    6364bool JSDOMStringMap::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
    6465{
     66#if ENABLE(CUSTOM_ELEMENTS)
     67    CustomElementReactionStack customElementReactionStack;
     68#endif
     69
    6570    JSDOMStringMap* thisObject = jsCast<JSDOMStringMap*>(cell);
    6671    if (propertyName.isSymbol())
     
    8287        return false;
    8388
     89#if ENABLE(CUSTOM_ELEMENTS)
     90    CustomElementReactionStack customElementReactionStack;
     91#endif
     92
    8493    String stringValue = value.toString(exec)->value(exec);
    8594    RETURN_IF_EXCEPTION(scope, false);
  • trunk/Source/WebCore/dom/Document.idl

    r207541 r207571  
    8484
    8585    // FIXME: The default value for the last parameter should be the empty string.
    86     boolean execCommand(DOMString command, optional boolean userInterface = false, optional DOMString? value = null);
     86    [CEReactions] boolean execCommand(DOMString command, optional boolean userInterface = false, optional DOMString? value = null);
    8787
    8888    boolean queryCommandEnabled(DOMString command);
  • trunk/Source/WebCore/dom/Element.idl

    r207355 r207571  
    9898
    9999    HTMLCollection getElementsByClassName(DOMString name);
    100     [TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString innerHTML;
    101     [TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString outerHTML;
     100    [CEReactions, TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString innerHTML;
     101    [CEReactions, TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString outerHTML;
    102102
    103103    [CEReactions, Reflect=class] attribute DOMString className;
     
    126126
    127127    [CEReactions, MayThrowLegacyException] Element insertAdjacentElement(DOMString where, Element element);
    128     [MayThrowLegacyException] void insertAdjacentHTML(DOMString where, DOMString html);
     128    [CEReactions, MayThrowLegacyException] void insertAdjacentHTML(DOMString where, DOMString html);
    129129    [MayThrowLegacyException] void insertAdjacentText(DOMString where, DOMString text);
    130130
  • trunk/Source/WebCore/html/HTMLElement.idl

    r207355 r207571  
    2727    ExportMacro=WEBCORE_EXPORT,
    2828] interface HTMLElement : Element {
    29     [Reflect] attribute DOMString title;
    30     [Reflect] attribute DOMString lang;
    31     attribute boolean translate;
    32     attribute DOMString dir;
     29    [CEReactions, Reflect] attribute DOMString title;
     30    [CEReactions, Reflect] attribute DOMString lang;
     31    [CEReactions] attribute boolean translate;
     32    [CEReactions] attribute DOMString dir;
    3333
    34     attribute long tabIndex;
    35     attribute boolean draggable;
     34    [CEReactions] attribute long tabIndex;
     35    [CEReactions] attribute boolean draggable;
    3636
    37     [Reflect] attribute DOMString webkitdropzone;
     37    [CEReactions, Reflect] attribute DOMString webkitdropzone;
    3838    // FIXME: Support the standard HTML equivalent.
    3939    // [PutForwards=value] readonly attribute DOMTokenList dropzone;
    4040
    41     [Reflect] attribute boolean hidden;
    42     [Reflect] attribute DOMString accessKey;
     41    [CEReactions, Reflect] attribute boolean hidden;
     42    [CEReactions, Reflect] attribute DOMString accessKey;
    4343
    44     [TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString innerText;
    45     [TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString outerText;
     44    [CEReactions, SetterMayThrowLegacyException, TreatNullAs=EmptyString] attribute DOMString innerText;
     45    [CEReactions, SetterMayThrowLegacyException, TreatNullAs=EmptyString] attribute DOMString outerText;
    4646
    47     [SetterMayThrowLegacyException] attribute DOMString contentEditable;
     47    [CEReactions, SetterMayThrowLegacyException] attribute DOMString contentEditable;
    4848    readonly attribute boolean isContentEditable;
    4949
    50     attribute boolean spellcheck;
     50    [CEReactions] attribute boolean spellcheck;
    5151
    5252    void click();
  • trunk/Source/WebCore/page/DOMSelection.idl

    r206960 r207571  
    4545    [MayThrowException] void collapseToStart();
    4646
    47     void deleteFromDocument();
     47    [CEReactions] void deleteFromDocument();
    4848    boolean containsNode(Node node, optional boolean allowPartial = false);
    4949    void selectAllChildren(Node node);
Note: See TracChangeset for help on using the changeset viewer.