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

Unified Diff: include.preload.js

Issue 29348869: Issue 4101 - Prevent runaway MutationObservers (Closed)
Patch Set: Rebased. Created Aug. 11, 2016, 1:49 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
diff --git a/include.preload.js b/include.preload.js
index 02661d39c86ace26fcddea8395726dddf7018df8..5a6146b930f5b862eb8fbc855816198de6af723c 100644
--- a/include.preload.js
+++ b/include.preload.js
@@ -150,10 +150,17 @@ function checkCollapse(element)
{
function collapseElement()
{
+ var propertyName = "display";
+ var propertyValue = "none";
if (element.localName == "frame")
- element.style.setProperty("visibility", "hidden", "important");
- else
- element.style.setProperty("display", "none", "important");
+ {
+ propertyName = "visibility";
+ propertyValue = "hidden";
+ }
+
+ if (element.style.getPropertyValue(propertyName) !== propertyValue ||
+ element.style.getPropertyPriority(propertyName) !== "important")
+ element.style.setProperty(propertyName, propertyValue, "important");
}
if (collapse && !element._collapsed)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld