Bug 1493869 - Put window.event behind a pref and disable it by default for release versions. r=smaug a=pascalc
authorXidorn Quan <me@upsuper.org>
Tue, 25 Sep 2018 15:55:09 +0000
changeset 490090 b404112c2f6ce82c177d5337cd99daf79bf51a37
parent 490089 d72ddbe9798884935ea974e963c5c9e1d1a135b0
child 490091 42408e87d540cd58d706fbedf3ee2508ac2aefe5
push id9901
push userebalazs@mozilla.com
push dateThu, 27 Sep 2018 11:50:27 +0000
treeherdermozilla-beta@b404112c2f6c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, pascalc
bugs1493869
milestone63.0
Bug 1493869 - Put window.event behind a pref and disable it by default for release versions. r=smaug a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D6752
dom/webidl/Window.webidl
modules/libpref/init/all.js
testing/web-platform/meta/dom/events/event-global-extra.window.js.ini
testing/web-platform/meta/dom/events/event-global.html.ini
testing/web-platform/meta/dom/interfaces.html.ini
testing/web-platform/meta/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html.ini
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -48,17 +48,17 @@ typedef OfflineResourceList ApplicationC
   [Replaceable, Throws] readonly attribute BarProp statusbar;
   [Replaceable, Throws] readonly attribute BarProp toolbar;
   [Throws] attribute DOMString status;
   [Throws, CrossOriginCallable] void close();
   [Throws, CrossOriginReadable] readonly attribute boolean closed;
   [Throws] void stop();
   [Throws, CrossOriginCallable] void focus();
   [Throws, CrossOriginCallable] void blur();
-  [Replaceable] readonly attribute any event;
+  [Replaceable, Pref="dom.window.event.enabled"] readonly attribute any event;
 
   // other browsing contexts
   [Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy frames;
   [Replaceable, CrossOriginReadable] readonly attribute unsigned long length;
   //[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy top;
   [Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy? top;
   [Throws, CrossOriginReadable] attribute any opener;
   //[Throws] readonly attribute WindowProxy parent;
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -263,16 +263,23 @@ pref("dom.script_loader.bytecode_cache.e
 // Other values might lead to experimental strategies. For more details, have a
 // look at: ScriptLoader::ShouldCacheBytecode function.
 pref("dom.script_loader.bytecode_cache.strategy", 0);
 
 #ifdef JS_BUILD_BINAST
 pref("dom.script_loader.binast_encoding.enabled", false);
 #endif
 
+// Whether window.event is enabled
+#ifdef NIGHTLY_BUILD
+pref("dom.window.event.enabled", true);
+#else
+pref("dom.window.event.enabled", false);
+#endif
+
 // Fastback caching - if this pref is negative, then we calculate the number
 // of content viewers to cache based on the amount of available memory.
 pref("browser.sessionhistory.max_total_viewers", -1);
 
 pref("ui.use_native_colors", true);
 pref("ui.click_hold_context_menus", false);
 
 // Pop up context menu on mouseup instead of mousedown, if that's the OS default.
--- a/testing/web-platform/meta/dom/events/event-global-extra.window.js.ini
+++ b/testing/web-platform/meta/dom/events/event-global-extra.window.js.ini
@@ -1,5 +1,5 @@
 [event-global-extra.window.html]
-  prefs: [dom.webcomponents.shadowdom.enabled:true]
+  prefs: [dom.webcomponents.shadowdom.enabled:true, dom.window.event.enabled:true]
   [Listener from a different global]
     expected: FAIL
 
--- a/testing/web-platform/meta/dom/events/event-global.html.ini
+++ b/testing/web-platform/meta/dom/events/event-global.html.ini
@@ -1,2 +1,2 @@
 [event-global.html]
-  prefs: [dom.webcomponents.shadowdom.enabled:true]
+  prefs: [dom.webcomponents.shadowdom.enabled:true, dom.window.event.enabled:true]
--- a/testing/web-platform/meta/dom/interfaces.html.ini
+++ b/testing/web-platform/meta/dom/interfaces.html.ini
@@ -169,16 +169,17 @@
 
   [Range interface: existence and properties of interface prototype object]
     expected: FAIL
 
 
 [interfaces.html?include=Node]
 
 [interfaces.html?exclude=Node]
+  prefs: [dom.window.event.enabled:true]
 
   [Document interface: attribute origin]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "origin" with the proper type]
     expected: FAIL
 
   [Document interface: xmlDoc must inherit property "origin" with the proper type]
--- a/testing/web-platform/meta/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html.ini
+++ b/testing/web-platform/meta/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html.ini
@@ -1,4 +1,5 @@
 [track-remove-track.html]
+  prefs: [dom.window.event.enabled:true]
   [Tests that the 'removetrack' event is NOT fired for inband TextTrack on a failed load.]
     expected: FAIL