Bug 816375. Switch NodeFilter to WebIDL bindings. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 14 Dec 2012 14:10:49 -0500
changeset 125206 c833cab38b083cdca0521eb057ed5bd5a19d6014
parent 125205 3e0b4ce62d6dd8c24c23b531ffb7ac8974ba2c3e
child 125207 53b604b60d25c9a2b22e8347df04bee704ab4366
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs816375
milestone20.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 816375. Switch NodeFilter to WebIDL bindings. r=peterv
dom/bindings/Codegen.py
dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_interfaces.html.json
dom/webidl/NodeFilter.webidl
dom/webidl/WebIDL.mk
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -1143,19 +1143,24 @@ class MethodDefiner(PropertyDefiner):
     A class for defining methods on a prototype object.
     """
     def __init__(self, descriptor, name, static):
         PropertyDefiner.__init__(self, descriptor, name)
 
         # FIXME https://bugzilla.mozilla.org/show_bug.cgi?id=772822
         #       We should be able to check for special operations without an
         #       identifier. For now we check if the name starts with __
-        methods = [m for m in descriptor.interface.members if
-                   m.isMethod() and m.isStatic() == static and
-                   not m.isIdentifierLess()]
+
+        # Ignore non-static methods for callback interfaces
+        if not descriptor.interface.isCallback() or static:
+            methods = [m for m in descriptor.interface.members if
+                       m.isMethod() and m.isStatic() == static and
+                       not m.isIdentifierLess()]
+        else:
+            methods = []
         self.chrome = []
         self.regular = []
         for m in methods:
             method = { "name": m.identifier.name,
                        "methodInfo": not m.isStatic(),
                        "length": methodLength(m),
                        "flags": "JSPROP_ENUMERATE",
                        "pref": PropertyDefiner.getControllingPref(m) }
@@ -1227,19 +1232,23 @@ class MethodDefiner(PropertyDefiner):
             'JSFunctionSpec',
             pref, specData, doIdArrays)
 
 class AttrDefiner(PropertyDefiner):
     def __init__(self, descriptor, name, static, unforgeable=False):
         assert not (static and unforgeable)
         PropertyDefiner.__init__(self, descriptor, name)
         self.name = name
-        attributes = [m for m in descriptor.interface.members if
-                      m.isAttr() and m.isStatic() == static and
-                      m.isUnforgeable() == unforgeable]
+        # Ignore non-static attributes for callback interfaces
+        if not descriptor.interface.isCallback() or static:
+            attributes = [m for m in descriptor.interface.members if
+                          m.isAttr() and m.isStatic() == static and
+                          m.isUnforgeable() == unforgeable]
+        else:
+            attributes = []
         self.chrome = [m for m in attributes if isChromeOnly(m)]
         self.regular = [m for m in attributes if not isChromeOnly(m)]
         self.static = static
         self.unforgeable = unforgeable
 
         if static:
             if not descriptor.interface.hasInterfaceObject():
                 # static attributes go on the interface object
--- a/dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_interfaces.html.json
+++ b/dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_interfaces.html.json
@@ -1,5 +1,4 @@
 {
   "Should be able to delete Document.": true,
-  "Should be able to delete CharacterData.": true,
-  "Should be able to delete NodeFilter.": true
+  "Should be able to delete CharacterData.": true
 }
--- a/dom/webidl/NodeFilter.webidl
+++ b/dom/webidl/NodeFilter.webidl
@@ -1,18 +1,15 @@
 /* -*- 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/.
  *
  * The origin of this IDL file is
- * http://www.w3.org/TR/2012/WD-dom-20120105/
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
+ * http://dom.spec.whatwg.org/#interface-nodefilter
  */
 
 callback interface NodeFilter {
   // Constants for acceptNode()
   const unsigned short FILTER_ACCEPT = 1;
   const unsigned short FILTER_REJECT = 2;
   const unsigned short FILTER_SKIP = 3;
 
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -44,16 +44,17 @@ webidl_files = \
   Function.webidl \
   GainNode.webidl \
   HTMLCollection.webidl \
   HTMLElement.webidl \
   HTMLOptionsCollection.webidl \
   HTMLPropertiesCollection.webidl \
   ImageData.webidl \
   Node.webidl \
+  NodeFilter.webidl \
   NodeList.webidl \
   PaintRequestList.webidl \
   PannerNode.webidl \
   Performance.webidl \
   PerformanceNavigation.webidl \
   PerformanceTiming.webidl \
   Screen.webidl \
   SVGLengthList.webidl \