Bug 1492582 - Use XUL inspector highlighter for HTML docs without scroll frames. r=bgrins
authorBrendan Dahl <bdahl@mozilla.com>
Fri, 08 Nov 2019 23:34:10 +0000
changeset 501408 c2b41600ce78924d6a8b0cfd649fd8a7867ee6d1
parent 501407 d9fa29c55c42606dd014abe3816667384d19288e
child 501409 9644ee96a51a03a8f4e50e9777fb7278f246383c
push id36791
push usercsabou@mozilla.com
push dateSun, 10 Nov 2019 09:53:30 +0000
treeherdermozilla-central@72c52c0101cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1492582
milestone72.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 1492582 - Use XUL inspector highlighter for HTML docs without scroll frames. r=bgrins The devtools highlighter is broken with browser.xhtml when scroll frames are disabled. Differential Revision: https://phabricator.services.mozilla.com/D52104
devtools/server/actors/highlighters/utils/markup.js
--- a/devtools/server/actors/highlighters/utils/markup.js
+++ b/devtools/server/actors/highlighters/utils/markup.js
@@ -97,17 +97,24 @@ ClassList.prototype = {
 };
 
 /**
  * Is this content window a XUL window?
  * @param {Window} window
  * @return {Boolean}
  */
 function isXUL(window) {
-  return window.document.documentElement.namespaceURI === XUL_NS;
+  // XXX: We temporarily return true for HTML documents if the document disables
+  // scroll frames since the regular highlighter is broken in this case. This
+  // should be removed when bug 1594587 is fixed.
+  return (
+    window.document.documentElement.namespaceURI === XUL_NS ||
+    (window.isChromeWindow &&
+      window.document.documentElement.getAttribute("scrolling") === "false")
+  );
 }
 exports.isXUL = isXUL;
 
 /**
  * Returns true if a DOM node is "valid", where "valid" means that the node isn't a dead
  * object wrapper, is still attached to a document, and is of a given type.
  * @param {DOMNode} node
  * @param {Number} nodeType Optional, defaults to ELEMENT_NODE