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: Created June 20, 2017, 2:39 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
@@ -139,19 +139,25 @@
propertyValue = "hidden";
}
if (el.style.getPropertyValue(propertyName) != propertyValue ||
el.style.getPropertyPriority(propertyName) != "important")
el.style.setProperty(propertyName, propertyValue, "important");
}
+ function processMutations(mutations)
+ {
+ for (let mutation of mutations)
+ doHide(mutation.target);
+ }
+
doHide(element);
- new MutationObserver(doHide).observe(
+ new MutationObserver(processMutations).observe(
element, {
attributes: true,
attributeFilter: ["style"]
}
);
}
function checkCollapse(element)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld