Bug 907548 - URL.prototype should be undefined, since we don't implement the URL API. r=khuey, a=bajaj
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 22 Aug 2013 09:46:26 -0400
changeset 153859 e743faa98501c31a0d452daab9e6d8319e5b6fdc
parent 153858 acf2b6d71b4eac07eb22cd8850a43e6ea22a9f7e
child 153860 3987a287ccc8fd886abe9abc5d1b8c82b91ba414
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, bajaj
bugs907548
milestone25.0a2
Bug 907548 - URL.prototype should be undefined, since we don't implement the URL API. r=khuey, a=bajaj
dom/bindings/Bindings.conf
dom/bindings/Configuration.py
dom/bindings/test/Makefile.in
dom/bindings/test/test_bug907548.html
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -15,19 +15,20 @@
 #                  non-worker non-external-or-callback interfaces, to
 #                  'mozilla::dom::workers::InterfaceName' for worker
 #                  non-external interfaces, to 'nsIDOM' followed by the
 #                  interface name for non-worker external-or-callback
 #                  interfaces, and to 'JSObject' for worker external-or-callback
 #                  interfaces.
 #   * headerFile - The file in which the nativeType is declared (defaults
 #                  to an educated guess).
-#   * concrete - Indicates whether there exist objects with this interface as
-#                their primary interface.  Always False for callback interfaces.
-#                defaults to True otherwise.
+#   * concrete - Indicates whether there exist JS objects with this interface as
+#                their primary interface (and hence whose prototype is this
+#                interface's prototype object).  Always False for callback
+#                interfaces.  Defaults to True otherwise.
 #   * workers - Indicates whether the descriptor is intended to be used for
 #               worker threads (defaults to false).
 #   * customTrace - The native class will use a custom trace hook (defaults to
 #                   true for workers, false otherwise).
 #   * customFinalize - The native class will use a custom finalize hook
 #                      (defaults to true for workers, false otherwise).
 #   * wantsQI - Indicates whether the interface should have a QueryInterface
 #               method available to chrome.
@@ -1186,16 +1187,17 @@ DOMInterfaces = {
 },
 
 'URL' : [{
     'concrete': False,
 },
 {
     'implicitJSContext': [ 'createObjectURL', 'revokeObjectURL' ],
     'workers': True,
+    'concrete': False,
 }],
 
 'WebGLActiveInfo': {
    'nativeType': 'mozilla::WebGLActiveInfo',
    'headerFile': 'WebGLContext.h',
    'wrapperCache': False
 },
 
--- a/dom/bindings/Configuration.py
+++ b/dom/bindings/Configuration.py
@@ -475,21 +475,24 @@ class Descriptor(DescriptorProvider):
 
     def needsConstructHookHolder(self):
         assert self.interface.hasInterfaceObject()
         return False
 
     def needsHeaderInclude(self):
         """
         An interface doesn't need a header file if it is not concrete,
-        not pref-controlled, and has only consts.
+        not pref-controlled, has no prototype object, and has no
+        static methods or attributes.
         """
         return (self.interface.isExternal() or self.concrete or
             self.interface.getExtendedAttribute("PrefControlled") or
-            self.interface.hasInterfacePrototypeObject())
+            self.interface.hasInterfacePrototypeObject() or
+            any((m.isAttr() or m.isMethod()) and m.isStatic() for m
+                in self.interface.members))
 
     def wantsQI(self):
         # If it was specified explicitly use that.
         if hasattr(self, '_wantsQI'):
             return self._wantsQI
 
         # Make sure to not stick QueryInterface on abstract interfaces that
         # have hasXPConnectImpls (like EventTarget).  So only put it on
--- a/dom/bindings/test/Makefile.in
+++ b/dom/bindings/test/Makefile.in
@@ -72,16 +72,17 @@ MOCHITEST_FILES := \
   test_exceptionThrowing.html \
   test_bug852846.html \
   test_bug862092.html \
   test_bug560072.html \
   test_lenientThis.html \
   test_ByteString.html \
   test_exception_messages.html \
   test_bug707564.html \
+  test_bug907548.html \
   $(NULL)
 
 MOCHITEST_CHROME_FILES = \
   test_bug775543.html \
   test_bug707564-chrome.html \
   $(NULL)
 
 ifdef GNU_CC
new file mode 100644
--- /dev/null
+++ b/dom/bindings/test/test_bug907548.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=907548
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 907548</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript">
+
+  /** Test for Bug 907548 **/
+  ok(!URL.prototype,
+     "URL.prototype should be undefined unless the URL API is implemented");
+
+
+  </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=907548">Mozilla Bug 907548</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>