Changeset 207519 in webkit


Ignore:
Timestamp:
Oct 18, 2016 9:46:39 PM (8 years ago)
Author:
Chris Dumez
Message:

[Web IDL] Drop webkit-specific extended attributes that are no longer useful
https://bugs.webkit.org/show_bug.cgi?id=163643

Reviewed by Ryosuke Niwa.

Source/WebCore:

Drop webkit-specific IDL extended attributes that are no longer useful:

  • [CustomReturn]: I believe this used to be for ObjC bindings. It has no impact in JS bindings.
  • [Deletable]: It only had an impact on static attributes and was only used on HTMLAllCollection.all, which is not static. I updated the bindings generator to so that static attributes are now configurable by default (unless marked as [Unforgeable], as per Web IDL [1]. This causes Notification.permission (This only static attribute we have) to become deletable. This behavior is consistent with the specification and with Chrome. I added test coverage for this.
  • [ImplementationNamespace]: Implemented but unused.
  • [PassContext]: Not implemented and unused.
  • [TypedArray=*]: Not implemented and unused.

[1] https://heycam.github.io/webidl/#es-attributes

Test: fast/notifications/notification-permisssion-deletable.html

  • bindings/scripts/CodeGeneratorJS.pm:

(GetNamespaceForInterface):
(GenerateImplementation):

  • bindings/scripts/IDLAttributes.txt:
  • bindings/scripts/test/JS/JSTestInterface.cpp:
  • bindings/scripts/test/JS/JSTestObj.cpp:
  • bindings/scripts/test/JS/JSTestTypedefs.cpp:
  • dom/Node.idl:
  • html/HTMLDocument.idl:

LayoutTests:

Add layout test to check that Notification.permission is now deletable.

  • fast/notifications/notification-permisssion-deletable-expected.txt: Added.
  • fast/notifications/notification-permisssion-deletable.html: Added.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207518 r207519  
     12016-10-18  Chris Dumez  <cdumez@apple.com>
     2
     3        [Web IDL] Drop webkit-specific extended attributes that are no longer useful
     4        https://bugs.webkit.org/show_bug.cgi?id=163643
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Add layout test to check that Notification.permission is now deletable.
     9
     10        * fast/notifications/notification-permisssion-deletable-expected.txt: Added.
     11        * fast/notifications/notification-permisssion-deletable.html: Added.
     12
    1132016-10-18  Mark Lam  <mark.lam@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r207517 r207519  
     12016-10-18  Chris Dumez  <cdumez@apple.com>
     2
     3        [Web IDL] Drop webkit-specific extended attributes that are no longer useful
     4        https://bugs.webkit.org/show_bug.cgi?id=163643
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Drop webkit-specific IDL extended attributes that are no longer useful:
     9        - [CustomReturn]: I believe this used to be for ObjC bindings. It has
     10          no impact in JS bindings.
     11        - [Deletable]: It only had an impact on static attributes and was only
     12          used on HTMLAllCollection.all, which is not static. I updated the
     13          bindings generator to so that static attributes are now configurable
     14          by default (unless marked as [Unforgeable], as per Web IDL [1]. This
     15          causes Notification.permission (This only static attribute we have)
     16          to become deletable. This behavior is consistent with the specification
     17          and with Chrome. I added test coverage for this.
     18        - [ImplementationNamespace]: Implemented but unused.
     19        - [PassContext]: Not implemented and unused.
     20        - [TypedArray=*]: Not implemented and unused.
     21
     22        [1] https://heycam.github.io/webidl/#es-attributes
     23
     24        Test: fast/notifications/notification-permisssion-deletable.html
     25
     26        * bindings/scripts/CodeGeneratorJS.pm:
     27        (GetNamespaceForInterface):
     28        (GenerateImplementation):
     29        * bindings/scripts/IDLAttributes.txt:
     30        * bindings/scripts/test/JS/JSTestInterface.cpp:
     31        * bindings/scripts/test/JS/JSTestObj.cpp:
     32        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
     33        * dom/Node.idl:
     34        * html/HTMLDocument.idl:
     35
    1362016-10-18  Sam Weinig  <sam@webkit.org>
    237
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r207515 r207519  
    23442344{
    23452345    my $interface = shift;
    2346     return $interface->extendedAttributes->{ImplementationNamespace} || "WebCore";
     2346    return "WebCore";
    23472347}
    23482348
     
    25932593
    25942594            my @specials = ();
    2595             push(@specials, "DontDelete") unless $attribute->signature->extendedAttributes->{Deletable};
     2595            push(@specials, "DontDelete") if IsUnforgeable($interface, $attribute);
    25962596            push(@specials, "ReadOnly") if IsReadonly($attribute);
    25972597            push(@specials, "DOMJITAttribute") if $attribute->signature->extendedAttributes->{"DOMJIT"};
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt

    r207515 r207519  
    5050CustomProxyToJSObject
    5151CustomPutFunction
    52 CustomReturn
    5352CustomSetPrototype
    5453CustomSetter
    5554CustomToJSObject
    5655DOMJIT
    57 Deletable
    5856DoNotCheckConstants
    5957DoNotCheckSecurity
     
    7472ImplementedAs=*
    7573ImplementationLacksVTable
    76 ImplementationNamespace=*
    7774ImplementationReturnType=*
    7875ImplicitThis
     
    104101NotEnumerable
    105102OverrideBuiltins
    106 PassContext
    107103PrivateIdentifier
    108104PublicIdentifier
     
    119115SuppressToJSObject
    120116TreatNullAs=EmptyString
    121 TypedArray=*
    122117URL
    123118Unforgeable
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r207279 r207519  
    177177#endif
    178178#if ENABLE(Condition22) || ENABLE(Condition23)
    179     { "implementsStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    180 #else
    181     { 0, 0, NoIntrinsic, { 0, 0 } },
    182 #endif
    183 #if ENABLE(Condition22) || ENABLE(Condition23)
    184     { "implementsStaticAttr", DontDelete, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorImplementsStaticAttr) } },
    185 #else
    186     { 0, 0, NoIntrinsic, { 0, 0 } },
    187 #endif
    188 #if ENABLE(Condition11) || ENABLE(Condition12)
    189     { "supplementalStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    190 #else
    191     { 0, 0, NoIntrinsic, { 0, 0 } },
    192 #endif
    193 #if ENABLE(Condition11) || ENABLE(Condition12)
    194     { "supplementalStaticAttr", DontDelete, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorSupplementalStaticAttr) } },
     179    { "implementsStaticReadOnlyAttr", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     180#else
     181    { 0, 0, NoIntrinsic, { 0, 0 } },
     182#endif
     183#if ENABLE(Condition22) || ENABLE(Condition23)
     184    { "implementsStaticAttr", 0, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorImplementsStaticAttr) } },
     185#else
     186    { 0, 0, NoIntrinsic, { 0, 0 } },
     187#endif
     188#if ENABLE(Condition11) || ENABLE(Condition12)
     189    { "supplementalStaticReadOnlyAttr", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     190#else
     191    { 0, 0, NoIntrinsic, { 0, 0 } },
     192#endif
     193#if ENABLE(Condition11) || ENABLE(Condition12)
     194    { "supplementalStaticAttr", 0, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorSupplementalStaticAttr) } },
    195195#else
    196196    { 0, 0, NoIntrinsic, { 0, 0 } },
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r207516 r207519  
    12771277    { "CONST_JAVASCRIPT", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(15) } },
    12781278    { "readonly", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
    1279     { "staticReadOnlyLongAttr", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticReadOnlyLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    1280     { "staticStringAttr", DontDelete, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConstructorStaticStringAttr) } },
    1281     { "TestSubObj", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     1279    { "staticReadOnlyLongAttr", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticReadOnlyLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     1280    { "staticStringAttr", 0, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConstructorStaticStringAttr) } },
     1281    { "TestSubObj", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    12821282    { "nullableStringStaticMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionNullableStringStaticMethod), (intptr_t) (0) } },
    12831283    { "staticMethodWithCallbackAndOptionalArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg), (intptr_t) (0) } },
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

    r207516 r207519  
    123123static const HashTableValue JSTestTypedefsConstructorTableValues[] =
    124124{
    125     { "TestSubObj", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     125    { "TestSubObj", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    126126};
    127127
  • trunk/Source/WebCore/dom/Node.idl

    r207355 r207519  
    5656    readonly attribute Document? ownerDocument;
    5757
    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);
     58    [CEReactions, Custom, MayThrowLegacyException] Node insertBefore(Node newChild, Node? refChild);
     59    [CEReactions, Custom, MayThrowLegacyException] Node replaceChild(Node newChild, Node oldChild);
     60    [CEReactions, Custom, MayThrowLegacyException] Node removeChild(Node oldChild);
     61    [CEReactions, Custom, MayThrowLegacyException] Node appendChild(Node newChild);
    6262
    6363    boolean hasChildNodes();
  • trunk/Source/WebCore/html/HTMLDocument.idl

    r207355 r207519  
    3131    [Custom] void writeln(optional DOMString text);
    3232
    33     [Custom, Replaceable, Deletable] readonly attribute HTMLAllCollection all;
     33    [Custom, Replaceable] readonly attribute HTMLAllCollection all;
    3434
    3535    void clear();
Note: See TracChangeset for help on using the changeset viewer.