Changeset 207170 in webkit


Ignore:
Timestamp:
Oct 11, 2016 3:07:50 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

Annotate DOM API with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163268

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline tests now that more test cases are passing.

  • web-platform-tests/custom-elements/reactions/Attr-expected.txt:
  • web-platform-tests/custom-elements/reactions/ChildNode-expected.txt:
  • web-platform-tests/custom-elements/reactions/DOMTokenList-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/NamedNodeMap-expected.txt:
  • web-platform-tests/custom-elements/reactions/Node-expected.txt:
  • web-platform-tests/custom-elements/reactions/ParentNode-expected.txt:
  • web-platform-tests/custom-elements/reactions/Range-expected.txt:

Source/WebCore:

Added CEReactions IDL attribute to APIs defined in https://dom.spec.whatwg.org.

No new tests since existing tests cover the code change.
Added a dedicated code generation test: JSTestCEReactions.idl and TestCEReactionsStringifier.idl.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation): Generate CustomElementReactionStack in attribute setters. In the case of PutForwards,
check the extended attributes of the target attribute's stringifier.

  • bindings/scripts/test/JS/JSTestCEReactions.cpp: Added.
  • bindings/scripts/test/JS/JSTestCEReactions.h: Added.
  • bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: Added.
  • bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: Added.
  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack): Deleted.

  • bindings/scripts/test/TestCEReactions.idl: Added.
  • bindings/scripts/test/TestCEReactionsStringifier.idl: Added.
  • bindings/scripts/test/TestObj.idl:
  • dom/Attr.idl:
  • dom/ChildNode.idl:
  • dom/Document.idl:
  • dom/Element.idl:
  • dom/NamedNodeMap.idl:
  • dom/Node.idl:
  • dom/ParentNode.idl:
  • dom/Range.idl:
  • html/DOMTokenList.idl:
