Add support for Web IDL partial interfaces to the bindings generator
authorch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Apr 2013 07:29:19 +0000 (07:29 +0000)
committerch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Apr 2013 07:29:19 +0000 (07:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=115228

Reviewed by Kentaro Hara.

Add support for Web IDL partial interfaces to the bindings generator:
http://dev.w3.org/2006/webapi/WebIDL/#dfn-partial-interface

Also drop support for the the WebKit-specific [Supplemental] extended
attribute and use partial interfaces instead in existing IDL files.

No new tests, no behavior change.

* Modules/battery/NavigatorBattery.idl:
* Modules/filesystem/DOMWindowFileSystem.idl:
* Modules/filesystem/DataTransferItemFileSystem.idl:
* Modules/filesystem/HTMLInputElementFileSystem.idl:
* Modules/filesystem/WorkerContextFileSystem.idl:
* Modules/gamepad/NavigatorGamepad.idl:
* Modules/geolocation/NavigatorGeolocation.idl:
* Modules/indexeddb/DOMWindowIndexedDatabase.idl:
* Modules/indexeddb/WorkerContextIndexedDatabase.idl:
* Modules/mediastream/DOMWindowMediaStream.idl:
* Modules/mediastream/NavigatorMediaStream.idl:
* Modules/navigatorcontentutils/NavigatorContentUtils.idl:
* Modules/networkinfo/NavigatorNetworkInfoConnection.idl:
* Modules/notifications/DOMWindowNotifications.idl:
* Modules/notifications/WorkerContextNotifications.idl:
* Modules/quota/DOMWindowQuota.idl:
* Modules/quota/NavigatorStorageQuota.idl:
* Modules/quota/WorkerNavigatorStorageQuota.idl:
* Modules/speech/DOMWindowSpeech.idl:
* Modules/speech/DOMWindowSpeechSynthesis.idl:
* Modules/vibration/NavigatorVibration.idl:
* Modules/webaudio/DOMWindowWebAudio.idl:
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* Modules/webdatabase/WorkerContextWebDatabase.idl:
* Modules/websockets/DOMWindowWebSocket.idl:
* Modules/websockets/WorkerContextWebSocket.idl:
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/IDLParser.pm:
(parsePartialDefinition):
* bindings/scripts/generate-bindings.pl:
* bindings/scripts/preprocess-idls.pl:
(getPartialInterfaceNameFromIDLFile):
* bindings/scripts/test/TestSupplemental.idl:
* page/DOMWindowPagePopup.idl:

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

33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/battery/NavigatorBattery.idl
Source/WebCore/Modules/filesystem/DOMWindowFileSystem.idl
Source/WebCore/Modules/filesystem/DataTransferItemFileSystem.idl
Source/WebCore/Modules/filesystem/HTMLInputElementFileSystem.idl
Source/WebCore/Modules/filesystem/WorkerContextFileSystem.idl
Source/WebCore/Modules/gamepad/NavigatorGamepad.idl
Source/WebCore/Modules/geolocation/NavigatorGeolocation.idl
Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl
Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl
Source/WebCore/Modules/mediastream/NavigatorMediaStream.idl
Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.idl
Source/WebCore/Modules/networkinfo/NavigatorNetworkInfoConnection.idl
Source/WebCore/Modules/notifications/DOMWindowNotifications.idl
Source/WebCore/Modules/notifications/WorkerContextNotifications.idl
Source/WebCore/Modules/quota/DOMWindowQuota.idl
Source/WebCore/Modules/quota/NavigatorStorageQuota.idl
Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.idl
Source/WebCore/Modules/speech/DOMWindowSpeech.idl
Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.idl
Source/WebCore/Modules/vibration/NavigatorVibration.idl
Source/WebCore/Modules/webaudio/DOMWindowWebAudio.idl
Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.idl
Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.idl
Source/WebCore/Modules/websockets/DOMWindowWebSocket.idl
Source/WebCore/Modules/websockets/WorkerContextWebSocket.idl
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/generate-bindings.pl
Source/WebCore/bindings/scripts/preprocess-idls.pl
Source/WebCore/bindings/scripts/test/TestSupplemental.idl
Source/WebCore/page/DOMWindowPagePopup.idl

index 447c0b7..cce0a58 100644 (file)
@@ -1,3 +1,53 @@
+2013-04-26  Christophe Dumez  <ch.dumez@sisa.samsung.com>
+
+        Add support for Web IDL partial interfaces to the bindings generator
+        https://bugs.webkit.org/show_bug.cgi?id=115228
+
+        Reviewed by Kentaro Hara.
+
+        Add support for Web IDL partial interfaces to the bindings generator:
+        http://dev.w3.org/2006/webapi/WebIDL/#dfn-partial-interface
+
+        Also drop support for the the WebKit-specific [Supplemental] extended
+        attribute and use partial interfaces instead in existing IDL files.
+
+        No new tests, no behavior change.
+
+        * Modules/battery/NavigatorBattery.idl:
+        * Modules/filesystem/DOMWindowFileSystem.idl:
+        * Modules/filesystem/DataTransferItemFileSystem.idl:
+        * Modules/filesystem/HTMLInputElementFileSystem.idl:
+        * Modules/filesystem/WorkerContextFileSystem.idl:
+        * Modules/gamepad/NavigatorGamepad.idl:
+        * Modules/geolocation/NavigatorGeolocation.idl:
+        * Modules/indexeddb/DOMWindowIndexedDatabase.idl:
+        * Modules/indexeddb/WorkerContextIndexedDatabase.idl:
+        * Modules/mediastream/DOMWindowMediaStream.idl:
+        * Modules/mediastream/NavigatorMediaStream.idl:
+        * Modules/navigatorcontentutils/NavigatorContentUtils.idl:
+        * Modules/networkinfo/NavigatorNetworkInfoConnection.idl:
+        * Modules/notifications/DOMWindowNotifications.idl:
+        * Modules/notifications/WorkerContextNotifications.idl:
+        * Modules/quota/DOMWindowQuota.idl:
+        * Modules/quota/NavigatorStorageQuota.idl:
+        * Modules/quota/WorkerNavigatorStorageQuota.idl:
+        * Modules/speech/DOMWindowSpeech.idl:
+        * Modules/speech/DOMWindowSpeechSynthesis.idl:
+        * Modules/vibration/NavigatorVibration.idl:
+        * Modules/webaudio/DOMWindowWebAudio.idl:
+        * Modules/webdatabase/DOMWindowWebDatabase.idl:
+        * Modules/webdatabase/WorkerContextWebDatabase.idl:
+        * Modules/websockets/DOMWindowWebSocket.idl:
+        * Modules/websockets/WorkerContextWebSocket.idl:
+        * bindings/scripts/IDLAttributes.txt:
+        * bindings/scripts/IDLParser.pm:
+        (parsePartialDefinition):
+        * bindings/scripts/generate-bindings.pl:
+        * bindings/scripts/preprocess-idls.pl:
+        (getPartialInterfaceNameFromIDLFile):
+        * bindings/scripts/test/TestSupplemental.idl:
+        * page/DOMWindowPagePopup.idl:
+
 2013-04-25  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSS Regions] Hit testing is broken for absolutely positioned regions that have overflow: hidden
index a1da4c7..7c02503 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=BATTERY_STATUS,
-    Supplemental=Navigator
-] interface NavigatorBattery {
+] partial interface Navigator {
     readonly attribute BatteryManager webkitBattery;
 };
 
index a722726..f9f2554 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=FILE_SYSTEM,
-    Supplemental=DOMWindow
-] interface DOMWindowFileSystem {
+] partial interface DOMWindow {
     const unsigned short TEMPORARY = 0;
     const unsigned short PERSISTENT = 1;
 
index 86def72..3c5c4ec 100644 (file)
@@ -30,8 +30,7 @@
 
 [
     Conditional=DATA_TRANSFER_ITEMS&FILE_SYSTEM,
-    Supplemental=DataTransferItem
-] interface DataTransferItemFileSystem {
+] partial interface DataTransferItem {
     [CallWith=ScriptExecutionContext] Entry webkitGetAsEntry();
 };
 
index ee8e10b..b671740 100644 (file)
@@ -30,8 +30,7 @@
 
 [
     Conditional=FILE_SYSTEM,
-    Supplemental=HTMLInputElement
-] interface HTMLInputElementFileSystem {
+] partial interface HTMLInputElement {
     [CallWith=ScriptExecutionContext] readonly attribute EntryArray webkitEntries;
 };
 
index 46205c5..90cf6a9 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=FILE_SYSTEM,
-    Supplemental=WorkerContext
-] interface WorkerContextFileSystem {
+] partial interface WorkerContext {
     const unsigned short TEMPORARY = 0;
     const unsigned short PERSISTENT = 1;
 
index 3130ffb..a26c5ea 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=GAMEPAD,
-    Supplemental=Navigator
-] interface NavigatorGamepad {
+] partial interface Navigator {
     GamepadList webkitGetGamepads();
 };
 
index 5c1c813..ed907fc 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=GEOLOCATION,
-    Supplemental=Navigator
-] interface NavigatorGeolocation {
+] partial interface Navigator {
     readonly attribute Geolocation geolocation;
 };
 
index fed2363..19cfcbd 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=INDEXED_DATABASE,
-    Supplemental=DOMWindow
-] interface DOMWindowIndexedDatabase {
+] partial interface DOMWindow {
     [ImplementedAs=indexedDB] readonly attribute IDBFactory webkitIndexedDB;
 
     attribute IDBCursorConstructor webkitIDBCursor;
index f0dbeb2..9e42921 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=INDEXED_DATABASE,
-    Supplemental=WorkerContext
-] interface WorkerContextIndexedDatabase {
+] partial interface WorkerContext {
     [ImplementedAs=indexedDB] readonly attribute IDBFactory webkitIndexedDB;
 
     attribute IDBCursorConstructor webkitIDBCursor;
index 7325d30..3264bca 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=MEDIA_STREAM,
-    Supplemental=DOMWindow
-] interface DOMWindowMediaStream {
+] partial interface DOMWindow {
     attribute MediaStreamConstructor webkitMediaStream;
     attribute RTCPeerConnectionConstructor webkitRTCPeerConnection;
     attribute RTCSessionDescriptionConstructor RTCSessionDescription;
index 4d1c871..5d399a8 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=MEDIA_STREAM,
-    Supplemental=Navigator
-] interface NavigatorMediaStream {
+] partial interface Navigator {
     void webkitGetUserMedia(in Dictionary options,
                                                  in [Callback] NavigatorUserMediaSuccessCallback successCallback,
                                                  in [Callback, Optional] NavigatorUserMediaErrorCallback errorCallback)
index b4171a0..b5098e7 100644 (file)
@@ -19,9 +19,7 @@
 */
 
 // http://www.w3.org/TR/html5/system-state-and-capabilities.html#custom-handlers
-[
-    Supplemental=Navigator
-] interface NavigatorContentUtils {
+partial interface Navigator {
     [Conditional=NAVIGATOR_CONTENT_UTILS] void registerProtocolHandler(in DOMString scheme, in DOMString url, in DOMString title)
         raises(DOMException);
     [Conditional=NAVIGATOR_CONTENT_UTILS&CUSTOM_SCHEME_HANDLER] DOMString isProtocolHandlerRegistered(in DOMString scheme, in DOMString url)
index 7cbf556..eae9eaf 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=NETWORK_INFO,
-    Supplemental=Navigator
-] interface NavigatorNetworkInfoConnection {
+] partial interface Navigator {
     readonly attribute NetworkInfoConnection webkitConnection;
 };
 
index 18bc97b..d9b5aa5 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
-    Supplemental=DOMWindow
-] interface DOMWindowNotifications {
+] partial interface DOMWindow {
 #if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
     readonly attribute NotificationCenter webkitNotifications;
 #endif
index 090fcf5..9d94c63 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
-    Supplemental=WorkerContext
-] interface WorkerContextNotifications {
+] partial interface WorkerContext {
 #if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
     readonly attribute NotificationCenter webkitNotifications;
 #endif
index 20c7a14..08c5306 100644 (file)
@@ -25,8 +25,7 @@
 
 [
     Conditional=QUOTA,
-    Supplemental=DOMWindow
-] interface DOMWindowQuota {
+] partial interface DOMWindow {
     readonly attribute StorageInfo webkitStorageInfo;
 };
 
index 9345947..f13f03d 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=QUOTA,
-    Supplemental=Navigator
-] interface NavigatorStorageQuota {
+] partial interface Navigator {
     readonly attribute StorageQuota webkitTemporaryStorage;
     readonly attribute StorageQuota webkitPersistentStorage;
 };
index 17370cd..fc3f181 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=QUOTA,
-    Supplemental=WorkerNavigator
-] interface WorkerNavigatorStorageQuota {
+] partial interface WorkerNavigator {
     readonly attribute StorageQuota webkitTemporaryStorage;
     readonly attribute StorageQuota webkitPersistentStorage;
 };
index 953b1c5..4536ca2 100644 (file)
@@ -25,8 +25,7 @@
 
 [
     Conditional=SCRIPTED_SPEECH,
-    Supplemental=DOMWindow
-] interface DOMWindowSpeech {
+] partial interface DOMWindow {
     attribute SpeechRecognitionConstructor webkitSpeechRecognition;
     attribute SpeechRecognitionErrorConstructor webkitSpeechRecognitionError;
     attribute SpeechRecognitionEventConstructor webkitSpeechRecognitionEvent;
index de8a699..f39d923 100644 (file)
@@ -25,8 +25,7 @@
 
 [
     Conditional=SPEECH_SYNTHESIS,
-    Supplemental=DOMWindow
-] interface DOMWindowSpeechSynthesis {
+] partial interface DOMWindow {
 
     readonly attribute SpeechSynthesis speechSynthesis;
     attribute SpeechSynthesisEventConstructor SpeechSynthesisEvent;
index 1faef23..62fb02b 100644 (file)
@@ -19,8 +19,7 @@
 
 [
     Conditional=VIBRATION,
-    Supplemental=Navigator
-] interface NavigatorVibration {
+] partial interface Navigator {
     void vibrate(in sequence<unsigned long> pattern) raises(DOMException);
     void vibrate(in unsigned long time) raises(DOMException);
 };
index a8a5474..cd2c9b0 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=WEB_AUDIO,
-    Supplemental=DOMWindow
-] interface DOMWindowWebAudio {
+] partial interface DOMWindow {
 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
     [CustomGetter] attribute AudioContextConstructor webkitAudioContext;
     attribute OfflineAudioContextConstructor webkitOfflineAudioContext;
index 5451ed5..1f31e1d 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=SQL_DATABASE,
-    Supplemental=DOMWindow
-] interface DOMWindowWebDatabase {
+] partial interface DOMWindow {
     Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
         raises(DOMException);
 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
index ed617ea..5a1e5e9 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=SQL_DATABASE,
-    Supplemental=WorkerContext
-] interface WorkerContextWebDatabase {
+] partial interface WorkerContext {
     Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
         raises(DOMException);
 
index e283115..7df651d 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=WEB_SOCKETS,
-    Supplemental=DOMWindow
-] interface DOMWindowWebSocket {
+] partial interface DOMWindow {
 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
     attribute CloseEventConstructor CloseEvent;
     [CustomGetter] attribute WebSocketConstructor WebSocket; // Usable with the new operator
index c659ef3..d935f5e 100644 (file)
@@ -26,8 +26,7 @@
 
 [
     Conditional=WEB_SOCKETS,
-    Supplemental=WorkerContext
-] interface WorkerContextWebSocket {
+] partial interface WorkerContext {
     [CustomGetter] attribute WebSocketConstructor WebSocket; // Usable with the new operator
 };
 
index 1d736d4..32c8909 100644 (file)
@@ -99,7 +99,6 @@ ReplaceableConstructor
 ReturnNewObject
 SkipVTableValidation
 StrictTypeChecking
-Supplemental=*
 SuppressToJSObject
 TransferList=*
 TreatNullAs=NullString
index 70f05ba..89967e2 100644 (file)
@@ -51,6 +51,7 @@ struct( domInterface => {
     constructors => '@', # Constructors, list of 'domFunction'
     isException => '$', # Used for exception interfaces
     isCallback => '$', # Used for callback interfaces
+    isPartial => '$', # Used for partial interfaces
 });
 
 # Used to represent domInterface contents (name of method, signature)
@@ -529,7 +530,9 @@ sub parsePartialDefinition
 
     my $next = $self->nextToken();
     if ($next->value() eq "interface") {
-        return $self->parsePartialInterface($extendedAttributeList);
+        my $interface = $self->parseInterface($extendedAttributeList);
+        $interface->isPartial(1);
+        return $interface;
     }
     if ($next->value() eq "dictionary") {
         return $self->parsePartialDictionary($extendedAttributeList);
index 7433e7b..5728055 100755 (executable)
@@ -139,7 +139,7 @@ foreach my $idlFile (@supplementedIdlFiles) {
     my $document = $parser->Parse($idlFile, $defines, $preprocessor);
 
     foreach my $interface (@{$document->interfaces}) {
-        if ($interface->extendedAttributes->{"Supplemental"} and $interface->extendedAttributes->{"Supplemental"} eq $targetInterfaceName) {
+        if ($interface->isPartial and $interface->name eq $targetInterfaceName) {
             my $targetDataNode;
             foreach my $interface (@{$targetDocument->interfaces}) {
                 if ($interface->name eq $targetInterfaceName) {
@@ -149,40 +149,37 @@ foreach my $idlFile (@supplementedIdlFiles) {
             }
             die "Not found an interface ${targetInterfaceName} in ${targetInterfaceName}.idl." unless defined $targetDataNode;
 
-            # Support [Supplemental] for attributes.
+            # Support for attributes of partial interfaces.
             foreach my $attribute (@{$interface->attributes}) {
                 # Record that this attribute is implemented by $interfaceName.
                 $attribute->signature->extendedAttributes->{"ImplementedBy"} = $interfaceName;
 
                 # Add interface-wide extended attributes to each attribute.
                 foreach my $extendedAttributeName (keys %{$interface->extendedAttributes}) {
-                    next if ($extendedAttributeName eq "Supplemental");
                     $attribute->signature->extendedAttributes->{$extendedAttributeName} = $interface->extendedAttributes->{$extendedAttributeName};
                 }
                 push(@{$targetDataNode->attributes}, $attribute);
             }
 
-            # Support [Supplemental] for methods.
+            # Support for methods of partial interfaces.
             foreach my $function (@{$interface->functions}) {
                 # Record that this method is implemented by $interfaceName.
                 $function->signature->extendedAttributes->{"ImplementedBy"} = $interfaceName;
 
                 # Add interface-wide extended attributes to each method.
                 foreach my $extendedAttributeName (keys %{$interface->extendedAttributes}) {
-                    next if ($extendedAttributeName eq "Supplemental");
                     $function->signature->extendedAttributes->{$extendedAttributeName} = $interface->extendedAttributes->{$extendedAttributeName};
                 }
                 push(@{$targetDataNode->functions}, $function);
             }
 
-            # Support [Supplemental] for constants.
+            # Support for constants of partial interfaces.
             foreach my $constant (@{$interface->constants}) {
                 # Record that this constant is implemented by $interfaceName.
                 $constant->extendedAttributes->{"ImplementedBy"} = $interfaceName;
 
                 # Add interface-wide extended attributes to each constant.
                 foreach my $extendedAttributeName (keys %{$interface->extendedAttributes}) {
-                    next if ($extendedAttributeName eq "Supplemental");
                     $constant->extendedAttributes->{$extendedAttributeName} = $interface->extendedAttributes->{$extendedAttributeName};
                 }
                 push(@{$targetDataNode->constants}, $constant);
index dfc2931..abd3d8f 100644 (file)
@@ -52,9 +52,9 @@ my %supplementalDependencies;
 my %supplementals;
 foreach my $idlFile (@idlFiles) {
     my $fullPath = Cwd::realpath($idlFile);
-    my $supplemental = getSupplementalFromIDLFile($fullPath);
-    if ($supplemental) {
-        $supplementalDependencies{$fullPath} = $supplemental;
+    my $partialInterfaceName = getPartialInterfaceNameFromIDLFile($fullPath);
+    if ($partialInterfaceName) {
+        $supplementalDependencies{$fullPath} = $partialInterfaceName;
     }
     my $interfaceName = fileparse(basename($idlFile), ".idl");
     $interfaceNameToIdlFile{$interfaceName} = $fullPath;
@@ -62,7 +62,7 @@ foreach my $idlFile (@idlFiles) {
     $supplementals{$fullPath} = [];
 }
 
-# Resolves [Supplemental=XXX] dependencies.
+# Resolves partial interfaces dependencies.
 foreach my $idlFile (keys %supplementalDependencies) {
     my $baseFile = $supplementalDependencies{$idlFile};
     my $targetIdlFile = $interfaceNameToIdlFile{$baseFile};
@@ -110,7 +110,7 @@ if ($supplementalMakefileDeps) {
 }
 
 
-sub getSupplementalFromIDLFile
+sub getPartialInterfaceNameFromIDLFile
 {
     my $idlFile = shift;
 
@@ -119,12 +119,7 @@ sub getSupplementalFromIDLFile
     close FILE;
 
     my $fileContents = join('', @lines);
-    while ($fileContents =~ /\[(.*?)\] interface (\w+)/gs) {
-        my @attributes = split(',', $1);
-        foreach (@attributes) {
-            if (/Supplemental=(\w+)/) {
-                return $1;
-            }
-        }
+    if ($fileContents =~ /partial\s+interface\s+(\w+)/gs) {
+        return $1;
     }
 }
index d88a6cc..669ef1c 100644 (file)
@@ -30,8 +30,7 @@
 // changes in its ouput.
 [
     Conditional=Condition11|Condition12,
-    Supplemental=TestInterface
-] interface TestSupplemental {
+] partial interface TestInterface {
     static readonly attribute long supplementalStaticReadOnlyAttr;
     static attribute DOMString supplementalStaticAttr;
     readonly attribute DOMString supplementalStr1;
index ae36039..336e828 100644 (file)
@@ -30,7 +30,6 @@
 
 [
     Conditional=PAGE_POPUP,
-    Supplemental=DOMWindow
-] interface DOMWindowPagePopup {
+] partial interface DOMWindow {
     readonly attribute PagePopupController pagePopupController;
 };