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: Created July 29, 2016, 9:06 a.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 949d039663f9130843b4d8d0a3ddfcb434522066..c88f73f796c9ee8b27eaa30d54046471a134e0b6 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 ||
Sebastian Noack 2016/08/10 12:55:57 Nit: AS per Mozilla's coding practices we perfer !
kzar 2016/08/11 13:53:30 Done.
+ element.style.getPropertyPriority(propertyName) !== "important")
+ element.style.setProperty(propertyName, propertyValue, "important");
}
if (collapse && !element._collapsed)
Sebastian Noack 2016/08/10 12:55:57 With your changes to collapseElement(), the _colla
kzar 2016/08/11 13:53:30 Done.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld