Bug 1493869 - Put window.event behind a pref and disable it by default for release versions. r=smaug
authorXidorn Quan <me@upsuper.org>
Tue, 25 Sep 2018 15:55:09 +0000
changeset 438230 835be4f82638bffee3f48f1e7075fdbfe1fcd5fd
parent 438229 b69245da928a9d067c08a2ebed11f38d6c1fa552
child 438231 cf71cf4d1e9f4d8ae705a13a4fb774a7c0c8a886
push id69937
push userxquan@mozilla.com
push dateTue, 25 Sep 2018 22:32:17 +0000
treeherderautoland@835be4f82638 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1493869
milestone64.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 1493869 - Put window.event behind a pref and disable it by default for release versions. r=smaug 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
@@ -253,16 +253,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