[WebIDL] Switch IDLAttributes.txt over to a more structured format so that more infor...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Apr 2017 00:50:16 +0000 (00:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Apr 2017 00:50:16 +0000 (00:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170843

Patch by Sam Weinig <sam@webkit.org> on 2017-04-16
Reviewed by Chris Dumez.

.:

* Source/cmake/WebKitMacros.cmake:
Update extension of IDLAttributes to .json

Source/WebCore:

- Converts IDLAttributes.txt to IDLAttributes.json, and adds additional
  information for each attribute about what contexts they are valid in
  which is checked by the parser.
- Removes CustomSetPrototype which was unused, and Immutable which did
  nothing.

* DerivedSources.make:
Update extension of IDLAttributes to .json

* WebCore.xcodeproj/project.pbxproj:
Update project file for new file name and add some missing IDL files.

* bindings/scripts/CodeGenerator.pm:
Store the processed IDLAttributes in the code generator, so it can
be used for any additional Parser instantiations.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
Remove support for CustomSetPrototype. Nobody is using it.

* bindings/scripts/IDLAttributes.json: Copied from Source/WebCore/bindings/scripts/IDLAttributes.txt.
* bindings/scripts/IDLAttributes.txt: Removed.
Rename IDLAttributes.txt -> IDLAttributes.json and move the data
into a more structured format. For now each extended attribute can
have the following fields:
    Required:
        'contextsAllowed' -> Non-empty array of strings from the contexts array.

    Optional:
        'values' -> Non-empty array of strings allowed after the equal (=) sign in
           the extended attribute. Like before, an empty string indicates it is
           ok to not have a value and a star (*) indicates any string is allowed.
           Not providing a values property at all indicates that no value is
           allowed.

        'standard' -> An object with information about the standard this attribute
           comes from. Should only be added to attributes that come from standards.

        'unsupported' -> A boolean with value true, indicating this property is not
           yet supported. Should only be used for standard attributes.

        'notes' -> A string with notes explaining something about this attribute.

* bindings/scripts/IDLParser.pm:
Pass and store the processed extended attribute map to the parser, and use it
validate that extended attributes being added to things are appropriate for the
context. Fix FIXME in isExtendedAttributeApplicableToTypes by using the map to
implement the predicate, rather than hard coding the list.

* bindings/scripts/generate-bindings.pl:
(generateEmptyHeaderAndCpp):
(loadIDLAttributes): Deleted.
(checkIDLAttributes): Deleted.
(checkIfIDLAttributesExists): Deleted.
Make specifying an IDL attributes file required. Switch to processing it
as a JSON file, and having the parser validate attributes.

* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestImplements.idl:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSupplemental.idl:
* bindings/scripts/test/TestTypedefs.idl:
- Remove use of Immutable extended attribute in the tests, as it does nothing.
- Remove use of the made up ReadOnly attribute, as the tests now use the IDLAttributes
  file to validate that the attributes are supported, so this would otherwise fail.

* css/WebKitCSSMatrix.idl:
* svg/SVGZoomEvent.idl:
- Remove use of the Immutable extended attribute, as it does nothing.

* page/NavigatorID.idl:
* page/NavigatorLanguage.idl:
- Remove use of the Nondeterministic extended attribute, as it does nothing.

* Modules/mediasource/SourceBufferList.idl:
Remove use of CallWith on the interface. It is illegal, and does nothing.

* animation/KeyframeEffect.idl:
* animation/WebAnimation.idl:
Remove use of [Default=Undefined]. This construct does nothing and now
correctly fails to parse.

Tools:

* DumpRenderTree/DerivedSources.make:
* WebKitTestRunner/DerivedSources.make:
* Scripts/webkitpy/bindings/main.py:
(BindingsTests.generate_from_idl):
Pass IDLAttributes.json, as it is now mandatory to have one.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediasource/SourceBufferList.idl
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/animation/KeyframeEffect.idl
Source/WebCore/animation/WebAnimation.idl
Source/WebCore/bindings/scripts/CodeGenerator.pm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.json [new file with mode: 0644]
Source/WebCore/bindings/scripts/IDLAttributes.txt [deleted file]
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/generate-bindings.pl
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/bindings/scripts/test/TestImplements.idl
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/TestSupplemental.idl
Source/WebCore/bindings/scripts/test/TestTypedefs.idl
Source/WebCore/css/WebKitCSSMatrix.idl
Source/WebCore/page/NavigatorID.idl
Source/WebCore/page/NavigatorLanguage.idl
Source/WebCore/svg/SVGZoomEvent.idl
Source/cmake/WebKitMacros.cmake
Tools/ChangeLog
Tools/DumpRenderTree/DerivedSources.make
Tools/Scripts/webkitpy/bindings/main.py
Tools/WebKitTestRunner/DerivedSources.make

index b736745..8dbb6cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-04-16  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Switch IDLAttributes.txt over to a more structured format so that more information can be added for each attribute
+        https://bugs.webkit.org/show_bug.cgi?id=170843
+
+        Reviewed by Chris Dumez.
+
+        * Source/cmake/WebKitMacros.cmake:
+        Update extension of IDLAttributes to .json
+
 2017-04-13  Don Olmstead  <don.olmstead@am.sony.com>
 
         [WinCairo] Assign WEBKIT_LIBRARIES_DIR to CMAKE_PREFIX_PATH
index e25aa19..e887d44 100644 (file)
@@ -1,3 +1,93 @@
+2017-04-16  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Switch IDLAttributes.txt over to a more structured format so that more information can be added for each attribute
+        https://bugs.webkit.org/show_bug.cgi?id=170843
+
+        Reviewed by Chris Dumez.
+
+        - Converts IDLAttributes.txt to IDLAttributes.json, and adds additional
+          information for each attribute about what contexts they are valid in 
+          which is checked by the parser.
+        - Removes CustomSetPrototype which was unused, and Immutable which did 
+          nothing. 
+
+        * DerivedSources.make:
+        Update extension of IDLAttributes to .json
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Update project file for new file name and add some missing IDL files.
+
+        * bindings/scripts/CodeGenerator.pm:
+        Store the processed IDLAttributes in the code generator, so it can
+        be used for any additional Parser instantiations.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        Remove support for CustomSetPrototype. Nobody is using it.
+
+        * bindings/scripts/IDLAttributes.json: Copied from Source/WebCore/bindings/scripts/IDLAttributes.txt.
+        * bindings/scripts/IDLAttributes.txt: Removed.
+        Rename IDLAttributes.txt -> IDLAttributes.json and move the data
+        into a more structured format. For now each extended attribute can
+        have the following fields:
+            Required:
+                'contextsAllowed' -> Non-empty array of strings from the contexts array.
+
+            Optional:
+                'values' -> Non-empty array of strings allowed after the equal (=) sign in 
+                   the extended attribute. Like before, an empty string indicates it is 
+                   ok to not have a value and a star (*) indicates any string is allowed.
+                   Not providing a values property at all indicates that no value is
+                   allowed.
+
+                'standard' -> An object with information about the standard this attribute
+                   comes from. Should only be added to attributes that come from standards.
+
+                'unsupported' -> A boolean with value true, indicating this property is not
+                   yet supported. Should only be used for standard attributes.
+
+                'notes' -> A string with notes explaining something about this attribute.
+        
+        * bindings/scripts/IDLParser.pm:
+        Pass and store the processed extended attribute map to the parser, and use it
+        validate that extended attributes being added to things are appropriate for the
+        context. Fix FIXME in isExtendedAttributeApplicableToTypes by using the map to 
+        implement the predicate, rather than hard coding the list.
+
+        * bindings/scripts/generate-bindings.pl:
+        (generateEmptyHeaderAndCpp):
+        (loadIDLAttributes): Deleted.
+        (checkIDLAttributes): Deleted.
+        (checkIfIDLAttributesExists): Deleted.
+        Make specifying an IDL attributes file required. Switch to processing it
+        as a JSON file, and having the parser validate attributes.
+
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        * bindings/scripts/test/TestImplements.idl:
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/TestSupplemental.idl:
+        * bindings/scripts/test/TestTypedefs.idl:
+        - Remove use of Immutable extended attribute in the tests, as it does nothing.
+        - Remove use of the made up ReadOnly attribute, as the tests now use the IDLAttributes
+          file to validate that the attributes are supported, so this would otherwise fail.
+
+        * css/WebKitCSSMatrix.idl:
+        * svg/SVGZoomEvent.idl:
+        - Remove use of the Immutable extended attribute, as it does nothing.
+
+        * page/NavigatorID.idl:
+        * page/NavigatorLanguage.idl:
+        - Remove use of the Nondeterministic extended attribute, as it does nothing.
+
+        * Modules/mediasource/SourceBufferList.idl:
+        Remove use of CallWith on the interface. It is illegal, and does nothing.
+
+        * animation/KeyframeEffect.idl:
+        * animation/WebAnimation.idl:
+        Remove use of [Default=Undefined]. This construct does nothing and now
+        correctly fails to parse. 
+
 2017-04-15  Alex Christensen  <achristensen@webkit.org>
 
         Fix Windows build after r215396.
index 2aed5cb..10fa9c7 100644 (file)
@@ -1329,7 +1329,7 @@ WINDOW_CONSTRUCTORS_FILE = ./DOMWindowConstructors.idl
 WORKERGLOBALSCOPE_CONSTRUCTORS_FILE = ./WorkerGlobalScopeConstructors.idl
 DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE = ./DedicatedWorkerGlobalScopeConstructors.idl
 IDL_FILES_TMP = ./idl_files.tmp
-IDL_ATTRIBUTES_FILE = $(WebCore)/bindings/scripts/IDLAttributes.txt
+IDL_ATTRIBUTES_FILE = $(WebCore)/bindings/scripts/IDLAttributes.json
 
 # The following lines get a newline character stored in a variable.
 # See <http://stackoverflow.com/questions/7039811/how-do-i-process-extremely-long-lists-of-files-in-a-make-recipe>.
index f82ab6c..6c2d564 100644 (file)
@@ -31,7 +31,6 @@
 [
     Conditional=MEDIA_SOURCE,
     GenerateIsReachable=Impl,
-    CallWith=ScriptExecutionContext,
 ] interface SourceBufferList : EventTarget {
     readonly attribute unsigned long length;
     getter SourceBuffer item(unsigned long index);
index b9bc9c0..e37ca09 100644 (file)
                7CE683471921821500F4D928 /* UserMessageHandlerDescriptorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE683461921821500F4D928 /* UserMessageHandlerDescriptorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7CE6CBFB187F370700D46BF5 /* FormatConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE6CBFA187F370700D46BF5 /* FormatConverter.h */; };
                7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE6CBFC187F394900D46BF5 /* FormatConverter.cpp */; };
+               7CE9A12B1EA2F1DB00651AD1 /* IDLAttributes.json in Headers */ = {isa = PBXBuildFile; fileRef = A83B533814F399BB00720D9D /* IDLAttributes.json */; settings = {ATTRIBUTES = (Private, ); }; };
                7CEF26191D6A931700BE905D /* JSCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CEF26181D6A92E300BE905D /* JSCryptoCustom.cpp */; };
                7CF930E71E01F9B400BAFFBE /* PaymentHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CF930E61E01F9AD00BAFFBE /* PaymentHeaders.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7CFDC57C1AC1D80500E24A57 /* ContentExtensionError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFDC57A1AC1D80500E24A57 /* ContentExtensionError.cpp */; };
                381E35F61E8E4D0E0043E850 /* GPUSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUSize.h; sourceTree = "<group>"; };
                387AE9581E8E92EF0000DE96 /* JSWebGPUSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUSize.cpp; sourceTree = "<group>"; };
                387AE9591E8E92EF0000DE96 /* JSWebGPUSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGPUSize.h; sourceTree = "<group>"; };
-               38850C521E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebGPUCommandBufferCustom.cpp; path = bindings/js/JSWebGPUCommandBufferCustom.cpp; sourceTree = "<group>"; };
+               38850C521E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUCommandBufferCustom.cpp; sourceTree = "<group>"; };
                38F23AAE1E8E83C400CE46F5 /* JSWebGPUComputeCommandEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUComputeCommandEncoder.cpp; sourceTree = "<group>"; };
                38F23AB01E8E83D000CE46F5 /* JSWebGPUComputeCommandEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGPUComputeCommandEncoder.h; sourceTree = "<group>"; };
                38F23AB11E8E83D000CE46F5 /* JSWebGPUComputePipelineState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUComputePipelineState.cpp; sourceTree = "<group>"; };
                7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorOverlay.h; sourceTree = "<group>"; };
                7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaQueryListListener.cpp; sourceTree = "<group>"; };
                7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSMediaQueryListListener.h; sourceTree = "<group>"; };
+               7C5BEA391E9EE77100CC517B /* NavigatorConcurrentHardware.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorConcurrentHardware.idl; sourceTree = "<group>"; };
+               7C5BEA3A1E9EE77100CC517B /* NavigatorID.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorID.idl; sourceTree = "<group>"; };
+               7C5BEA3B1E9EE77100CC517B /* NavigatorLanguage.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorLanguage.idl; sourceTree = "<group>"; };
+               7C5BEA3C1E9EE77100CC517B /* NavigatorOnLine.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorOnLine.idl; sourceTree = "<group>"; };
                7C5F28F91A827D8400C0F31F /* HTMLAttachmentElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLAttachmentElement.cpp; sourceTree = "<group>"; };
                7C5F28FA1A827D8400C0F31F /* HTMLAttachmentElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLAttachmentElement.h; sourceTree = "<group>"; };
                7C60128060078BB70E367A95 /* DNSResolveQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNSResolveQueue.cpp; sourceTree = "<group>"; };
                A833C7F60A2CF1D800D57664 /* xmlattrs.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = xmlattrs.in; sourceTree = "<group>"; };
                A833C80A0A2CF25600D57664 /* XMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNames.cpp; sourceTree = "<group>"; };
                A833C80B0A2CF25600D57664 /* XMLNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLNames.h; sourceTree = "<group>"; };
-               A83B533814F399BB00720D9D /* IDLAttributes.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = IDLAttributes.txt; path = scripts/IDLAttributes.txt; sourceTree = "<group>"; };
+               A83B533814F399BB00720D9D /* IDLAttributes.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = IDLAttributes.json; path = scripts/IDLAttributes.json; sourceTree = "<group>"; };
                A83B538014FBB2EC00720D9D /* preprocess-idls.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = "preprocess-idls.pl"; path = "scripts/preprocess-idls.pl"; sourceTree = "<group>"; };
                A83B78F20CCAFF15000B0825 /* JSSVGFontFaceUriElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGFontFaceUriElement.h; sourceTree = "<group>"; };
                A83B78F30CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGFontFaceUriElement.cpp; sourceTree = "<group>"; };
                0867D691FE84028FC02AAC07 /* WebKit */ = {
                        isa = PBXGroup;
                        children = (
-                               38850C521E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp */,
                                1C09D04B1E31C32800725F18 /* PAL.xcodeproj */,
                                65C97AF208EA908800ACD273 /* config.h */,
                                EDEC98020AED7E170059137F /* WebCorePrefix.h */,
                                A9C6E5A30D746458006442E9 /* Navigator.cpp */,
                                A9C6E5A40D746458006442E9 /* Navigator.h */,
                                A9C6E65D0D746694006442E9 /* Navigator.idl */,
+                               7C5BEA391E9EE77100CC517B /* NavigatorConcurrentHardware.idl */,
+                               7C5BEA3A1E9EE77100CC517B /* NavigatorID.idl */,
+                               7C5BEA3B1E9EE77100CC517B /* NavigatorLanguage.idl */,
+                               7C5BEA3C1E9EE77100CC517B /* NavigatorOnLine.idl */,
                                E12719C90EEEC21300F61213 /* NavigatorBase.cpp */,
                                E12719C60EEEC16800F61213 /* NavigatorBase.h */,
                                00146288103CD1DE000B20DB /* OriginAccessEntry.cpp */,
                                BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */,
                                D3F3D3591A69A3B00059FC2B /* JSWebGL2RenderingContextCustom.cpp */,
                                49EED14C1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp */,
+                               31A088C41E737B2C003B6609 /* JSWebGPURenderingContextCustom.cpp */,
+                               31A088C51E737B2C003B6609 /* JSWebGPURenderPassAttachmentDescriptorCustom.cpp */,
                                83A4A9F81CE7FD7E00709B00 /* JSXMLDocumentCustom.cpp */,
                                836C14421CDEAFCA0073493F /* JSXPathNSResolverCustom.cpp */,
                                A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */,
                                93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
                                93F8B3070A300FEA00F61AB8 /* generate-bindings.pl */,
                                7C6136F61710C35200FF4A57 /* Hasher.pm */,
-                               A83B533814F399BB00720D9D /* IDLAttributes.txt */,
+                               A83B533814F399BB00720D9D /* IDLAttributes.json */,
                                14813BF309EDF88E00F757E1 /* IDLParser.pm */,
                                7C6136F71710C35200FF4A57 /* InFilesCompiler.pm */,
                                7C6136F81710C35200FF4A57 /* InFilesParser.pm */,
                                7C73FB17191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp */,
                                BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */,
                                D3F3D35A1A69A3B00059FC2B /* JSWebGLRenderingContextBaseCustom.cpp */,
-                               31A088C41E737B2C003B6609 /* JSWebGPURenderingContextCustom.cpp */,
-                               31A088C51E737B2C003B6609 /* JSWebGPURenderPassAttachmentDescriptorCustom.cpp */,
+                               38850C521E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp */,
                                E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */,
                                E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */,
                                E18258AB0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp */,
                        isa = PBXHeadersBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               7CE9A12B1EA2F1DB00651AD1 /* IDLAttributes.json in Headers */,
                                F48223131E386E240066FC79 /* AbstractPasteboard.h in Headers */,
                                41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */,
                                29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
index c671967..d873870 100644 (file)
@@ -30,7 +30,7 @@
     Conditional=WEB_ANIMATIONS,
     EnabledAtRuntime=WebAnimations,
     // FIXME: Constructor stub only at the moment (should accept PseudoElement target, frames and options).
-    Constructor([Default=Undefined] Element? target)
+    Constructor(Element? target)
     // FIXME: Add interface for and inherit from KeyframeEffectReadOnly.
 ] interface KeyframeEffect : AnimationEffect {
     // FIXME: Stub only at the moment.
index 048581d..400a367 100644 (file)
@@ -31,7 +31,7 @@
     EnabledAtRuntime=WebAnimations,
     InterfaceName=Animation,
     ImplementationLacksVTable,
-    Constructor([Default=Undefined] AnimationEffect? effect, [Default=Undefined] AnimationTimeline? timeline)
+    Constructor(AnimationEffect? effect, AnimationTimeline? timeline)
 ] interface WebAnimation { // FIXME: Inherit from EventTarget.
     // FIXME: Incomplete interface.
     readonly attribute AnimationEffect? effect;
index 6f77d7d..2130a09 100644 (file)
@@ -39,6 +39,7 @@ my $useOutputDir = "";
 my $useOutputHeadersDir = "";
 my $useDirectories = "";
 my $preprocessor;
+my $idlAttributes;
 my $writeDependencies = 0;
 my $defines = "";
 my $targetIdlFilePath = "";
@@ -144,6 +145,7 @@ sub new
     $writeDependencies = shift;
     $verbose = shift;
     $targetIdlFilePath = shift;
+    $idlAttributes = shift;
 
     bless($reference, $object);
     return $reference;
@@ -355,7 +357,7 @@ sub ParseInterface
 
     # Step #2: Parse the found IDL file (in quiet mode).
     my $parser = IDLParser->new(1);
-    my $document = $parser->Parse($filename, $defines, $preprocessor);
+    my $document = $parser->Parse($filename, $defines, $preprocessor, $idlAttributes);
 
     foreach my $interface (@{$document->interfaces}) {
         if ($interface->type->name eq $interfaceName) {
@@ -466,7 +468,7 @@ sub GetEnumByType
     if ($fileContents =~ /\benum\s+$name/gs) {
         # Parse the IDL.
         my $parser = IDLParser->new(1);
-        my $document = $parser->Parse($filename, $defines, $preprocessor);
+        my $document = $parser->Parse($filename, $defines, $preprocessor, $idlAttributes);
 
         foreach my $enumeration (@{$document->enumerations}) {
             next unless $enumeration->type->name eq $name;
@@ -534,7 +536,7 @@ sub GetDictionaryByType
     if ($fileContents =~ /\bdictionary\s+$name/gs) {
         # Parse the IDL.
         my $parser = IDLParser->new(1);
-        my $document = $parser->Parse($filename, $defines, $preprocessor);
+        my $document = $parser->Parse($filename, $defines, $preprocessor, $idlAttributes);
 
         foreach my $dictionary (@{$document->dictionaries}) {
             next unless $dictionary->type->name eq $name;
index 318e7e5..11c9bd6 100644 (file)
@@ -1923,7 +1923,6 @@ sub GenerateHeader
 
     # Custom getPrototype / setPrototype functions.
     push (@headerContent, "    static JSC::JSValue getPrototype(JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomGetPrototype};
-    push (@headerContent, "    static bool setPrototype(JSC::JSObject*, JSC::ExecState*, JSC::JSValue, bool shouldThrowIfCantSet);\n") if $interface->extendedAttributes->{CustomSetPrototype};
 
     # Custom toStringName function.
     push (@headerContent, "    static String toStringName(const JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomToStringName};
diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.json b/Source/WebCore/bindings/scripts/IDLAttributes.json
new file mode 100644 (file)
index 0000000..1f5e0fe
--- /dev/null
@@ -0,0 +1,432 @@
+{
+    "contexts": [
+        "type",
+        "interface",
+        "attribute",
+        "operation",
+        "argument",
+        "callback-function",
+        "dictionary",
+        "dictionary-member",
+        "enum",
+        "constant",
+        "union-member",
+        "iterable",
+        "map-like",
+        "set-like"
+    ],
+    "attributes": {
+        "ActiveDOMObject": {
+            "contextsAllowed": ["interface"]
+        },
+        "AppleCopyright": {
+            "contextsAllowed": ["interface", "attribute", "operation"]
+        },
+        "AtomicString": {
+            "contextsAllowed": ["type"]
+        },
+        "CEReactions": {
+            "contextsAllowed": ["attribute", "operation"]
+        },
+        "CachedAttribute": {
+            "contextsAllowed": ["attribute"]
+        },
+        "CallbackNeedsOperatorEqual": {
+            "contextsAllowed": ["callback-function"]
+        },
+        "CallWith": {
+            "contextsAllowed": ["attribute", "operation"],
+            "values": ["Document", "ScriptExecutionContext", "ScriptState", "ScriptArguments", "CallStack", "GlobalObject", "ActiveWindow", "FirstWindow", "CallerDocument", "CallerWindow"]
+        },
+        "CheckSecurity": {
+            "contextsAllowed": ["interface"]
+        },
+        "CheckSecurityForNode": {
+            "contextsAllowed": ["attribute", "operation"]
+        },
+        "Clamp": {
+            "contextsAllowed": ["type"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Clamp"
+            }
+        },
+        "Conditional": {
+            "contextsAllowed": ["interface", "dictionary", "dictionary-member", "enum", "attribute", "operation", "constant", "callback-function"],
+            "values": ["*"]
+        },
+        "ConstantsScope": {
+            "contextsAllowed": ["interface"],
+            "values": ["*"]
+        },
+        "Constructor": {
+            "contextsAllowed": ["interface"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Constructor"
+            }
+        },
+        "ConstructorCallWith": {
+            "contextsAllowed": ["interface"],
+            "values": ["Document", "ScriptExecutionContext", "ScriptState"]
+        },
+        "ConstructorMayThrowException": {
+            "contextsAllowed": ["interface"]
+        },
+        "Custom": {
+            "contextsAllowed": ["attribute", "operation"]
+        },
+        "CustomCall": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomConstructor": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomDeleteProperty": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomEnumerateProperty": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomGetOwnPropertySlot": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomGetPrototype": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomGetter": {
+            "contextsAllowed": ["attribute"]
+        },
+        "CustomIndexedSetter": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomIsReachable": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomNamedGetter": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomNamedSetter": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomPreventExtensions": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomProxyToJSObject": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomPutFunction": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomSetter": {
+            "contextsAllowed": ["attribute"]
+        },
+        "CustomToJSObject": {
+            "contextsAllowed": ["interface"]
+        },
+        "CustomToStringName": {
+            "contextsAllowed": ["interface"]
+        },
+        "DOMJIT": {
+            "contextsAllowed": ["attribute", "operation"],
+            "values": ["", "ReadDOM", "Getter"]
+        },
+        "DoNotCheckConstants": {
+            "contextsAllowed": ["interface"]
+        },
+        "DoNotCheckSecurity": {
+            "contextsAllowed": ["attribute", "operation"]
+        },
+        "DoNotCheckSecurityOnGetter": {
+            "contextsAllowed": ["attribute"]
+        },
+        "DoNotCheckSecurityOnSetter": {
+            "contextsAllowed": ["attribute"]
+        },
+        "DocumentEventHandler": {
+            "contextsAllowed": ["attribute"]
+        },
+        "EnabledAtRuntime": {
+            "contextsAllowed": ["interface", "dictionary", "enum", "attribute", "operation", "constant", "iterable"],
+            "values": ["*"]
+        },
+        "EnabledBySetting": {
+            "contextsAllowed": ["interface", "dictionary", "enum", "attribute", "operation", "constant"],
+            "values": ["*"]
+        },
+        "EnabledForWorld": {
+            "contextsAllowed": ["attribute", "operation"],
+            "values": ["*"]
+        },
+        "EnforceRange": {
+            "contextsAllowed": ["type"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#EnforceRange"
+            }
+        },
+        "ExportMacro": {
+            "contextsAllowed": ["interface", "dictionary", "enum"],
+            "values": ["WEBCORE_EXPORT", "WEBCORE_TESTSUPPORT_EXPORT"]
+        },
+        "ExportToWrappedFunction": {
+            "contextsAllowed": ["interface"]
+        },
+        "Exposed": {
+            "contextsAllowed": ["interface", "attribute", "operation", "constant"],
+            "values": ["*"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Exposed"
+            }
+        },
+        "ForwardDeclareInHeader": {
+            "contextsAllowed": ["attribute", "operation"]
+        },
+        "GenerateIsReachable": {
+            "contextsAllowed": ["interface"],
+            "values": ["", "Impl", "ImplWebGLRenderingContext", "ImplDocument", "ImplElementRoot", "ImplFrame", "ImplOwnerNodeRoot", "ImplScriptExecutionContext"]
+        },
+        "GetterMayThrowException": {
+            "contextsAllowed": ["attribute"]
+        },
+        "Global": {
+            "contextsAllowed": ["interface"],
+            "values": ["*"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Global"
+            }
+        },
+        "ImplementedAs": {
+            "contextsAllowed": ["interface", "dictionary", "dictionary-member", "enum", "attribute", "operation"],
+            "values": ["*"]
+        },
+        "ImplementationLacksVTable": {
+            "contextsAllowed": ["interface"]
+        },
+        "ImplicitThis": {
+            "contextsAllowed": ["interface"]
+        },
+        "InterfaceName": {
+            "contextsAllowed": ["interface"],
+            "values": ["*"]
+        },
+        "IsImmutablePrototypeExoticObject": {
+            "contextsAllowed": ["interface"]
+        },
+        "IsImmutablePrototypeExoticObjectOnPrototype": {
+            "contextsAllowed": ["interface"]
+        },
+        "IsWeakCallback": {
+            "contextsAllowed": ["callback-function", "interface"]
+        },
+        "JSBuiltin": {
+            "contextsAllowed": ["interface", "attribute", "operation"]
+        },
+        "JSBuiltinConstructor": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomDefineOwnProperty": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomDefineOwnPropertyOnPrototype": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomFinalize": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomGetOwnPropertySlotAndDescriptor": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomHeader": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomMarkFunction": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomNamedGetterOnPrototype": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomPushEventHandlerScope": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSCustomToNativeObject": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSGenerateToJSObject": {
+            "contextsAllowed": ["interface", "dictionary", "callback-function"]
+        },
+        "JSGenerateToNativeObject": {
+            "contextsAllowed": ["interface"]
+        },
+        "JSLegacyParent": {
+            "contextsAllowed": ["interface"],
+            "values": ["*"]
+        },
+        "LegacyArrayClass": {
+            "contextsAllowed": ["interface"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#LegacyArrayClass"
+            },
+            "unsupported": true
+        },
+        "LegacyUnenumerableNamedProperties": {
+            "contextsAllowed": ["interface"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#LegacyUnenumerableNamedProperties"
+            }
+        },
+        "LenientSetter": {
+            "contextsAllowed": ["attribute"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#LenientSetter"
+            },
+            "unsupported": true
+        },
+        "LenientThis": {
+            "contextsAllowed": ["attribute"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#LenientThis"
+            }
+        },
+        "MasqueradesAsUndefined": {
+            "contextsAllowed": ["interface"]
+        },
+        "MayThrowException": {
+            "contextsAllowed": ["attribute", "operation"]
+        },
+        "NamedConstructor": {
+            "contextsAllowed": ["interface"],
+            "values": ["*"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#NamedConstructor"
+            }
+        },
+        "NewImpurePropertyFiresWatchpoints": {
+            "contextsAllowed": ["interface"]
+        },
+        "NewObject": {
+            "contextsAllowed": ["attribute", "operation"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#NewObject"
+            }
+        },
+        "NoInterfaceObject": {
+            "contextsAllowed": ["interface"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#NoInterfaceObject"
+            }
+        },
+        "NotEnumerable": {
+            "contextsAllowed": ["attribute", "operation"]
+        },
+        "OverrideBuiltins": {
+            "contextsAllowed": ["interface"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#OverrideBuiltins"
+            }
+        },
+        "OverrideIDLType": {
+            "contextsAllowed": ["type"],
+            "values": ["*"]
+        },
+        "PassContext": {
+            "contextsAllowed": ["operation"],
+            "notes" : "Only used by WebKitTestRunner and DumpRenderTree"
+        },
+        "PrimaryGlobal": {
+            "contextsAllowed": ["interface"],
+            "values": ["*"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Global"
+            }
+        },
+        "PrivateIdentifier": {
+            "contextsAllowed": ["interface", "attribute", "operation"]
+        },
+        "PublicIdentifier": {
+            "contextsAllowed": ["interface", "attribute", "operation"]
+        },
+        "PutForwards": {
+            "contextsAllowed": ["attribute"],
+            "values": ["*"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#PutForwards"
+            }
+        },
+        "Reflect": {
+            "contextsAllowed": ["attribute", "constant"],
+            "values": ["*"]
+        },
+        "Replaceable": {
+            "contextsAllowed": ["attribute"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Replaceable"
+            }
+        },
+        "ReportExtraMemoryCost": {
+            "contextsAllowed": ["interface"]
+        },
+        "ReportExternalMemoryCost": {
+            "contextsAllowed": ["interface"]
+        },
+        "RequiresExistingAtomicString": {
+            "contextsAllowed": ["type"]
+        },
+        "SameObject": {
+            "contextsAllowed": ["attribute"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Replaceable"
+            },
+            "unsupported": true
+        },
+        "SecureContext": {
+            "contextsAllowed": ["interface", "dictionary", "enum", "attribute", "operation", "constant"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#SecureContext"
+            },
+            "unsupported": true
+        },
+        "SetterCallWith": {
+            "contextsAllowed": ["attribute"],
+            "values": ["ScriptExecutionContext", "ScriptState", "ScriptArguments", "CallStack", "GlobalObject", "ActiveWindow", "FirstWindow"]
+        },
+        "SetterMayThrowException": {
+            "contextsAllowed": ["attribute"]
+        },
+        "SkipVTableValidation": {
+            "contextsAllowed": ["interface"]
+        },
+        "SuppressToJSObject": {
+            "contextsAllowed": ["interface"]
+        },
+        "TreatNonObjectAsNull": {
+            "contextsAllowed": ["callback-function"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#TreatNonObjectAsNull"
+            },
+            "unsupported": true
+        },
+        "TreatNullAs": {
+            "contextsAllowed": ["type"],
+            "values": ["EmptyString"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#TreatNullAs"
+            }
+        },
+        "URL": {
+            "contextsAllowed": ["attribute"]
+        },
+        "Unforgeable": {
+            "contextsAllowed": ["attribute", "operation", "interface"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Unforgeable"
+            }
+        },
+        "Unscopable": {
+            "contextsAllowed": ["attribute", "operation"],
+            "standard": {
+                "url": "https://heycam.github.io/webidl/#Unscopable"
+            }
+        },
+        "WindowEventHandler": {
+            "contextsAllowed": ["attribute"]
+        }
+    }
+}
diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.txt b/Source/WebCore/bindings/scripts/IDLAttributes.txt
deleted file mode 100644 (file)
index e872d88..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#
-# This file describes all IDL attributes.
-# If any IDL file uses an IDL attribute not listed below, the WebKit build will fail.
-# If you want to add a new IDL attribute, you need to
-#     (1) add the IDL attribute to this file
-#     (2) add the explanation to the WebKit IDL document (https://trac.webkit.org/wiki/WebKitIDL)
-#     (3) add test cases to run-bindings-tests
-#
-# The syntax of this file is as follows:
-#     - You can write one IDL attribute per one line.
-#     - "ATTR" means that the IDL attribute ATTR does not take any argument; i.e. [ATTR].
-#     - "ATTR=X" means that the IDL attribute ATTR always takes one argument X; i.e. [ATTR=X].
-#     - "ATTR=X|Y|Z" means that the IDL attribute ATTR takes one or more arguments
-#       and the arguments are X, Y or Z; e.g. [ATTR=X], [ATTR=Y], [ATTR=X|Z], [ATTR=X|Y|Z].
-#     - "ATTR=|X|Y|Z" means that the IDL attribute ATTR can take arguments
-#       and the arguments are X, Y or Z; e.g. [ATTR], [ATTR=X], [ATTR=Y], [ATTR=X|Z], [ATTR=X|Y|Z].
-#     - "ATTR=*" means that the IDL attribute ATTR can take arbitrary arguments;
-#       e.g. [ATTR=INDEXED_DATABASE], [ATTR=deleteFunction].
-#
-
-ActiveDOMObject
-AppleCopyright
-AtomicString
-CEReactions
-CachedAttribute
-CallbackNeedsOperatorEqual
-CallWith=Document|ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|GlobalObject|ActiveWindow|FirstWindow|CallerDocument|CallerWindow
-CheckSecurity
-CheckSecurityForNode
-Clamp
-Conditional=*
-ConstantsScope=*
-Constructor
-ConstructorCallWith=Document|ScriptExecutionContext|ScriptState
-ConstructorMayThrowException
-Custom
-CustomCall
-CustomConstructor
-CustomDeleteProperty
-CustomEnumerateProperty
-CustomGetOwnPropertySlot
-CustomGetPrototype
-CustomGetter
-CustomIndexedSetter
-CustomIsReachable
-CustomNamedGetter
-CustomNamedSetter
-CustomPreventExtensions
-CustomProxyToJSObject
-CustomPutFunction
-CustomSetPrototype
-CustomSetter
-CustomToJSObject
-CustomToStringName
-DOMJIT=|ReadDOM|Getter
-DoNotCheckConstants
-DoNotCheckSecurity
-DoNotCheckSecurityOnGetter
-DoNotCheckSecurityOnSetter
-DocumentEventHandler
-EnabledAtRuntime=*
-EnabledBySetting=*
-EnabledForWorld=*
-EnforceRange
-ExportMacro=WEBCORE_EXPORT|WEBCORE_TESTSUPPORT_EXPORT
-ExportToWrappedFunction
-Exposed=*
-ForwardDeclareInHeader
-GenerateIsReachable=|Impl|ImplWebGLRenderingContext|ImplDocument|ImplElementRoot|ImplFrame|ImplOwnerNodeRoot|ImplScriptExecutionContext
-GetterMayThrowException
-Global=*
-Immutable
-ImplementedAs=*
-ImplementationLacksVTable
-ImplicitThis
-InterfaceName=*
-IsImmutablePrototypeExoticObject
-IsImmutablePrototypeExoticObjectOnPrototype
-IsWeakCallback
-JSBuiltin
-JSBuiltinConstructor
-JSCustomDefineOwnProperty
-JSCustomDefineOwnPropertyOnPrototype
-JSCustomFinalize
-JSCustomGetOwnPropertySlotAndDescriptor
-JSCustomHeader
-JSCustomMarkFunction
-JSCustomNamedGetterOnPrototype
-JSCustomPushEventHandlerScope
-JSCustomToNativeObject
-JSGenerateToJSObject
-JSGenerateToNativeObject
-JSLegacyParent=*
-LegacyUnenumerableNamedProperties
-LenientThis
-MasqueradesAsUndefined
-MayThrowException
-NamedConstructor=*
-NewImpurePropertyFiresWatchpoints
-NewObject
-NoInterfaceObject
-NotEnumerable
-OverrideBuiltins
-OverrideIDLType=*
-PassContext
-PrimaryGlobal
-PrivateIdentifier
-PublicIdentifier
-PutForwards=*
-Reflect=*
-Replaceable
-ReportExtraMemoryCost
-ReportExternalMemoryCost
-RequiresExistingAtomicString
-SetterCallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|GlobalObject|ActiveWindow|FirstWindow
-SetterMayThrowException
-SkipVTableValidation
-SuppressToJSObject
-TreatNullAs=EmptyString
-URL
-Unforgeable
-Unscopable
-WindowEventHandler
index fd959d7..fa542bb 100644 (file)
@@ -202,7 +202,8 @@ sub new {
         NextToken => $emptyToken,
         Token => $emptyToken,
         Line => "",
-        LineNumber => 1
+        LineNumber => 1,
+        ExtendedAttributeMap => ""
     };
     return bless $self, $class;
 }
@@ -253,18 +254,65 @@ sub assertUnexpectedToken
     assert $msg;
 }
 
+sub assertExtendedAttributesValidForContext
+{
+    my $self = shift;
+    my $extendedAttributeList = shift;
+    my @contexts = @_;
+
+    for my $extendedAttribute (keys %{$extendedAttributeList}) {
+        # FIXME: Should this be done here, or when parsing the exteded attribute itself?
+        # Either way, we should add validation of the values, if any, at the same place.
+
+        # Extended attribute parsing collapses multiple 'Constructor' or 'CustomConstructor'
+        # attributes into a single plural version. Eventually, it would be nice if that conversion
+        # hapened later, and the parser kept things relatively simply, but for now, we just undo
+        # this transformation for the type check.
+        if ($extendedAttribute eq "Constructors") {
+            $extendedAttribute = "Constructor";
+        } elsif ($extendedAttribute eq "CustomConstructors") {
+            $extendedAttribute = "CustomConstructor";
+        }
+
+        if (!exists $self->{ExtendedAttributeMap}->{$extendedAttribute}) {
+            assert "Unknown extended attribute: '${extendedAttribute}'";
+        }
+
+        my $foundAllowedContext = 0;
+        for my $contextAllowed (@{$self->{ExtendedAttributeMap}->{$extendedAttribute}->{"contextsAllowed"}}) {
+            for my $context (@contexts) {
+                if ($contextAllowed eq $context) {
+                    $foundAllowedContext = 1;
+                    last;
+                }
+            }
+        }
+
+        if (!$foundAllowedContext) {
+            if (scalar(@contexts) == 1) {
+                assert "Extended attribute '${extendedAttribute}' used in invalid context '" . $contexts[0] . "'";
+            } else {
+                # FIXME: Improved this error message a bit.
+                assert "Extended attribute '${extendedAttribute}' used in invalid context";
+            }
+        }
+    }
+}
+
 sub Parse
 {
     my $self = shift;
     my $fileName = shift;
     my $defines = shift;
     my $preprocessor = shift;
+    my $idlAttributes = shift;
 
     my @definitions = ();
 
     my @lines = applyPreprocessor($fileName, $defines, $preprocessor);
     $self->{Line} = $lines[0];
     $self->{DocumentContent} = join(' ', @lines);
+    $self->{ExtendedAttributeMap} = $idlAttributes;
 
     $self->getToken();
     eval {
@@ -411,37 +459,35 @@ sub copyExtendedAttributes
     }
 }
 
-
 sub isExtendedAttributeApplicableToTypes
 {
+    my $self = shift;
     my $extendedAttribute = shift;
 
-    # FIXME: This should be derived from IDLAttributes.in
-    my %types = (
-        "Clamp" => 1,
-        "EnforceRange" => 1,
-        "TreatNullAs" => 1,
+    if (!exists $self->{ExtendedAttributeMap}->{$extendedAttribute}) {
+        assert "Unknown extended attribute: '${extendedAttribute}'";
+    }
 
-        # Non-standard additions
-        "AtomicString" => 1,
-        "RequiresExistingAtomicString" => 1,
-        "OverrideIDLType" => 1,
-    );
+    for my $contextAllowed (@{$self->{ExtendedAttributeMap}->{$extendedAttribute}->{"contextsAllowed"}}) {
+        if ($contextAllowed eq "type") {
+            return 1;
+        }
+    }
 
-    return $types{$extendedAttribute};
+    return 0;
 }
 
 sub moveExtendedAttributesApplicableToTypes
 {
+    my $self = shift;
     my $type = shift;
     my $extendedAttributeList = shift;
 
     for my $key (keys %{$extendedAttributeList}) {
-        if (isExtendedAttributeApplicableToTypes($key)) {
+        if ($self->isExtendedAttributeApplicableToTypes($key)) {
             if (!defined $type->extendedAttributes->{$key}) {
                 $type->extendedAttributes->{$key} = $extendedAttributeList->{$key};
             }
-            
             delete $extendedAttributeList->{$key};
         }
     }
@@ -601,7 +647,7 @@ sub typeByApplyingTypedefs
 
         my $clonedType = $self->cloneType($typedef->type);
         $clonedType->isNullable($clonedType->isNullable || $type->isNullable);
-        moveExtendedAttributesApplicableToTypes($clonedType, $type->extendedAttributes);
+        $self->moveExtendedAttributesApplicableToTypes($clonedType, $type->extendedAttributes);
 
         return $self->typeByApplyingTypedefs($clonedType);
     }
@@ -698,7 +744,10 @@ sub parseInterface
         $self->assertTokenValue($self->getToken(), "}", __LINE__);
         $self->assertTokenValue($self->getToken(), ";", __LINE__);
         applyMemberList($interface, $interfaceMembers);
+
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "interface");
         applyExtendedAttributeList($interface, $extendedAttributeList);
+
         return $interface;
     }
     $self->assertUnexpectedToken($next->value(), __LINE__);
@@ -796,9 +845,12 @@ sub parseDictionary
 
     my $next = $self->nextToken();
     if ($next->value() eq "dictionary") {
+        $self->assertTokenValue($self->getToken(), "dictionary", __LINE__);
+
         my $dictionary = IDLDictionary->new();
+
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "dictionary");
         $dictionary->extendedAttributes($extendedAttributeList);
-        $self->assertTokenValue($self->getToken(), "dictionary", __LINE__);
 
         my $nameToken = $self->getToken();
         $self->assertTokenType($nameToken, IdentifierToken);
@@ -848,7 +900,6 @@ sub parseDictionaryMember
     my $next = $self->nextToken();
     if ($next->type() == IdentifierToken || $next->value() =~ /$nextExceptionField_1/) {
         my $member = IDLDictionaryMember->new();
-        $member->extendedAttributes($extendedAttributeList);
 
         if ($next->value eq "required") {
             $self->assertTokenValue($self->getToken(), "required", __LINE__);
@@ -860,11 +911,14 @@ sub parseDictionaryMember
             $member->isRequired(0);
 
             my $type = $self->parseType();
-            moveExtendedAttributesApplicableToTypes($type, $extendedAttributeList);
+            $self->moveExtendedAttributesApplicableToTypes($type, $extendedAttributeList);
             
             $member->type($type);
         }
 
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "dictionary-member");
+        $member->extendedAttributes($extendedAttributeList);
+
         my $nameToken = $self->getToken();
         $self->assertTokenType($nameToken, IdentifierToken);
         $member->name($nameToken->value);
@@ -947,7 +1001,10 @@ sub parseException
         $self->assertTokenValue($self->getToken(), "}", __LINE__);
         $self->assertTokenValue($self->getToken(), ";", __LINE__);
         applyMemberList($interface, $exceptionMembers);
+        
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "interface");
         applyExtendedAttributeList($interface, $extendedAttributeList);
+
         return $interface;
     }
     $self->assertUnexpectedToken($next->value(), __LINE__);
@@ -1004,6 +1061,8 @@ sub parseEnum
         push(@{$enum->values}, @{$self->parseEnumValueList()});
         $self->assertTokenValue($self->getToken(), "}", __LINE__);
         $self->assertTokenValue($self->getToken(), ";", __LINE__);
+        
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "enum");
         $enum->extendedAttributes($extendedAttributeList);
         return $enum;
     }
@@ -1062,6 +1121,8 @@ sub parseCallbackRest
 
         my $operation = IDLOperation->new();
         $operation->type($self->parseReturnType());
+        
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "callback-function", "operation");
         $operation->extendedAttributes($extendedAttributeList);
 
         $self->assertTokenValue($self->getToken(), "(", __LINE__);
@@ -1137,7 +1198,10 @@ sub parseConst
         $self->assertTokenValue($self->getToken(), "=", __LINE__);
         $newDataNode->value($self->parseConstValue());
         $self->assertTokenValue($self->getToken(), ";", __LINE__);
+
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "constant");
         $newDataNode->extendedAttributes($extendedAttributeList);
+
         return $newDataNode;
     }
     $self->assertUnexpectedToken($next->value(), __LINE__);
@@ -1251,6 +1315,8 @@ sub parseSerializer
 
         my $toJSONFunction = IDLOperation->new();
         $toJSONFunction->name("toJSON");
+
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "operation");
         $toJSONFunction->extendedAttributes($extendedAttributeList);
         $toJSONFunction->isSerializer(1);
         push(@{$newDataNode->functions}, $toJSONFunction);
@@ -1405,7 +1471,7 @@ sub parseAttributeOrOperationRest
 
         # NOTE: This is a non-standard addition. In WebIDL, there is no way to associate
         # extended attributes with a return type.
-        moveExtendedAttributesApplicableToTypes($returnType, $extendedAttributeList);
+        $self->moveExtendedAttributesApplicableToTypes($returnType, $extendedAttributeList);
 
         my $operation = $self->parseOperationRest($extendedAttributeList);
         if (defined ($operation)) {
@@ -1442,6 +1508,7 @@ sub parseAttributeRest
 
         my $attribute = IDLAttribute->new();
         
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "attribute");
         $attribute->extendedAttributes($extendedAttributeList);
         $attribute->isReadOnly($isReadOnly);
 
@@ -1500,7 +1567,7 @@ sub parseOperationOrIterator
         my $returnType = $self->parseReturnType();
         # NOTE: This is a non-standard addition. In WebIDL, there is no way to associate
         # extended attributes with a return type.
