Skip to content
This repository has been archived by the owner on Oct 11, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:gorhill/uBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 2, 2017
2 parents 0c80411 + a121f22 commit 40c6947
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/js/scriptlets/dom-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,17 @@ var elementsFromSpecialSelector = function(selector) {

/******************************************************************************/

var getSvgRootChildren = function() {
if ( svgRoot.children ) {
return svgRoot.children;
} else {
var childNodes = Array.prototype.slice.apply(svgRoot.childNodes);
return childNodes.filter(function(node) {
return node.nodeType === Node.ELEMENT_NODE;
});
}
};

var highlightElements = function(scrollTo) {
var wv = pickerRoot.contentWindow.innerWidth;
var hv = pickerRoot.contentWindow.innerHeight;
Expand All @@ -818,6 +829,7 @@ var highlightElements = function(scrollTo) {
var xl, xr, yt, yb, w, h, ws;
var xlu = Number.MAX_VALUE, xru = 0, ytu = Number.MAX_VALUE, ybu = 0;
var lists = highlightedElementLists;
var svgRootChildren = getSvgRootChildren();

for ( var i = 0; i < lists.length; i++ ) {
elems = lists[i];
Expand Down Expand Up @@ -857,7 +869,7 @@ var highlightElements = function(scrollTo) {
if ( yt < ytu ) { ytu = yt; }
if ( yb > ybu ) { ybu = yb; }
}
svgRoot.children[i+1].setAttribute('d', islands.join('') || 'M0 0');
svgRootChildren[i+1].setAttribute('d', islands.join('') || 'M0 0');
}

svgRoot.firstElementChild.setAttribute('d', ocean.join(''));
Expand Down

0 comments on commit 40c6947

Please sign in to comment.