Bug 761621 - interfaces inheriting a builtinclass-interface should be builtinclass too, r=khuey
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 06 Jun 2012 19:30:58 +0300
changeset 101245 5fb42dae7200cb81729e727534a4ddd6a4f62f4a
parent 101244 c4da1c7555eebab7e250de0ad61b2291b8442732
child 101246 794751c0c8f46173d49f8ad8b46656f02001cac2
push id191
push userlsblakk@mozilla.com
push dateFri, 05 Oct 2012 17:12:53 +0000
treeherdermozilla-release@ddb22ac6c03b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs761621
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 761621 - interfaces inheriting a builtinclass-interface should be builtinclass too, r=khuey
dom/battery/nsIDOMBatteryManager.idl
dom/interfaces/base/nsIDOMScreen.idl
dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
dom/network/interfaces/nsIDOMMobileConnection.idl
dom/sms/interfaces/nsIDOMSmsManager.idl
dom/sms/interfaces/nsIDOMSmsRequest.idl
xpcom/idl-parser/xpidl.py
xpcom/io/nsILocalFile.idl
xpcom/io/nsILocalFileMac.idl
xpcom/io/nsILocalFileWin.idl
--- a/dom/battery/nsIDOMBatteryManager.idl
+++ b/dom/battery/nsIDOMBatteryManager.idl
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMEventTarget.idl"
 
 interface nsIDOMEventListener;
 
-[scriptable, uuid(41e88f87-42cb-4db1-8724-f5456a16c410)]
+[scriptable, builtinclass, uuid(41e88f87-42cb-4db1-8724-f5456a16c410)]
 interface nsIDOMMozBatteryManager : nsIDOMEventTarget
 {
   readonly attribute double     level;
   readonly attribute boolean    charging;
   readonly attribute double     dischargingTime;
   readonly attribute double     chargingTime;
 
   attribute nsIDOMEventListener onlevelchange;
--- a/dom/interfaces/base/nsIDOMScreen.idl
+++ b/dom/interfaces/base/nsIDOMScreen.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMEventTarget.idl"
 
-[scriptable, uuid(9b978f58-5bfe-409d-aa3f-946ca934e51d)]
+[scriptable, builtinclass, uuid(9b978f58-5bfe-409d-aa3f-946ca934e51d)]
 interface nsIDOMScreen : nsIDOMEventTarget
 {
   readonly attribute long             top;
   readonly attribute long             left;
   readonly attribute long             width;
   readonly attribute long             height;
   readonly attribute long             pixelDepth;
   readonly attribute long             colorDepth;
--- a/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
+++ b/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
@@ -126,24 +126,24 @@ interface nsIWebGLExtensionStandardDeriv
   //
   //  CONSTANTS
   //
 
   /* Fragment shader hint */
   const WebGLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES   = 0x8B8B;
 };
 
-[scriptable, uuid(b0afc2eb-0895-4509-98de-5c383d160694)]
+[scriptable, builtinclass, uuid(b0afc2eb-0895-4509-98de-5c383d160694)]
 interface nsIWebGLExtensionLoseContext : nsIWebGLExtension
 {
   void loseContext();
   void restoreContext();
 };
 
-[scriptable, uuid(73bfb64d-94bd-4a7a-9eab-6b6d32e57aa0)]
+[scriptable, builtinclass, uuid(73bfb64d-94bd-4a7a-9eab-6b6d32e57aa0)]
 interface nsIWebGLExtensionTextureFilterAnisotropic : nsIWebGLExtension
 {
   const WebGLenum TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
   const WebGLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
 };
 
 [scriptable, builtinclass, uuid(a1508b6f-f2ab-44cf-bbb4-3cfb339e1e8a)]
 interface nsIWebGLExtensionCompressedTextureS3TC : nsIWebGLExtension
--- a/dom/network/interfaces/nsIDOMMobileConnection.idl
+++ b/dom/network/interfaces/nsIDOMMobileConnection.idl
@@ -3,17 +3,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMEventTarget.idl"
 
 interface nsIDOMEventListener;
 interface nsIDOMDOMRequest;
 interface nsIDOMMozMobileConnectionInfo;
 
-[scriptable, uuid(962298cd-3443-423e-9e47-f22e24ad850b)]
+[scriptable, builtinclass, uuid(962298cd-3443-423e-9e47-f22e24ad850b)]
 interface nsIDOMMozMobileConnection : nsIDOMEventTarget
 {
   /**
    * Indicates the state of the device's ICC card.
    *
    * Possible values: null, 'absent', 'pinRequired', 'pukRequired',
    * 'networkLocked', 'ready'.
    */
--- a/dom/sms/interfaces/nsIDOMSmsManager.idl
+++ b/dom/sms/interfaces/nsIDOMSmsManager.idl
@@ -3,17 +3,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMEventTarget.idl"
 
 interface nsIDOMEventListener;
 interface nsIDOMMozSmsRequest;
 interface nsIDOMMozSmsFilter;
 
-[scriptable, uuid(6363c0ff-b58f-4fb3-9707-0ba27f120b2c)]
+[scriptable, builtinclass, uuid(6363c0ff-b58f-4fb3-9707-0ba27f120b2c)]
 interface nsIDOMMozSmsManager : nsIDOMEventTarget
 {
   unsigned short      getNumberOfMessagesForText(in DOMString text);
 
   // The first parameter can be either a DOMString (only one number) or an array
   // of DOMStrings.
   // The method returns a SmsRequest object if one number has been passed.
   // An array of SmsRequest objects otherwise.
--- a/dom/sms/interfaces/nsIDOMSmsRequest.idl
+++ b/dom/sms/interfaces/nsIDOMSmsRequest.idl
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMEventTarget.idl"
 
 interface nsIDOMEventListener;
 
-[scriptable, uuid(1b24469d-cfb7-4667-aaf0-c1d17289ae7c)]
+[scriptable, builtinclass, uuid(1b24469d-cfb7-4667-aaf0-c1d17289ae7c)]
 interface nsIDOMMozSmsRequest : nsIDOMEventTarget
 {
   // Returns whether "processing" or "done".
   readonly attribute DOMString           readyState;
   // Can be null.
   readonly attribute DOMString           error;
   // Can be bool, nsIDOMSmsMessage, nsIDOMSmsIterator or null.
   readonly attribute jsval               result;
--- a/xpcom/idl-parser/xpidl.py
+++ b/xpcom/idl-parser/xpidl.py
@@ -511,16 +511,19 @@ class BaseInterface(object):
         if self.base is not None:
             realbase = parent.getName(self.base, self.location)
             if realbase.kind != self.kind:
                 raise IDLError("%s '%s' inherits from non-%s type '%s'" % (self.kind, self.name, self.kind, self.base), self.location)
 
             if self.attributes.scriptable and not realbase.attributes.scriptable:
                 print >>sys.stderr, IDLError("interface '%s' is scriptable but derives from non-scriptable '%s'" % (self.name, self.base), self.location, warning=True)
 
+            if self.attributes.scriptable and realbase.attributes.builtinclass and not self.attributes.builtinclass:
+                raise IDLError("interface '%s' is not builtinclass but derives from builtinclass '%s'" % (self.name, self.base), self.location)
+
         forwardedMembers = set()
         for member in self.members:
             member.resolve(self)
             if member.kind is 'method' and member.forward:
                 forwardedMembers.add(member.forward)
         for member in self.members:
             if member.kind is 'method' and member.name in forwardedMembers:
                 forwardedMembers.remove(member.name)
--- a/xpcom/io/nsILocalFile.idl
+++ b/xpcom/io/nsILocalFile.idl
@@ -5,13 +5,13 @@
 
 #include "nsIFile.idl"
 
 /**
  * An empty interface to provide backwards compatibility for existing code.
  *
  * @see nsIFile
  */
-[scriptable, uuid(ce4ef184-7660-445e-9e59-6731bdc65505)]
+[scriptable, builtinclass, uuid(ce4ef184-7660-445e-9e59-6731bdc65505)]
 interface nsILocalFile : nsIFile
 {
 };
 
--- a/xpcom/io/nsILocalFileMac.idl
+++ b/xpcom/io/nsILocalFileMac.idl
@@ -11,17 +11,17 @@
 %}
 
       native OSType(OSType);
       native FSSpec(FSSpec);
       native FSRef(FSRef);
 [ptr] native FSRefPtr(FSRef);
       native CFURLRef(CFURLRef);
 
-[scriptable, uuid(E5DE2CC9-BF06-4329-8F91-5D2D45284500)]
+[scriptable, builtinclass, uuid(E5DE2CC9-BF06-4329-8F91-5D2D45284500)]
 interface nsILocalFileMac : nsILocalFile
 {
    /**
     * initWithCFURL
     *
     * Init this object with a CFURLRef
     *
     * NOTE: Supported only for XP_MACOSX
--- a/xpcom/io/nsILocalFileWin.idl
+++ b/xpcom/io/nsILocalFileWin.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 #include "nsILocalFile.idl"
 
-[scriptable, uuid(c7b3fd13-30f2-46e5-a0d9-7a79a9b73c5b)]
+[scriptable, builtinclass, uuid(c7b3fd13-30f2-46e5-a0d9-7a79a9b73c5b)]
 interface nsILocalFileWin : nsILocalFile
 {
    /**
     * getVersionInfoValue
     *
     * Retrieve a metadata field from the file's VERSIONINFO block.
     * Throws NS_ERROR_FAILURE if no value is found, or the value is empty.
     *