-        moveExtendedAttributesApplicableToTypes($returnType, $extendedAttributeList);
+        $self->moveExtendedAttributesApplicableToTypes($returnType, $extendedAttributeList);
 
         my $next = $self->nextToken();
         if ($next->type() == IdentifierToken || $next->value() eq "(") {
@@ -1525,7 +1592,7 @@ sub parseSpecialOperation
 
         # NOTE: This is a non-standard addition. In WebIDL, there is no way to associate
         # extended attributes with a return type.
-        moveExtendedAttributesApplicableToTypes($returnType, $extendedAttributeList);
+        $self->moveExtendedAttributesApplicableToTypes($returnType, $extendedAttributeList);
 
         my $operation = $self->parseOperationRest($extendedAttributeList);
         if (defined ($operation)) {
@@ -1601,6 +1668,8 @@ sub parseOptionalIterableInterface
     my $extendedAttributeList = shift;
 
     my $newDataNode = IDLIterable->new();
+
+    $self->assertExtendedAttributesValidForContext($extendedAttributeList, "iterable");
     $newDataNode->extendedAttributes($extendedAttributeList);
 
     $self->assertTokenValue($self->getToken(), "<", __LINE__);
@@ -1815,6 +1884,7 @@ sub parseOperationRest
         $self->assertTokenValue($self->getToken(), ")", __LINE__);
         $self->assertTokenValue($self->getToken(), ";", __LINE__);
 
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "operation");
         $newDataNode->extendedAttributes($extendedAttributeList);
         return $newDataNode;
     }
@@ -1880,7 +1950,6 @@ sub parseOptionalOrRequiredArgument
     my $extendedAttributeList = shift;
 
     my $argument = IDLArgument->new();
-    $argument->extendedAttributes($extendedAttributeList);
 
     my $next = $self->nextToken();
     if ($next->value() eq "optional") {
@@ -1891,16 +1960,24 @@ sub parseOptionalOrRequiredArgument
         $argument->isOptional(1);
         $argument->name($self->parseArgumentName());
         $argument->default($self->parseDefault());
+
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "argument");
+        $argument->extendedAttributes($extendedAttributeList);
+
         return $argument;
     }
     if ($next->type() == IdentifierToken || $next->value() =~ /$nextExceptionField_1/) {
         my $type = $self->parseType();
-        moveExtendedAttributesApplicableToTypes($type, $extendedAttributeList);
+        $self->moveExtendedAttributesApplicableToTypes($type, $extendedAttributeList);
 
         $argument->type($type);
         $argument->isOptional(0);
         $argument->isVariadic($self->parseEllipsis());
         $argument->name($self->parseArgumentName());
+
+        $self->assertExtendedAttributesValidForContext($extendedAttributeList, "argument");
+        $argument->extendedAttributes($extendedAttributeList);
+
         return $argument;
     }
     $self->assertUnexpectedToken($next->value(), __LINE__);
@@ -2210,6 +2287,7 @@ sub parseTypeWithExtendedAttributes
     my $self = shift;
     
     my $extendedAttributeList = $self->parseExtendedAttributeListAllowEmpty();
+    $self->assertExtendedAttributesValidForContext($extendedAttributeList, "type");
 
     my $next = $self->nextToken();
     if ($next->value() eq "(") {
@@ -2271,6 +2349,7 @@ sub parseUnionMemberType
 {
     my $self = shift;
     my $next = $self->nextToken();
+
     if ($next->value() eq "(") {
         my $unionType = $self->parseUnionType();
         $unionType->isNullable($self->parseNull());
@@ -2278,6 +2357,7 @@ sub parseUnionMemberType
     }
 
     my $extendedAttributeList = $self->parseExtendedAttributeListAllowEmpty();
+    $self->assertExtendedAttributesValidForContext($extendedAttributeList, "type");
 
     if ($next->type() == IdentifierToken || $next->value() =~ /$nextSingleType_1/) {
         my $nonAnyType = $self->parseNonAnyType();
@@ -2710,6 +2790,7 @@ sub applyExtendedAttributeList
         delete $extendedAttributeList->{"CustomConstructors"};
         $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING";
     }
+    
     $interface->extendedAttributes($extendedAttributeList);
 }
 
index 1048a51..204c952 100755 (executable)
@@ -32,11 +32,13 @@ use strict;
 use FindBin;
 use lib '.', $FindBin::Bin;
 
+use English;
 use File::Path;
 use File::Basename;
 use Getopt::Long;
 use Text::ParseWords;
 use Cwd;
+use JSON::PP;
 
 use IDLParser;
 use CodeGenerator;
@@ -74,6 +76,7 @@ my $targetIdlFile = $ARGV[0];
 die('Must specify input file.') unless defined($targetIdlFile);
 die('Must specify generator') unless defined($generator);
 die('Must specify output directory.') unless defined($outputDirectory);
+die('Must specify IDL attributes file.') unless defined($idlAttributesFile);
 
 if (!$outputHeadersDirectory) {
     $outputHeadersDirectory = $outputDirectory;
@@ -124,21 +127,28 @@ if ($supplementalDependencyFile) {
     }
 }
 
+my $input;
+{
+    local $INPUT_RECORD_SEPARATOR;
+    open(JSON, "<", $idlAttributesFile) or die "Couldn't open $idlAttributesFile: $!";
+    $input = <JSON>;
+    close(JSON);
+}
+
+my $jsonDecoder = JSON::PP->new->utf8;
+my $jsonHashRef = $jsonDecoder->decode($input);
+my $idlAttributes = $jsonHashRef->{attributes};
+
 # Parse the target IDL file.
 my $targetParser = IDLParser->new(!$verbose);
-my $targetDocument = $targetParser->Parse($targetIdlFile, $defines, $preprocessor);
-
-if ($idlAttributesFile) {
-    my $idlAttributes = loadIDLAttributes($idlAttributesFile);
-    checkIDLAttributes($idlAttributes, $targetDocument, fileparse($targetIdlFile));
-}
+my $targetDocument = $targetParser->Parse($targetIdlFile, $defines, $preprocessor, $idlAttributes);
 
 foreach my $idlFile (@supplementedIdlFiles) {
     next if $idlFile eq $targetIdlFile;
 
     my $interfaceName = fileparse($idlFile, ".idl");
     my $parser = IDLParser->new(!$verbose);
-    my $document = $parser->Parse($idlFile, $defines, $preprocessor);
+    my $document = $parser->Parse($idlFile, $defines, $preprocessor, $idlAttributes);
 
     foreach my $interface (@{$document->interfaces}) {
         if (!$interface->isPartial || $interface->type->name eq $targetInterfaceName) {
@@ -203,7 +213,7 @@ foreach my $idlFile (@supplementedIdlFiles) {
 }
 
 # Generate desired output for the target IDL file.
-my $codeGen = CodeGenerator->new(\@idlDirectories, $generator, $outputDirectory, $outputHeadersDirectory, $preprocessor, $writeDependencies, $verbose, $targetIdlFile);
+my $codeGen = CodeGenerator->new(\@idlDirectories, $generator, $outputDirectory, $outputHeadersDirectory, $preprocessor, $writeDependencies, $verbose, $targetIdlFile, $idlAttributes);
 $codeGen->ProcessDocument($targetDocument, $defines);
 
 # Attributes / Operations / Constants of supplemental interfaces can have an [Exposed=XX] attribute which restricts
@@ -246,86 +256,3 @@ sub generateEmptyHeaderAndCpp
     print FH $contents;
     close FH;
 }
-
-sub loadIDLAttributes
-{
-    my $idlAttributesFile = shift;
-
-    my %idlAttributes;
-    open FH, "<", $idlAttributesFile or die "Couldn't open $idlAttributesFile: $!";
-    while (my $line = <FH>) {
-        chomp $line;
-        next if $line =~ /^\s*#/;
-        next if $line =~ /^\s*$/;
-
-        if ($line =~ /^\s*([^=\s]*)\s*=?\s*(.*)/) {
-            my $name = $1;
-            $idlAttributes{$name} = {};
-            if ($2) {
-                foreach my $rightValue (split /\|/, $2) {
-                    $rightValue =~ s/^\s*|\s*$//g;
-                    $rightValue = "VALUE_IS_MISSING" unless $rightValue;
-                    $idlAttributes{$name}{$rightValue} = 1;
-                }
-            } else {
-                $idlAttributes{$name}{"VALUE_IS_MISSING"} = 1;
-            }
-        } else {
-            die "The format of " . fileparse($idlAttributesFile) . " is wrong: line $.\n";
-        }
-    }
-    close FH;
-
-    return \%idlAttributes;
-}
-
-sub checkIDLAttributes
-{
-    my $idlAttributes = shift;
-    my $document = shift;
-    my $idlFile = shift;
-
-    foreach my $interface (@{$document->interfaces}) {
-        checkIfIDLAttributesExists($idlAttributes, $interface->extendedAttributes, $idlFile);
-
-        foreach my $attribute (@{$interface->attributes}) {
-            checkIfIDLAttributesExists($idlAttributes, $attribute->extendedAttributes, $idlFile);
-        }
-
-        foreach my $function (@{$interface->functions}) {
-            checkIfIDLAttributesExists($idlAttributes, $function->extendedAttributes, $idlFile);
-            foreach my $argument (@{$function->arguments}) {
-                checkIfIDLAttributesExists($idlAttributes, $argument->extendedAttributes, $idlFile);
-            }
-        }
-    }
-}
-
-sub checkIfIDLAttributesExists
-{
-    my $idlAttributes = shift;
-    my $extendedAttributes = shift;
-    my $idlFile = shift;
-
-    my $error;
-    OUTER: for my $name (keys %$extendedAttributes) {
-        if (!exists $idlAttributes->{$name}) {
-            $error = "Unknown IDL attribute [$name] is found at $idlFile.";
-            last OUTER;
-        }
-        if ($idlAttributes->{$name}{"*"}) {
-            next;
-        }
-        for my $rightValue (split /\s*[|&]\s*/, $extendedAttributes->{$name}) {
-            if (!exists $idlAttributes->{$name}{$rightValue}) {
-                $error = "Unknown IDL attribute [$name=" . $extendedAttributes->{$name} . "] is found at $idlFile.";
-                last OUTER;
-            }
-        }
-    }
-    if ($error) {
-        die "IDL ATTRIBUTE CHECKER ERROR: $error
-If you want to add a new IDL attribute, you need to add it to WebCore/bindings/scripts/IDLAttributes.txt and add explanations to the WebKit IDL document (https://trac.webkit.org/wiki/WebKitIDL).
-";
-    }
-}
index 3e11f35..0ff026f 100644 (file)
@@ -1218,7 +1218,6 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(JSC::ExecSt
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicStringMethod(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicDoubleMethod(JSC::ExecState*);
@@ -1404,8 +1403,6 @@ bool setJSTestObjObjectAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::Enco
 JSC::EncodedJSValue jsTestObjContentDocument(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 JSC::EncodedJSValue jsTestObjMutablePoint(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestObjMutablePoint(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
-JSC::EncodedJSValue jsTestObjImmutablePoint(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestObjImmutablePoint(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestObjStrawberry(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestObjStrawberry(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestObjDescription(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
@@ -1706,7 +1703,6 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
     { "objectAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjObjectAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjObjectAttribute) } },
     { "contentDocument", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     { "mutablePoint", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjMutablePoint), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjMutablePoint) } },
-    { "immutablePoint", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjImmutablePoint), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjImmutablePoint) } },
     { "strawberry", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrawberry), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStrawberry) } },
     { "description", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     { "id", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjId) } },
@@ -1864,7 +1860,6 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
     { "convert3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert3), (intptr_t) (1) } },
     { "convert4", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t) (1) } },
     { "mutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t) (0) } },
-    { "immutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t) (0) } },
     { "orange", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOrange), (intptr_t) (0) } },
     { "variadicStringMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicStringMethod), (intptr_t) (1) } },
     { "variadicDoubleMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t) (1) } },
@@ -3278,22 +3273,6 @@ static inline JSValue jsTestObjMutablePointGetter(ExecState& state, JSTestObj& t
     return result;
 }
 
-static inline JSValue jsTestObjImmutablePointGetter(ExecState&, JSTestObj&, ThrowScope& throwScope);
-
-EncodedJSValue jsTestObjImmutablePoint(ExecState* state, EncodedJSValue thisValue, PropertyName)
-{
-    return BindingCaller<JSTestObj>::attribute<jsTestObjImmutablePointGetter>(state, thisValue, "immutablePoint");
-}
-
-static inline JSValue jsTestObjImmutablePointGetter(ExecState& state, JSTestObj& thisObject, ThrowScope& throwScope)
-{
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(state);
-    auto& impl = thisObject.wrapped();
-    JSValue result = toJS<IDLInterface<SVGPoint>>(state, *thisObject.globalObject(), impl.immutablePoint());
-    return result;
-}
-
 static inline JSValue jsTestObjStrawberryGetter(ExecState&, JSTestObj&, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjStrawberry(ExecState* state, EncodedJSValue thisValue, PropertyName)
@@ -4920,25 +4899,6 @@ static inline bool setJSTestObjMutablePointFunction(ExecState& state, JSTestObj&
 }
 
 
-static inline bool setJSTestObjImmutablePointFunction(ExecState&, JSTestObj&, JSValue, ThrowScope&);
-
-bool setJSTestObjImmutablePoint(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
-{
-    return BindingCaller<JSTestObj>::setAttribute<setJSTestObjImmutablePointFunction>(state, thisValue, encodedValue, "immutablePoint");
-}
-
-static inline bool setJSTestObjImmutablePointFunction(ExecState& state, JSTestObj& thisObject, JSValue value, ThrowScope& throwScope)
-{
-    UNUSED_PARAM(state);
-    UNUSED_PARAM(throwScope);
-    auto& impl = thisObject.wrapped();
-    auto nativeValue = convert<IDLInterface<SVGPoint>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "immutablePoint", "SVGPoint"); });
-    RETURN_IF_EXCEPTION(throwScope, false);
-    impl.setImmutablePoint(*nativeValue);
-    return true;
-}
-
-
 static inline bool setJSTestObjStrawberryFunction(ExecState&, JSTestObj&, JSValue, ThrowScope&);
 
 bool setJSTestObjStrawberry(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
@@ -8077,21 +8037,6 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMutablePointFunction
     return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), impl.mutablePointFunction()));
 }
 
-static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionImmutablePointFunctionCaller(JSC::ExecState*, JSTestObj*, JSC::ThrowScope&);
-
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(ExecState* state)
-{
-    return BindingCaller<JSTestObj>::callOperation<jsTestObjPrototypeFunctionImmutablePointFunctionCaller>(state, "immutablePointFunction");
-}
-
-static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionImmutablePointFunctionCaller(JSC::ExecState* state, JSTestObj* castedThis, JSC::ThrowScope& throwScope)
-{
-    UNUSED_PARAM(state);
-    UNUSED_PARAM(throwScope);
-    auto& impl = castedThis->wrapped();
-    return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), impl.immutablePointFunction()));
-}
-
 static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionOrangeCaller(JSC::ExecState*, JSTestObj*, JSC::ThrowScope&);
 
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(ExecState* state)
index eb8d414..5d82a4c 100644 (file)
@@ -55,7 +55,7 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenc
 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionUnionArg(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClamp(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionImmutablePointFunction(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionPointFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringSequenceFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringSequenceFunction2(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude(JSC::ExecState*);
@@ -65,8 +65,8 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithExcep
 
 JSC::EncodedJSValue jsTestTypedefsUnsignedLongLongAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestTypedefsUnsignedLongLongAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
-JSC::EncodedJSValue jsTestTypedefsImmutableSerializedScriptValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
-bool setJSTestTypedefsImmutableSerializedScriptValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestTypedefsSerializedScriptValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestTypedefsSerializedScriptValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestTypedefsConstructorTestSubObj(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 JSC::EncodedJSValue jsTestTypedefsAttributeWithClamp(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestTypedefsAttributeWithClamp(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
@@ -172,7 +172,7 @@ static const HashTableValue JSTestTypedefsPrototypeTableValues[] =
 {
     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsConstructor) } },
     { "unsignedLongLongAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsUnsignedLongLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsUnsignedLongLongAttr) } },
-    { "immutableSerializedScriptValue", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsImmutableSerializedScriptValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsImmutableSerializedScriptValue) } },
+    { "serializedScriptValue", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsSerializedScriptValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsSerializedScriptValue) } },
     { "attributeWithClamp", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsAttributeWithClamp), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsAttributeWithClamp) } },
     { "attributeWithClampInTypedef", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsAttributeWithClampInTypedef), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsAttributeWithClampInTypedef) } },
     { "attrWithGetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsAttrWithGetterException) } },
@@ -189,7 +189,7 @@ static const HashTableValue JSTestTypedefsPrototypeTableValues[] =
     { "unionArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionUnionArg), (intptr_t) (1) } },
     { "funcWithClamp", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionFuncWithClamp), (intptr_t) (1) } },
     { "funcWithClampInTypedef", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef), (intptr_t) (1) } },
-    { "immutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionImmutablePointFunction), (intptr_t) (0) } },
+    { "pointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionPointFunction), (intptr_t) (0) } },
     { "stringSequenceFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionStringSequenceFunction), (intptr_t) (1) } },
     { "stringSequenceFunction2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionStringSequenceFunction2), (intptr_t) (1) } },
     { "callWithSequenceThatRequiresInclude", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude), (intptr_t) (1) } },
@@ -260,19 +260,19 @@ static inline JSValue jsTestTypedefsUnsignedLongLongAttrGetter(ExecState& state,
     return result;
 }
 
-static inline JSValue jsTestTypedefsImmutableSerializedScriptValueGetter(ExecState&, JSTestTypedefs&, ThrowScope& throwScope);
+static inline JSValue jsTestTypedefsSerializedScriptValueGetter(ExecState&, JSTestTypedefs&, ThrowScope& throwScope);
 
-EncodedJSValue jsTestTypedefsImmutableSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue jsTestTypedefsSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsImmutableSerializedScriptValueGetter>(state, thisValue, "immutableSerializedScriptValue");
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsSerializedScriptValueGetter>(state, thisValue, "serializedScriptValue");
 }
 
-static inline JSValue jsTestTypedefsImmutableSerializedScriptValueGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
+static inline JSValue jsTestTypedefsSerializedScriptValueGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
 {
     UNUSED_PARAM(throwScope);
     UNUSED_PARAM(state);
     auto& impl = thisObject.wrapped();
-    JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), impl.immutableSerializedScriptValue());
+    JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), impl.serializedScriptValue());
     return result;
 }
 
@@ -429,21 +429,21 @@ static inline bool setJSTestTypedefsUnsignedLongLongAttrFunction(ExecState& stat
 }
 
 
-static inline bool setJSTestTypedefsImmutableSerializedScriptValueFunction(ExecState&, JSTestTypedefs&, JSValue, ThrowScope&);
+static inline bool setJSTestTypedefsSerializedScriptValueFunction(ExecState&, JSTestTypedefs&, JSValue, ThrowScope&);
 
-bool setJSTestTypedefsImmutableSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+bool setJSTestTypedefsSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
 {
-    return BindingCaller<JSTestTypedefs>::setAttribute<setJSTestTypedefsImmutableSerializedScriptValueFunction>(state, thisValue, encodedValue, "immutableSerializedScriptValue");
+    return BindingCaller<JSTestTypedefs>::setAttribute<setJSTestTypedefsSerializedScriptValueFunction>(state, thisValue, encodedValue, "serializedScriptValue");
 }
 
-static inline bool setJSTestTypedefsImmutableSerializedScriptValueFunction(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
+static inline bool setJSTestTypedefsSerializedScriptValueFunction(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
 {
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = thisObject.wrapped();
     auto nativeValue = convert<IDLSerializedScriptValue<SerializedScriptValue>>(state, value);
     RETURN_IF_EXCEPTION(throwScope, false);
-    impl.setImmutableSerializedScriptValue(WTFMove(nativeValue));
+    impl.setSerializedScriptValue(WTFMove(nativeValue));
     return true;
 }
 
@@ -774,19 +774,19 @@ static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionFuncWithClampIn
     return JSValue::encode(jsUndefined());
 }
 
-static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionImmutablePointFunctionCaller(JSC::ExecState*, JSTestTypedefs*, JSC::ThrowScope&);
+static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionPointFunctionCaller(JSC::ExecState*, JSTestTypedefs*, JSC::ThrowScope&);
 
-EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionImmutablePointFunction(ExecState* state)
+EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionPointFunction(ExecState* state)
 {
-    return BindingCaller<JSTestTypedefs>::callOperation<jsTestTypedefsPrototypeFunctionImmutablePointFunctionCaller>(state, "immutablePointFunction");
+    return BindingCaller<JSTestTypedefs>::callOperation<jsTestTypedefsPrototypeFunctionPointFunctionCaller>(state, "pointFunction");
 }
 
-static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionImmutablePointFunctionCaller(JSC::ExecState* state, JSTestTypedefs* castedThis, JSC::ThrowScope& throwScope)
+static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionPointFunctionCaller(JSC::ExecState* state, JSTestTypedefs* castedThis, JSC::ThrowScope& throwScope)
 {
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), impl.immutablePointFunction()));
+    return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), impl.pointFunction()));
 }
 
 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionStringSequenceFunctionCaller(JSC::ExecState*, JSTestTypedefs*, JSC::ThrowScope&);
