Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.preload.js

Issue 29469562: Issue 5094 - The MutationObserver callback was wrong (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Better fix Created June 20, 2017, 3:56 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -124,32 +124,32 @@
urls.splice(i--, 1);
}
return urls;
}
function hideElement(element)
{
- function doHide(el)
+ function doHide()
{
let propertyName = "display";
let propertyValue = "none";
- if (el.localName == "frame")
+ if (element.localName == "frame")
{
propertyName = "visibility";
propertyValue = "hidden";
}
- if (el.style.getPropertyValue(propertyName) != propertyValue ||
- el.style.getPropertyPriority(propertyName) != "important")
- el.style.setProperty(propertyName, propertyValue, "important");
+ if (element.style.getPropertyValue(propertyName) != propertyValue ||
+ element.style.getPropertyPriority(propertyName) != "important")
+ element.style.setProperty(propertyName, propertyValue, "important");
}
- doHide(element);
+ doHide();
new MutationObserver(doHide).observe(
element, {
attributes: true,
attributeFilter: ["style"]
}
);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld