Bug 1104955 part 1. Add parsing for [Unscopeable] in IDL. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 29 Mar 2016 15:49:45 -0400
changeset 290960 483533fede8d48bcbd06a5541758c81af0c4385c
parent 290959 2832f35108961d4b602b80950894da8aa5956b88
child 290961 75898c3d4bb2ba2557ee90c895bebf110bdaa9dd
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1104955
milestone48.0a1
Bug 1104955 part 1. Add parsing for [Unscopeable] in IDL. r=khuey
dom/bindings/parser/WebIDL.py
dom/webidl/ChildNode.webidl
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -4103,16 +4103,24 @@ class IDLAttribute(IDLInterfaceMember):
                                   "readonly attributes" % attr.value(),
                                   [attr.location, self.location])
             self._setDependsOn(attr.value())
         elif identifier == "UseCounter":
             if self.stringifier:
                 raise WebIDLError("[UseCounter] must not be used on a "
                                   "stringifier attribute",
                                   [attr.location, self.location])
+        elif identifier == "Unscopable":
+            if not attr.noArguments():
+                raise WebIDLError("[Unscopable] must take no arguments",
+                                  [attr.location])
+            if self.isStatic():
+                raise WebIDLError("[Unscopable] is only allowed on non-static "
+                                  "attributes and operations",
+                                  [attr.location, self.location])
         elif (identifier == "Pref" or
               identifier == "Deprecated" or
               identifier == "SetterThrows" or
               identifier == "Throws" or
               identifier == "GetterThrows" or
               identifier == "ChromeOnly" or
               identifier == "Func" or
               identifier == "Frozen" or
@@ -4803,16 +4811,24 @@ class IDLMethod(IDLInterfaceMember, IDLS
                 raise WebIDLError("[Alias] takes an identifier or string",
                                   [attr.location])
             self._addAlias(attr.value())
         elif identifier == "UseCounter":
             if self.isSpecial():
                 raise WebIDLError("[UseCounter] must not be used on a special "
                                   "operation",
                                   [attr.location, self.location])
+        elif identifier == "Unscopable":
+            if not attr.noArguments():
+                raise WebIDLError("[Unscopable] must take no arguments",
+                                  [attr.location])
+            if self.isStatic():
+                raise WebIDLError("[Unscopable] is only allowed on non-static "
+                                  "attributes and operations",
+                                  [attr.location, self.location])
         elif (identifier == "Throws" or
               identifier == "NewObject" or
               identifier == "ChromeOnly" or
               identifier == "UnsafeInPrerendering" or
               identifier == "Pref" or
               identifier == "Deprecated" or
               identifier == "Func" or
               identifier == "AvailableIn" or
--- a/dom/webidl/ChildNode.webidl
+++ b/dom/webidl/ChildNode.webidl
@@ -5,19 +5,23 @@
  *
  * The origin of this IDL file is
  * http://dom.spec.whatwg.org/#interface-childnode
  */
 
 [NoInterfaceObject]
 interface ChildNode {
 // Not implemented yet:
+//  [Unscopable]
 //  void before((Node or DOMString)... nodes);
+//  [Unscopable]
 //  void after((Node or DOMString)... nodes);
+//  [Unscopable]
 //  void replace((Node or DOMString)... nodes);
+  [Unscopable]
   void remove();
 };
 
 [NoInterfaceObject]
 interface NonDocumentTypeChildNode {
   [Pure]
   readonly attribute Element? previousElementSibling;
   [Pure]