Location:
trunk
Files:
6 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r207162 r207170  
     12016-10-10  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Annotate DOM API with CEReactions
     4        https://bugs.webkit.org/show_bug.cgi?id=163268
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline tests now that more test cases are passing.
     9
     10        * web-platform-tests/custom-elements/reactions/Attr-expected.txt:
     11        * web-platform-tests/custom-elements/reactions/ChildNode-expected.txt:
     12        * web-platform-tests/custom-elements/reactions/DOMTokenList-expected.txt:
     13        * web-platform-tests/custom-elements/reactions/Document-expected.txt:
     14        * web-platform-tests/custom-elements/reactions/Element-expected.txt:
     15        * web-platform-tests/custom-elements/reactions/NamedNodeMap-expected.txt:
     16        * web-platform-tests/custom-elements/reactions/Node-expected.txt:
     17        * web-platform-tests/custom-elements/reactions/ParentNode-expected.txt:
     18        * web-platform-tests/custom-elements/reactions/Range-expected.txt:
     19
    1202016-10-11  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Attr-expected.txt

    r206838 r207170  
    11
    2 FAIL value on Attr must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     2PASS value on Attr must enqueue an attributeChanged reaction when replacing an existing attribute
    33PASS value on Attr must not enqueue an attributeChanged reaction when replacing an existing unobserved attribute
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/ChildNode-expected.txt

    r206838 r207170  
    11
    2 FAIL before on ChildNode must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    3 FAIL before on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
    4 FAIL after on ChildNode must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    5 FAIL after on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
    6 FAIL replaceWith on ChildNode must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    7 FAIL replaceWith on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
    8 FAIL replaceWith on ChildNode must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
     2PASS before on ChildNode must enqueue a connected reaction
     3PASS before on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
     4PASS after on ChildNode must enqueue a connected reaction
     5PASS after on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
     6PASS replaceWith on ChildNode must enqueue a connected reaction
     7PASS replaceWith on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
     8PASS replaceWith on ChildNode must enqueue a disconnected reaction
    99
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/DOMTokenList-expected.txt

    r206838 r207170  
    11
    2 FAIL add on DOMTokenList must enqueue an attributeChanged reaction when adding an attribute assert_array_equals: lengths differ, expected 1 got 0
     2PASS add on DOMTokenList must enqueue an attributeChanged reaction when adding an attribute
    33PASS add on DOMTokenList must not enqueue an attributeChanged reaction when adding an unobserved attribute
    4 FAIL add on DOMTokenList must enqueue an attributeChanged reaction when adding a value to an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     4PASS add on DOMTokenList must enqueue an attributeChanged reaction when adding a value to an existing attribute
    55PASS add on DOMTokenList must not enqueue an attributeChanged reaction when adding a value to an unobserved attribute
    6 FAIL add on DOMTokenList must enqueue exactly one attributeChanged reaction when adding multiple values to an attribute assert_array_equals: lengths differ, expected 1 got 0
    7 FAIL remove on DOMTokenList must enqueue an attributeChanged reaction when removing a value from an attribute assert_array_equals: lengths differ, expected 1 got 0
    8 FAIL remove on DOMTokenList must enqueue exactly one attributeChanged reaction when removing multiple values to an attribute assert_array_equals: lengths differ, expected 1 got 0
    9 PASS remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a non-existent value from an attribute
     6PASS add on DOMTokenList must enqueue exactly one attributeChanged reaction when adding multiple values to an attribute
     7PASS remove on DOMTokenList must enqueue an attributeChanged reaction when removing a value from an attribute
     8PASS remove on DOMTokenList must enqueue exactly one attributeChanged reaction when removing multiple values to an attribute
     9FAIL remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a non-existent value from an attribute assert_array_equals: lengths differ, expected 0 got 1
    1010PASS remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a value from an unobserved attribute
    11 FAIL toggle on DOMTokenList must enqueue an attributeChanged reaction when adding a value to an attribute assert_array_equals: lengths differ, expected 1 got 0
    12 FAIL toggle on DOMTokenList must enqueue an attributeChanged reaction when removing a value from an attribute assert_array_equals: lengths differ, expected 1 got 0
     11PASS toggle on DOMTokenList must enqueue an attributeChanged reaction when adding a value to an attribute
     12PASS toggle on DOMTokenList must enqueue an attributeChanged reaction when removing a value from an attribute
    1313PASS remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a value from an unobserved attribute
    14 FAIL replace on DOMTokenList must enqueue an attributeChanged reaction when replacing a value in an attribute assert_array_equals: lengths differ, expected 1 got 0
     14PASS replace on DOMTokenList must enqueue an attributeChanged reaction when replacing a value in an attribute
    1515PASS replace on DOMTokenList must not enqueue an attributeChanged reaction when the token to replace does not exist in the attribute
    1616PASS replace on DOMTokenList must not enqueue an attributeChanged reaction when replacing a value in an unobserved attribute
    17 FAIL the stringifier of DOMTokenList must enqueue an attributeChanged reaction when adding an observed attribute assert_array_equals: lengths differ, expected 1 got 0
     17PASS the stringifier of DOMTokenList must enqueue an attributeChanged reaction when adding an observed attribute
    1818PASS the stringifier of DOMTokenList must not enqueue an attributeChanged reaction when adding an unobserved attribute
    19 FAIL the stringifier of DOMTokenList must enqueue an attributeChanged reaction when mutating the value of an observed attribute assert_array_equals: lengths differ, expected 1 got 0
     19PASS the stringifier of DOMTokenList must enqueue an attributeChanged reaction when mutating the value of an observed attribute
    2020PASS the stringifier of DOMTokenList must not enqueue an attributeChanged reaction when mutating the value of an unobserved attribute
    21 FAIL the stringifier of DOMTokenList must enqueue an attributeChanged reaction when the setter is called with the original value of the attribute assert_array_equals: lengths differ, expected 1 got 0
     21PASS the stringifier of DOMTokenList must enqueue an attributeChanged reaction when the setter is called with the original value of the attribute
    2222
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Document-expected.txt

    r206838 r207170  
    11
    22FAIL importNode on Document must construct a new custom element when importing a custom element assert_array_equals: lengths differ, expected 1 got 0
    3 FAIL adoptNode on Document must enqueue an adopted reaction when importing a custom element assert_array_equals: lengths differ, expected 1 got 0
     3PASS adoptNode on Document must enqueue an adopted reaction when importing a custom element
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Element-expected.txt

    r206838 r207170  
    11
    2 FAIL id on Element must enqueue an attributeChanged reaction when adding id content attribute assert_array_equals: lengths differ, expected 1 got 0
    3 FAIL id on Element must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    4 FAIL className on Element must enqueue an attributeChanged reaction when adding class content attribute assert_array_equals: lengths differ, expected 1 got 0
    5 FAIL className on Element must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
    6 FAIL slot on Element must enqueue an attributeChanged reaction when adding slot content attribute assert_array_equals: lengths differ, expected 1 got 0
    7 FAIL slot on Element must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1
     2PASS id on Element must enqueue an attributeChanged reaction when adding id content attribute
     3PASS id on Element must enqueue an attributeChanged reaction when replacing an existing attribute
     4PASS className on Element must enqueue an attributeChanged reaction when adding class content attribute
     5PASS className on Element must enqueue an attributeChanged reaction when replacing an existing attribute
     6PASS slot on Element must enqueue an attributeChanged reaction when adding slot content attribute
     7PASS slot on Element must enqueue an attributeChanged reaction when replacing an existing attribute
    88PASS setAttribute on Element must enqueue an attributeChanged reaction when adding an attribute
    99PASS setAttribute on Element must not enqueue an attributeChanged reaction when adding an unobserved attribute
     
    3434PASS removeAttributeNode on Element must enqueue an attributeChanged reaction when removing an existing attribute
    3535PASS removeAttributeNode on Element must not enqueue an attributeChanged reaction when removing an existing unobserved attribute
    36 FAIL undefined must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    37 FAIL undefined must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
     36PASS undefined must enqueue a connected reaction
     37PASS undefined must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    3838
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/NamedNodeMap-expected.txt

    r206838 r207170  
    11
    2 FAIL setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when adding an attribute assert_array_equals: lengths differ, expected 1 got 0
     2PASS setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when adding an attribute
    33PASS setNamedItem on NamedNodeMap must not enqueue an attributeChanged reaction when adding an unobserved attribute
    4 FAIL setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     4PASS setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute
    55PASS setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing unobserved attribute
    6 FAIL setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when adding an attribute assert_array_equals: lengths differ, expected 1 got 0
     6PASS setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when adding an attribute
    77PASS setNamedItemNS on NamedNodeMap must not enqueue an attributeChanged reaction when adding an unobserved attribute
    8 FAIL setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     8PASS setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute
    99PASS setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing unobserved attribute
    1010FAIL removeNamedItem on NamedNodeMap must not enqueue an attributeChanged reaction when removing an attribute that does not exist The object can not be found here.
    1111PASS removeNamedItem on NamedNodeMap must not enqueue an attributeChanged reaction when removing an unobserved attribute
    12 FAIL removeNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when removing an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     12PASS removeNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when removing an existing attribute
    1313PASS removeNamedItem on NamedNodeMap must not enqueue an attributeChanged reaction when removing an existing unobserved attribute
    1414FAIL removeNamedItemNS on NamedNodeMap must not enqueue an attributeChanged reaction when removing an attribute that does not exist The object can not be found here.
    1515PASS removeNamedItemNS on NamedNodeMap must not enqueue an attributeChanged reaction when removing an unobserved attribute
    16 FAIL removeNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when removing an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     16PASS removeNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when removing an existing attribute
    1717PASS removeNamedItemNS on NamedNodeMap must not enqueue an attributeChanged reaction when removing an existing unobserved attribute
    1818
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Node-expected.txt

    r206838 r207170  
    11
    2 FAIL nodeValue on Node must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     2PASS nodeValue on Node must enqueue an attributeChanged reaction when replacing an existing attribute
    33PASS nodeValue on Node must not enqueue an attributeChanged reaction when replacing an existing unobserved attribute
    4 FAIL textContent on Node must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 1 got 0
     4FAIL textContent on Node must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 1 got 2
    55PASS textContent on Node must not enqueue an attributeChanged reaction when replacing an existing unobserved attribute
    66FAIL cloneNode on Node must enqueue an attributeChanged reaction when cloning an element with an observed attribute assert_array_equals: lengths differ, expected 2 got 1
    77PASS cloneNode on Node must not enqueue an attributeChanged reaction when cloning an element with an unobserved attribute
    8 FAIL cloneNode on Node must enqueue an attributeChanged reaction when cloning an element only for observed attributes assert_array_equals: lengths differ, expected 4 got 3
    9 FAIL insertBefore on ChildNode must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    10 FAIL insertBefore on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
     8FAIL cloneNode on Node must enqueue an attributeChanged reaction when cloning an element only for observed attributes assert_array_equals: lengths differ, expected 3 got 1
     9PASS insertBefore on ChildNode must enqueue a connected reaction
     10PASS insertBefore on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    1111PASS appendChild on ChildNode must enqueue a connected reaction
    1212PASS appendChild on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    13 FAIL replaceChild on ChildNode must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    14 FAIL replaceChild on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
     13PASS replaceChild on ChildNode must enqueue a connected reaction
     14PASS replaceChild on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    1515PASS removeChild on ChildNode must enqueue a disconnected reaction
    1616
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/ParentNode-expected.txt

    r206838 r207170  
    11
    2 FAIL prepend on ParentNode must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    3 FAIL prepend on ParentNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
    4 FAIL append on ParentNode must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    5 FAIL append on ParentNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
     2PASS prepend on ParentNode must enqueue a connected reaction
     3PASS prepend on ParentNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
     4PASS append on ParentNode must enqueue a connected reaction
     5PASS append on ParentNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    66
  • trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/Range-expected.txt

    r206838 r207170  
    11
    2 FAIL deleteContents on Range must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
    3 FAIL extractContents on Range must enqueue a disconnected reaction assert_array_equals: lengths differ, expected 1 got 0
    4 FAIL cloneContents on Range must enqueue an attributeChanged reaction when cloning an element with an observed attribute assert_array_equals: lengths differ, expected 2 got 0
    5 FAIL cloneContents on Range must not enqueue an attributeChanged reaction when cloning an element with an unobserved attribute assert_array_equals: lengths differ, expected 1 got 0
    6 FAIL cloneContents on Range must enqueue an attributeChanged reaction when cloning an element only for observed attributes assert_array_equals: lengths differ, expected 4 got 3
    7 FAIL insertNode on Range must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    8 FAIL insertNode on Range must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
    9 FAIL insertNode on Range must enqueue a connected reaction assert_array_equals: lengths differ, expected 1 got 0
    10 FAIL insertNode on Range must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document assert_array_equals: lengths differ, expected 1 got 0
     2PASS deleteContents on Range must enqueue a disconnected reaction
     3PASS extractContents on Range must enqueue a disconnected reaction
     4FAIL cloneContents on Range must enqueue an attributeChanged reaction when cloning an element with an observed attribute assert_array_equals: lengths differ, expected 2 got 1
     5PASS cloneContents on Range must not enqueue an attributeChanged reaction when cloning an element with an unobserved attribute
     6FAIL cloneContents on Range must enqueue an attributeChanged reaction when cloning an element only for observed attributes assert_array_equals: lengths differ, expected 3 got 1
     7PASS insertNode on Range must enqueue a connected reaction
     8PASS insertNode on Range must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
     9PASS insertNode on Range must enqueue a connected reaction
     10PASS insertNode on Range must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document
    1111
  • trunk/Source/WebCore/ChangeLog

    r207169 r207170  
     12016-10-10  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Annotate DOM API with CEReactions
     4        https://bugs.webkit.org/show_bug.cgi?id=163268
     5
     6        Reviewed by Darin Adler.
     7
     8        Added CEReactions IDL attribute to APIs defined in https://dom.spec.whatwg.org.
     9
     10        No new tests since existing tests cover the code change.
     11        Added a dedicated code generation test: JSTestCEReactions.idl and TestCEReactionsStringifier.idl.
     12
     13        * bindings/scripts/CodeGeneratorJS.pm:
     14        (GenerateImplementation): Generate CustomElementReactionStack in attribute setters. In the case of PutForwards,
     15        check the extended attributes of the target attribute's stringifier.
     16        * bindings/scripts/test/JS/JSTestCEReactions.cpp: Added.
     17        * bindings/scripts/test/JS/JSTestCEReactions.h: Added.
     18        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: Added.
     19        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: Added.
     20        * bindings/scripts/test/JS/JSTestObj.cpp:
     21        (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack): Deleted.
     22        * bindings/scripts/test/TestCEReactions.idl: Added.
     23        * bindings/scripts/test/TestCEReactionsStringifier.idl: Added.
     24        * bindings/scripts/test/TestObj.idl:
     25        * dom/Attr.idl:
     26        * dom/ChildNode.idl:
     27        * dom/Document.idl:
     28        * dom/Element.idl:
     29        * dom/NamedNodeMap.idl:
     30        * dom/Node.idl:
     31        * dom/ParentNode.idl:
     32        * dom/Range.idl:
     33        * html/DOMTokenList.idl:
     34
    1352016-10-11  Chris Dumez  <cdumez@apple.com>
    236
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r207150 r207170  
    32993299            }
    33003300
     3301            if ($attribute->signature->extendedAttributes->{CEReactions}) {
     3302                push(@implContent, "#if ENABLE(CUSTOM_ELEMENTS)\n");
     3303                push(@implContent, "    CustomElementReactionStack customElementReactionStack;\n");
     3304                push(@implContent, "#endif\n");
     3305                $implIncludes{"CustomElementReactionQueue.h"} = 1;
     3306            }
     3307
    33013308            if ($interface->extendedAttributes->{CheckSecurity} && !$attribute->signature->extendedAttributes->{DoNotCheckSecurity} && !$attribute->signature->extendedAttributes->{DoNotCheckSecurityOnSetter}) {
    33023309                if ($interfaceName eq "DOMWindow") {
     
    33493356                    if ($putForwards) {
    33503357                        my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{ImplementedAs} || $name);
     3358                        my $forwardedAttribute = $codeGenerator->GetAttributeFromInterface($interface, $type, $putForwards);
     3359
     3360                        if ($forwardedAttribute->signature->extendedAttributes->{CEReactions}) {
     3361                            push(@implContent, "#if ENABLE(CUSTOM_ELEMENTS)\n");
     3362                            push(@implContent, "    CustomElementReactionStack customElementReactionStack;\n");
     3363                            push(@implContent, "#endif\n");
     3364                            $implIncludes{"CustomElementReactionQueue.h"} = 1;
     3365                        }
     3366
    33513367                        if ($attribute->signature->isNullable) {
    33523368                            push(@implContent, "    RefPtr<${type}> forwardedImpl = castedThis->wrapped().${implGetterFunctionName}();\n");
     
    33593375                            push(@implContent, "    auto& impl = forwardedImpl.get();\n");
    33603376                        }
    3361                         $attribute = $codeGenerator->GetAttributeFromInterface($interface, $type, $putForwards);
     3377                        $attribute = $forwardedAttribute;
    33623378                        $type = $attribute->signature->type;
    33633379                    } else {
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r207154 r207170  
    2323
    2424#include "CallbackFunction.h"
    25 #include "CustomElementReactionQueue.h"
    2625#include "DOMStringList.h"
    2726#include "Dictionary.h"
     
    979978JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException(JSC::ExecState*);
    980979JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestCustomPromiseFunction(JSC::ExecState*);
    981 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack(JSC::ExecState*);
    982980#if ENABLE(CONDITION1) || ENABLE(CONDITION2)
    983981JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalOverload(JSC::ExecState*);
     
    15891587    { "testPromiseOverloadedFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseOverloadedFunction), (intptr_t) (1) } },
    15901588    { "testCustomPromiseFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestCustomPromiseFunction), (intptr_t) (0) } },
    1591     { "methodWithNeedsCustomElementReactionStack", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack), (intptr_t) (0) } },
    15921589#if ENABLE(CONDITION1) || ENABLE(CONDITION2)
    15931590    { "conditionalOverload", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalOverload), (intptr_t) (1) } },
     
    74237420}
    74247421
    7425 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack(ExecState* state)
    7426 {
    7427     VM& vm = state->vm();
    7428     auto throwScope = DECLARE_THROW_SCOPE(vm);
    7429     UNUSED_PARAM(throwScope);
    7430 #if ENABLE(CUSTOM_ELEMENTS)
    7431     CustomElementReactionStack customElementReactionStack;
    7432 #endif
    7433     JSValue thisValue = state->thisValue();
    7434     auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
    7435     if (UNLIKELY(!castedThis))
    7436         return throwThisTypeError(*state, throwScope, "TestObject", "methodWithNeedsCustomElementReactionStack");
    7437     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    7438     auto& impl = castedThis->wrapped();
    7439     impl.methodWithNeedsCustomElementReactionStack();
    7440     return JSValue::encode(jsUndefined());
    7441 }
    7442 
    74437422#if ENABLE(CONDITION1)
    74447423static inline EncodedJSValue jsTestObjPrototypeFunctionConditionalOverload1(ExecState* state)
  • trunk/Source/WebCore/bindings/scripts/test/TestObj.idl

    r207058 r207170  
    400400    [PutForwards=name] readonly attribute TestNode putForwardsAttribute;
    401401    [PutForwards=name] readonly attribute TestNode? putForwardsNullableAttribute;
    402 
    403 #if defined(TESTING_JS)
    404     [CEReactions] void methodWithNeedsCustomElementReactionStack();
    405 #endif
    406402
    407403#if defined(TESTING_JS)
  • trunk/Source/WebCore/dom/Attr.idl

    r204687 r207170  
    2828    readonly attribute boolean specified;
    2929
    30     [ImplementedAs=valueForBindings] attribute DOMString value;
     30    [CEReactions, ImplementedAs=valueForBindings] attribute DOMString value;
    3131
    3232    readonly attribute Element ownerElement;
  • trunk/Source/WebCore/dom/ChildNode.idl

    r206956 r207170  
    2323    NoInterfaceObject,
    2424] interface ChildNode {
    25     [Unscopable, MayThrowLegacyException] void before((Node or DOMString)... nodes);
    26     [Unscopable, MayThrowLegacyException] void after((Node or DOMString)... nodes);
    27     [Unscopable, MayThrowLegacyException] void replaceWith((Node or DOMString)... nodes);
    28     [Unscopable, MayThrowLegacyException] void remove();
     25    [CEReactions, Unscopable, MayThrowLegacyException] void before((Node or DOMString)... nodes);
     26    [CEReactions, Unscopable, MayThrowLegacyException] void after((Node or DOMString)... nodes);
     27    [CEReactions, Unscopable, MayThrowLegacyException] void replaceWith((Node or DOMString)... nodes);
     28    [CEReactions, Unscopable, MayThrowLegacyException] void remove();
    2929};
  • trunk/Source/WebCore/dom/Document.idl

    r206960 r207170  
    4343    HTMLCollection getElementsByTagName(DOMString tagname);
    4444
    45     [NewObject, MayThrowLegacyException] Node importNode(Node importedNode, optional boolean deep = false);
     45    [CEReactions, MayThrowLegacyException, NewObject] Node importNode(Node importedNode, optional boolean deep = false);
    4646
    4747    [NewObject, MayThrowLegacyException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
     
    5656    attribute boolean xmlStandalone;
    5757
    58     [MayThrowLegacyException] Node adoptNode(Node source);
     58    [CEReactions, MayThrowLegacyException] Node adoptNode(Node source);
    5959
    6060    [ImplementedAs=urlForBindings] readonly attribute USVString documentURI;
  • trunk/Source/WebCore/dom/Element.idl

    r206944 r207170  
    2929    DOMString? getAttribute(DOMString name);
    3030
    31     [MayThrowLegacyException, CEReactions] void setAttribute(DOMString name, DOMString value);
     31    [CEReactions, MayThrowLegacyException] void setAttribute(DOMString name, DOMString value);
    3232
    3333    [CEReactions] void removeAttribute(DOMString name);
    3434    Attr? getAttributeNode(DOMString name);
    3535
    36     [MayThrowLegacyException, CEReactions] Attr? setAttributeNode(Attr newAttr);
    37     [MayThrowLegacyException, CEReactions] Attr removeAttributeNode(Attr oldAttr);
     36    [CEReactions, MayThrowLegacyException] Attr? setAttributeNode(Attr newAttr);
     37    [CEReactions, MayThrowLegacyException] Attr removeAttributeNode(Attr oldAttr);
    3838
    3939    HTMLCollection getElementsByTagName(DOMString name);
     
    4444    DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName);
    4545
    46     [MayThrowLegacyException, CEReactions] void setAttributeNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString value);
     46    [CEReactions, MayThrowLegacyException] void setAttributeNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString value);
    4747    [CEReactions] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
    4848
     
    5050
    5151    Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
    52     [MayThrowLegacyException, CEReactions] Attr? setAttributeNodeNS(Attr newAttr);
     52    [CEReactions, MayThrowLegacyException] Attr? setAttributeNodeNS(Attr newAttr);
    5353    boolean hasAttribute(DOMString name);
    5454
     
    5757    [ImplementedAs=cssomStyle] readonly attribute CSSStyleDeclaration style;
    5858
    59     [Reflect] attribute DOMString id;
     59    [CEReactions, Reflect] attribute DOMString id;
    6060
    6161    readonly attribute DOMString? namespaceURI;
     
    101101    [TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString outerHTML;
    102102
    103     [Reflect=class] attribute DOMString className;
     103    [CEReactions, Reflect=class] attribute DOMString className;
    104104    [PutForwards=value] readonly attribute DOMTokenList classList;
    105105
     
    125125#endif
    126126
    127     [MayThrowLegacyException] Element insertAdjacentElement(DOMString where, Element element);
     127    [CEReactions, MayThrowLegacyException] Element insertAdjacentElement(DOMString where, Element element);
    128128    [MayThrowLegacyException] void insertAdjacentHTML(DOMString where, DOMString html);
    129129    [MayThrowLegacyException] void insertAdjacentText(DOMString where, DOMString text);
     
    138138    [EnabledAtRuntime=ShadowDOM, MayThrowLegacyException] ShadowRoot attachShadow(ShadowRootInit init);
    139139    [EnabledAtRuntime=ShadowDOM, ImplementedAs=shadowRootForBindings, CallWith=ScriptState] readonly attribute ShadowRoot shadowRoot;
    140     [EnabledAtRuntime=ShadowDOM, Reflect] attribute DOMString slot;
     140    [CEReactions, EnabledAtRuntime=ShadowDOM, Reflect] attribute DOMString slot;
    141141
    142142    // Event Handlers
  • trunk/Source/WebCore/dom/NamedNodeMap.idl

    r206723 r207170  
    2727
    2828    getter Attr? getNamedItem(DOMString name);
    29     [MayThrowLegacyException] Attr? setNamedItem(Attr attr);
    30     [MayThrowLegacyException] Attr removeNamedItem(DOMString name);
     29    [CEReactions, MayThrowLegacyException] Attr? setNamedItem(Attr attr);
     30    [CEReactions, MayThrowLegacyException] Attr removeNamedItem(DOMString name);
    3131    getter Attr? item(unsigned long index);
    3232    Attr? getNamedItemNS(DOMString? namespaceURI, DOMString localName);
    33     [MayThrowLegacyException, ImplementedAs=setNamedItem] Attr? setNamedItemNS(Attr attr);
    34     [MayThrowLegacyException] Attr removeNamedItemNS(DOMString? namespaceURI, DOMString localName);
     33    [CEReactions, MayThrowLegacyException, ImplementedAs=setNamedItem] Attr? setNamedItemNS(Attr attr);
     34    [CEReactions, MayThrowLegacyException] Attr removeNamedItemNS(DOMString? namespaceURI, DOMString localName);
    3535};
  • trunk/Source/WebCore/dom/Node.idl

    r207013 r207170  
    4545
    4646    // FIXME: the spec says this can also raise on retrieval.
    47     [SetterMayThrowLegacyException] attribute DOMString? nodeValue;
     47    [CEReactions, SetterMayThrowLegacyException] attribute DOMString? nodeValue;
    4848
    4949    readonly attribute unsigned short nodeType;
     
    5656    readonly attribute Document? ownerDocument;
    5757
    58     [Custom, MayThrowLegacyException] Node insertBefore([CustomReturn] Node newChild, Node? refChild);
    59     [Custom, MayThrowLegacyException] Node replaceChild(Node newChild, [CustomReturn] Node oldChild);
    60     [Custom, MayThrowLegacyException, CEReactions] Node removeChild([CustomReturn] Node oldChild);
    61     [Custom, MayThrowLegacyException, CEReactions] Node appendChild([CustomReturn] Node newChild);
     58    [CEReactions, Custom, MayThrowLegacyException] Node insertBefore([CustomReturn] Node newChild, Node? refChild);
     59    [CEReactions, Custom, MayThrowLegacyException] Node replaceChild(Node newChild, [CustomReturn] Node oldChild);
     60    [CEReactions, Custom, MayThrowLegacyException] Node removeChild([CustomReturn] Node oldChild);
     61    [CEReactions, Custom, MayThrowLegacyException] Node appendChild([CustomReturn] Node newChild);
    6262
    6363    boolean hasChildNodes();
    6464
    65     [NewObject, MayThrowLegacyException, ImplementedAs=cloneNodeForBindings, CEReactions] Node cloneNode(optional boolean deep = false);
     65    [CEReactions, ImplementedAs=cloneNodeForBindings, MayThrowLegacyException, NewObject] Node cloneNode(optional boolean deep = false);
    6666
    6767    void normalize();
     
    7070
    7171    // FIXME: the spec says this can also raise on retrieval.
    72     [SetterMayThrowLegacyException] attribute DOMString? textContent;
     72    [CEReactions, SetterMayThrowLegacyException] attribute DOMString? textContent;
    7373
    7474    boolean isSameNode(Node? other);
  • trunk/Source/WebCore/dom/ParentNode.idl

    r206956 r207170  
    3434    readonly attribute unsigned long childElementCount;
    3535
    36     [Unscopable, MayThrowLegacyException] void prepend((Node or DOMString)... nodes);
    37     [Unscopable, MayThrowLegacyException] void append((Node or DOMString)... nodes);
     36    [CEReactions, Unscopable, MayThrowLegacyException] void prepend((Node or DOMString)... nodes);
     37    [CEReactions, Unscopable, MayThrowLegacyException] void append((Node or DOMString)... nodes);
    3838
    3939    // [Unscopable] Element? query(DOMString relativeSelectors);
  • trunk/Source/WebCore/dom/Range.idl

    r206723 r207170  
    4242    [MayThrowLegacyException] void setEndAfter(Node refNode);
    4343    void collapse(optional boolean toStart = false);
     44    // FIXME: Using "undefined" as default parameter value is wrong.
     45    [MayThrowLegacyException] void expand(optional DOMString unit = "undefined");
    4446    [MayThrowLegacyException] void selectNode(Node refNode);
    4547    [MayThrowLegacyException] void selectNodeContents(Node refNode);
     
    5355    [MayThrowLegacyException, ImplementedAs=compareBoundaryPointsForBindings] short compareBoundaryPoints(unsigned short how, Range sourceRange);
    5456
    55     [MayThrowLegacyException] void deleteContents();
    56     [MayThrowLegacyException, NewObject] DocumentFragment extractContents();
    57     [MayThrowLegacyException, NewObject] DocumentFragment cloneContents();
    58     [MayThrowLegacyException] void insertNode(Node newNode);
    59     [MayThrowLegacyException] void surroundContents(Node newParent);
     57    [CEReactions, MayThrowLegacyException] void deleteContents();
     58    [CEReactions, MayThrowLegacyException, NewObject] DocumentFragment extractContents();
     59    [CEReactions, MayThrowLegacyException, NewObject] DocumentFragment cloneContents();
     60    [CEReactions, MayThrowLegacyException] void insertNode(Node newNode);
     61    [CEReactions, MayThrowLegacyException] void surroundContents(Node newParent);
    6062    [NewObject] Range cloneRange();
    6163    DOMString toString();
     
    8082    [MayThrowLegacyException] short comparePoint(Node refNode, unsigned long offset);
    8183    [MayThrowLegacyException] boolean isPointInRange(Node refNode, unsigned long offset);
    82 
    83     // FIXME: Using "undefined" as default parameter value is wrong.
    84     [MayThrowLegacyException] void expand(optional DOMString unit = "undefined");
    8584};
  • trunk/Source/WebCore/html/DOMTokenList.idl

    r206723 r207170  
    3131    getter DOMString? item(unsigned long index);
    3232    boolean contains(DOMString token);
    33     [MayThrowLegacyException] void add(DOMString... tokens);
    34     [MayThrowLegacyException] void remove(DOMString... tokens);
    35     [MayThrowLegacyException] boolean toggle(DOMString token, optional boolean force);
    36     [MayThrowLegacyException] void replace(DOMString token, DOMString newToken);
     33    [CEReactions, MayThrowLegacyException] void add(DOMString... tokens);
     34    [CEReactions, MayThrowLegacyException] void remove(DOMString... tokens);
     35    [CEReactions, MayThrowLegacyException] boolean toggle(DOMString token, optional boolean force);
     36    [CEReactions, MayThrowLegacyException] void replace(DOMString token, DOMString newToken);
    3737    [MayThrowLegacyException] boolean supports(DOMString token);
    3838
    3939    iterable<DOMString>;
    4040
    41     stringifier attribute DOMString value;
     41    [CEReactions] stringifier attribute DOMString value;
    4242};
Note: See TracChangeset for help on using the changeset viewer.