Bug 1556135 - only check if the current node is null in getClosestBackgroundImage. r=gl a=jcristau
authorYura Zenevich <yura.zenevich@gmail.com>
Sat, 01 Jun 2019 23:16:01 +0000
changeset 536690 f474ee2548c62464668be3a1aad874dd8dc23c77
parent 536689 55b177d21e76e71efb3dee9f51a38cbbafecaad3
child 536691 d9d324c0221e87da4e0ea032a63a7d7131422ae2
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl, jcristau
bugs1556135
milestone68.0
Bug 1556135 - only check if the current node is null in getClosestBackgroundImage. r=gl a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D33396
devtools/server/actors/inspector/utils.js
--- a/devtools/server/actors/inspector/utils.js
+++ b/devtools/server/actors/inspector/utils.js
@@ -297,17 +297,17 @@ function getClosestBackgroundColor(node)
  *         Node for which we want to find the background image.
  * @return {String}
  *         String with the value of the background iamge property. Defaults to "none" if
  *         no background image is found.
  */
 function getClosestBackgroundImage(node) {
   let current = node;
 
-  while (current.ownerDocument) {
+  while (current) {
     const computedStyle = CssLogic.getComputedStyle(current);
     if (computedStyle) {
       const currentBackgroundImage = computedStyle.getPropertyValue("background-image");
       if (currentBackgroundImage !== "none") {
         return currentBackgroundImage;
       }
     }