index a85a50b..b2a0abb 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 // This IDL file is for testing the bindings code generator and for tracking
-// changes in its ouput.
+// changes in its output.
 [
     Conditional=Condition22|Condition23,
     NoInterfaceObject
index 723889e..74de74a 100644 (file)
@@ -345,9 +345,7 @@ enum TestConfidence { "high", "kinda-low" };
     void convert4(DOMString? value);
 
     attribute SVGPoint mutablePoint;
-    [Immutable] attribute SVGPoint immutablePoint;
     SVGPoint mutablePointFunction();
-    [Immutable] SVGPoint immutablePointFunction();
 
     [ImplementedAs=banana] void orange();
     [ImplementedAs=blueberry] attribute long strawberry;
index cc94b71..90b9288 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 // This IDL file is for testing the bindings code generator and for tracking
-// changes in its ouput.
+// changes in its output.
 [
     Conditional=Condition11|Condition12,
 ] partial interface TestInterface {
@@ -47,5 +47,5 @@
     [Reflect=CONST_IMPL] const unsigned short SUPPLEMENTALCONSTANT2 = 2;
 
     [JSBuiltin] void builtinFunction();
-    [JSBuiltin, ReadOnly] attribute unsigned short builtinAttribute;
+    [JSBuiltin] attribute unsigned short builtinAttribute;
 };
index 236ae53..a3e0a6f 100644 (file)
@@ -36,7 +36,7 @@
 ] interface TestTypedefs {
     attribute ULONGLONG unsignedLongLongAttr;
 
-    [Immutable] attribute SCRIPT_VALUE immutableSerializedScriptValue;
+    attribute SCRIPT_VALUE serializedScriptValue;
     
     static readonly attribute T TestSubObj;
 
@@ -59,7 +59,7 @@
     attribute [Clamp] ULONGLONG attributeWithClamp;
     attribute CLAMPED_LONG attributeWithClampInTypedef;
 
-    [Immutable] SVGPOINT immutablePointFunction();
+    SVGPOINT pointFunction();
 
     [MayThrowException] SEQUENCE_OF_STRINGS stringSequenceFunction(SEQUENCE_OF_STRINGS values);
     [MayThrowException] sequence<STRING> stringSequenceFunction2(sequence<STRING> values);
index b8d5f32..5333776 100644 (file)
     [MayThrowException] void setMatrixValue(optional DOMString string = "undefined");
     
     // Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix)
-    [Immutable] WebKitCSSMatrix multiply(optional WebKitCSSMatrix? secondMatrix = null);
+    WebKitCSSMatrix multiply(optional WebKitCSSMatrix? secondMatrix = null);
     
     // Return the inverse of this matrix. Throw an exception if the matrix is not invertible
-    [Immutable, MayThrowException] WebKitCSSMatrix inverse();
+    [MayThrowException] WebKitCSSMatrix inverse();
     
     // Return this matrix translated by the passed values.
     // Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations
-    [Immutable] WebKitCSSMatrix translate(optional unrestricted double x = NaN,
-                                          optional unrestricted double y = NaN,
-                                          optional unrestricted double z = NaN);
+    WebKitCSSMatrix translate(optional unrestricted double x = NaN, optional unrestricted double y = NaN, optional unrestricted double z = NaN);
     
     // Returns this matrix scaled by the passed values.
     // Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN 
     // makes it the same as scaleX. This allows the 3D form to used for 2D operations
-    [Immutable] WebKitCSSMatrix scale(optional unrestricted double scaleX = NaN,
-                                      optional unrestricted double scaleY = NaN,
-                                      optional unrestricted double scaleZ = NaN);
+    WebKitCSSMatrix scale(optional unrestricted double scaleX = NaN, optional unrestricted double scaleY = NaN, optional unrestricted double scaleZ = NaN);
     
     // Returns this matrix rotated by the passed values.
     // If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX).
     // Otherwise use a rotation value of 0 for any passed NaN.    
-    [Immutable] WebKitCSSMatrix rotate(optional unrestricted double rotX = NaN,
-                                       optional unrestricted double rotY = NaN,
-                                       optional unrestricted double rotZ = NaN);
+    WebKitCSSMatrix rotate(optional unrestricted double rotX = NaN, optional unrestricted double rotY = NaN, optional unrestricted double rotZ = NaN);
     
     // Returns this matrix rotated about the passed axis by the passed angle.
     // Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value
     // of (0,0,1).
-    [Immutable] WebKitCSSMatrix rotateAxisAngle(optional unrestricted double x = NaN,
-                                                optional unrestricted double y = NaN,
-                                                optional unrestricted double z = NaN,
-                                                optional unrestricted double angle = NaN);
+    WebKitCSSMatrix rotateAxisAngle(optional unrestricted double x = NaN, optional unrestricted double y = NaN, optional unrestricted double z = NaN, optional unrestricted double angle = NaN);
 
     // Returns this matrix skewed along the X axis by the passed values.
     // Passing a NaN will use a value of 0.
-    [Immutable] WebKitCSSMatrix skewX(optional unrestricted double angle = NaN);
+    WebKitCSSMatrix skewX(optional unrestricted double angle = NaN);
 
     // Returns this matrix skewed along the Y axis by the passed values.
     // Passing a NaN will use a value of 0.
-    [Immutable] WebKitCSSMatrix skewY(optional unrestricted double angle = NaN);
+    WebKitCSSMatrix skewY(optional unrestricted double angle = NaN);
 
     [NotEnumerable] DOMString toString();
 };
index 642007e..57967ce 100644 (file)
 [
     NoInterfaceObject
 ] interface NavigatorID {
-    [Nondeterministic] readonly attribute DOMString appCodeName;
-    [Nondeterministic] readonly attribute DOMString appName;
-    [Nondeterministic] readonly attribute DOMString appVersion;
-    [Nondeterministic] readonly attribute DOMString platform;
-    [Nondeterministic] readonly attribute DOMString product;
-    [Nondeterministic, Exposed=Window] readonly attribute DOMString productSub;
-    [Nondeterministic] readonly attribute DOMString userAgent;
-    [Nondeterministic, Exposed=Window] readonly attribute DOMString vendor;
-    [Nondeterministic, Exposed=Window] readonly attribute DOMString vendorSub;
+    readonly attribute DOMString appCodeName;
+    readonly attribute DOMString appName;
+    readonly attribute DOMString appVersion;
+    readonly attribute DOMString platform;
+    readonly attribute DOMString product;
+    [Exposed=Window] readonly attribute DOMString productSub;
+    readonly attribute DOMString userAgent;
+    [Exposed=Window] readonly attribute DOMString vendor;
+    [Exposed=Window] readonly attribute DOMString vendorSub;
 };
index 5f5d22d..fcd12fb 100644 (file)
@@ -29,6 +29,6 @@
 [
     NoInterfaceObject
 ] interface NavigatorLanguage {
-    [Nondeterministic]  readonly attribute DOMString language;
+    readonly attribute DOMString language;
     readonly attribute FrozenArray<DOMString> languages;
 };
index 2d8f8d0..2860e4c 100644 (file)
@@ -26,8 +26,8 @@
 interface SVGZoomEvent : UIEvent { 
     [NewObject] readonly attribute SVGRect zoomRectScreen;
     readonly attribute unrestricted float previousScale;
-    [Immutable] readonly attribute SVGPoint previousTranslate;
+    readonly attribute SVGPoint previousTranslate;
     readonly attribute unrestricted float newScale;
-    [Immutable] readonly attribute SVGPoint newTranslate;
+    readonly attribute SVGPoint newTranslate;
 };
 
index 6e9afe0..a793ce4 100644 (file)
@@ -65,7 +65,7 @@ function(GENERATE_BINDINGS target)
     set(multiValueArgs INPUT_FILES IDL_INCLUDES PP_EXTRA_OUTPUT PP_EXTRA_ARGS)
     cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
     set(binding_generator ${WEBCORE_DIR}/bindings/scripts/generate-bindings-all.pl)
-    set(idl_attributes_file ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
+    set(idl_attributes_file ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.json)
     set(idl_files_list ${CMAKE_CURRENT_BINARY_DIR}/idl_files_${target}.tmp)
     set(_supplemental_dependency)
 
index c6d7981..db74ca4 100644 (file)
@@ -1,3 +1,16 @@
+2017-04-16  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Switch IDLAttributes.txt over to a more structured format so that more information can be added for each attribute
+        https://bugs.webkit.org/show_bug.cgi?id=170843
+
+        Reviewed by Chris Dumez.
+
+        * DumpRenderTree/DerivedSources.make:
+        * WebKitTestRunner/DerivedSources.make:
+        * Scripts/webkitpy/bindings/main.py:
+        (BindingsTests.generate_from_idl):
+        Pass IDLAttributes.json, as it is now mandatory to have one.
+
 2017-04-14  Mark Lam  <mark.lam@apple.com>
 
         Update architectures in xcconfig files.
index 05bffef..1ddbe47 100644 (file)
@@ -38,11 +38,13 @@ SCRIPTS = \
     $(WebCoreScripts)/generate-bindings.pl \
 #
 
+IDL_ATTRIBUTES_FILE = $(WebCoreScripts)/IDLAttributes.json
+
 .PHONY : all
 
-JS%.h JS%.cpp : %.idl $(SCRIPTS)
+JS%.h JS%.cpp : %.idl $(SCRIPTS) $(IDL_ATTRIBUTES_FILE)
        @echo Generating bindings for $*...
-       @perl -I $(WebCoreScripts) -I $(UISCRIPTCONTEXT_DIR) -I $(DumpRenderTree)/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include $(UISCRIPTCONTEXT_DIR) --outputDir . --generator DumpRenderTree $<
+       @perl -I $(WebCoreScripts) -I $(UISCRIPTCONTEXT_DIR) -I $(DumpRenderTree)/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include $(UISCRIPTCONTEXT_DIR) --outputDir . --generator DumpRenderTree --idlAttributesFile $(IDL_ATTRIBUTES_FILE) $<
 
 all : \
     $(UICONTEXT_INTERFACES:%=JS%.h) \
index 9995193..05b2fca 100644 (file)
@@ -57,6 +57,7 @@ class BindingsTests:
                '--generator', generator,
                '--outputDir', output_directory,
                '--supplementalDependencyFile', supplemental_dependency_file,
+               '--idlAttributesFile', 'WebCore/bindings/scripts/IDLAttributes.json',
                idl_file]
 
         exit_code = 0
index 4a2b179..97ebec6 100644 (file)
@@ -48,11 +48,13 @@ SCRIPTS = \
     $(WebCoreScripts)/generate-bindings.pl \
 #
 
+IDL_ATTRIBUTES_FILE = $(WebCoreScripts)/IDLAttributes.json
+
 .PHONY : all
 
-JS%.h JS%.cpp : %.idl $(SCRIPTS)
+JS%.h JS%.cpp : %.idl $(SCRIPTS) $(IDL_ATTRIBUTES_FILE)
        @echo Generating bindings for $*...
-       @perl -I $(WebCoreScripts) -I $(WebKitTestRunner)/InjectedBundle/Bindings -I $(WebKitTestRunner)/UIScriptContext/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include InjectedBundle/Bindings --include UIScriptContext/Bindings --outputDir . --generator TestRunner $<
+       @perl -I $(WebCoreScripts) -I $(WebKitTestRunner)/InjectedBundle/Bindings -I $(WebKitTestRunner)/UIScriptContext/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include InjectedBundle/Bindings --include UIScriptContext/Bindings --outputDir . --generator TestRunner --idlAttributesFile $(IDL_ATTRIBUTES_FILE) $<
 
 all : \
     $(INJECTED_BUNDLE_INTERFACES:%=JS%.h) \