diff --git a/dom/webidl/Node.webidl b/dom/webidl/Node.webidl index 9b9063fe2b6b..cc367adc093b 100644 --- a/dom/webidl/Node.webidl +++ b/dom/webidl/Node.webidl @@ -36,7 +36,7 @@ interface Node : EventTarget { [Pure] readonly attribute Document? ownerDocument; - [Pure] + [Pure, Pref="dom.node.rootNode.enabled"] readonly attribute Node rootNode; [Pure] readonly attribute Node? parentNode; diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 676923f60444..1e74fef21f53 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5335,3 +5335,10 @@ pref("dom.mozBrowserFramesEnabled", false); // Is support for 'color-adjust' CSS property enabled? pref("layout.css.color-adjust.enabled", true); + +// Disable Node.rootNode in release builds. +#ifdef RELEASE_BUILD +pref("dom.node.rootNode.enabled", false); +#else +pref("dom.node.rootNode.enabled", true); +#endif diff --git a/testing/web-platform/meta/dom/interfaces.html.ini b/testing/web-platform/meta/dom/interfaces.html.ini index 5feed3166b6f..6cfa804e415c 100644 --- a/testing/web-platform/meta/dom/interfaces.html.ini +++ b/testing/web-platform/meta/dom/interfaces.html.ini @@ -1,5 +1,6 @@ [interfaces.html] type: testharness + prefs: [dom.node.rootNode.enabled:true] [MutationObserver interface: operation observe(Node,MutationObserverInit)] expected: FAIL diff --git a/testing/web-platform/meta/dom/nodes/rootNode.html.ini b/testing/web-platform/meta/dom/nodes/rootNode.html.ini new file mode 100644 index 000000000000..50767cbf62d2 --- /dev/null +++ b/testing/web-platform/meta/dom/nodes/rootNode.html.ini @@ -0,0 +1,3 @@ +[rootNode.html] + type: testharness + prefs: [dom.node.rootNode.enabled:true]