Bug 1411622 - Check for null nodes when searching for image preview targets in the markupview draft
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 04 Dec 2017 11:09:45 +0100
changeset 706892 d4c72f5bc9713ff34b34be084775d9c0ff8a85c1
parent 706891 e72e065a3595bb4b8138707c27a76868ca2922a1
child 742779 a9e8a27d4dfd2d8384146e02274b5a28ed3b825d
push id91939
push userbmo:pbrosset@mozilla.com
push dateMon, 04 Dec 2017 10:36:55 +0000
bugs1411622
milestone59.0a1
Bug 1411622 - Check for null nodes when searching for image preview targets in the markupview MozReview-Commit-ID: 8dHAEJ7CIoV
devtools/client/inspector/markup/markup.js
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -515,17 +515,17 @@ MarkupView.prototype = {
   _isImagePreviewTarget: Task.async(function* (target) {
     // From the target passed here, let's find the parent MarkupContainer
     // and ask it if the tooltip should be shown
     if (this.isDragging) {
       return false;
     }
 
     let parent = target, container;
-    while (parent !== this.doc.body) {
+    while (parent) {
       if (parent.container) {
         container = parent.container;
         break;
       }
       parent = parent.parentNode;
     }
 
     if (container instanceof MarkupElementContainer) {