Bug 872934 - Make style sheet change event interfaces [ChromeOnly]. r=smaug
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Tue, 15 Oct 2013 04:03:37 +0900
changeset 150709 cb60620284928593b88d9effc2ca84288674913e
parent 150708 14b7cbd254a8346025cbb130ca428180ff921c49
child 150710 c2e371d16e65fa13d54e5a4867a1e2617a4b8ac7
push id25462
push userkwierso@gmail.com
push dateTue, 15 Oct 2013 01:48:30 +0000
treeherdermozilla-central@ddd03c32fab1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs872934
milestone27.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 872934 - Make style sheet change event interfaces [ChromeOnly]. r=smaug
CLOBBER
content/events/test/test_all_synthetic_events.html
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/StyleRuleChangeEvent.webidl
dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
dom/webidl/StyleSheetChangeEvent.webidl
--- a/CLOBBER
+++ b/CLOBBER
@@ -13,9 +13,9 @@
 #          |               |
 #          O <-- Clobber   O  <-- Clobber
 #
 # Note: The description below will be part of the error message shown to users.
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
-Bug 915002 - Clobber needed for webidl updates for AppNotificationServiceOptions. One more time.
\ No newline at end of file
+Bug 872934 - Clobber needed for webidl updates for style sheet change events. Again and again.
\ No newline at end of file
--- a/content/events/test/test_all_synthetic_events.html
+++ b/content/events/test/test_all_synthetic_events.html
@@ -348,24 +348,27 @@ const kEventConstructors = {
                                              },
   StorageEvent:                              { create: function (aName, aProps) {
                                                          return new StorageEvent(aName, aProps);
                                                        },
                                              },
   StyleRuleChangeEvent:                      { create: function (aName, aProps) {
                                                          return new StyleRuleChangeEvent(aName, aProps);
                                                        },
+                                               chromeOnly: true,
                                              },
   StyleSheetApplicableStateChangeEvent:      { create: function (aName, aProps) {
                                                          return new StyleSheetApplicableStateChangeEvent(aName, aProps);
                                                        },
+                                               chromeOnly: true,
                                              },
   StyleSheetChangeEvent:                     { create: function (aName, aProps) {
                                                          return new StyleSheetChangeEvent(aName, aProps);
                                                        },
+                                               chromeOnly: true,
                                              },
   SVGZoomEvent:                              { create: function (aName, aProps) {
                                                          var e = document.createEvent("svgzoomevent");
                                                          e.initUIEvent(aName, aProps.bubbles, aProps.cancelable,
                                                                        aProps.view, aProps.detail);
                                                          return e;
                                                        },
                                              },
@@ -405,16 +408,26 @@ const kEventConstructors = {
                                                        },
                                              },
   WheelEvent:                                { create: function (aName, aProps) {
                                                          return new WheelEvent(aName, aProps);
                                                        },
                                              },
 };
 
+for (var name of Object.keys(kEventConstructors)) {
+  if (!kEventConstructors[name].chromeOnly) {
+    continue;
+  }
+  if (window[name]) {
+    ok(false, name + " should be chrome only.");
+  }
+  window[name] = SpecialPowers.unwrap(SpecialPowers.wrap(window)[name]);
+}
+
 var props = Object.getOwnPropertyNames(window);
 for (var i = 0; i < props.length; i++) {
   // Assume that event object must be named as "FooBarEvent".
   if (!props[i].match(/^([A-Z][a-zA-Z]+)?Event$/)) {
     continue;
   }
   if (!kEventConstructors[props[i]]) {
     ok(false, "Unknown event found: " + props[i]);
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -406,20 +406,17 @@ var interfaceNamesInGlobalScope =
     "SpeechRecognitionEvent",
     "SpeechSynthesisEvent",
     {name: "SpeechSynthesis", b2g: true},
     {name: "SpeechSynthesisUtterance", b2g: true},
     {name: "SpeechSynthesisVoice", b2g: true},
     {name: "SpecialPowers", xbl: false},
     "Storage",
     "StorageEvent",
-    "StyleRuleChangeEvent",
     "StyleSheet",
-    "StyleSheetApplicableStateChangeEvent",
-    "StyleSheetChangeEvent",
     "StyleSheetList",
     "SVGAElement",
     "SVGAltGlyphElement",
     "SVGAngle",
     "SVGAnimatedAngle",
     "SVGAnimatedBoolean",
     "SVGAnimatedEnumeration",
     "SVGAnimatedInteger",
--- a/dom/webidl/StyleRuleChangeEvent.webidl
+++ b/dom/webidl/StyleRuleChangeEvent.webidl
@@ -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/.
  */
 interface CSSRule;
 
-[Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[ChromeOnly, Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
 interface StyleRuleChangeEvent : Event
 {
   readonly attribute CSSStyleSheet? stylesheet;
   readonly attribute CSSRule? rule;
 };
 
 dictionary StyleRuleChangeEventInit : EventInit
 {
--- a/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
+++ b/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
@@ -1,15 +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/.
  */
 
-[Constructor(DOMString type, optional StyleSheetApplicableStateChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[ChromeOnly, Constructor(DOMString type, optional StyleSheetApplicableStateChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
 interface StyleSheetApplicableStateChangeEvent : Event
 {
   readonly attribute CSSStyleSheet? stylesheet;
   readonly attribute boolean applicable;
 };
 
 dictionary StyleSheetApplicableStateChangeEventInit : EventInit
 {
--- a/dom/webidl/StyleSheetChangeEvent.webidl
+++ b/dom/webidl/StyleSheetChangeEvent.webidl
@@ -1,15 +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/.
  */
 
-[Constructor(DOMString type, optional StyleSheetChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[ChromeOnly, Constructor(DOMString type, optional StyleSheetChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
 interface StyleSheetChangeEvent : Event
 {
   readonly attribute CSSStyleSheet? stylesheet;
   readonly attribute boolean documentSheet;
 };
 
 dictionary StyleSheetChangeEventInit : EventInit
 {