Bug 872934 - Make style sheet change event interfaces [ChromeOnly]. r=smaug
☠☠ backed out by 231a75be5c8c ☠ ☠
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Mon, 14 Oct 2013 17:15:28 +0900
changeset 164474 3620f49eb6e9b5367ee682d24832d87b80cb01df
parent 164473 f510f2d945c30ed4250c481f6e8ae7c9590b3ae6
child 164475 c52934a52f94a46fdc18a68ce221388b9cda5fa1
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [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
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/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
 {