Index: include.preload.js |
=================================================================== |
--- a/include.preload.js |
+++ b/include.preload.js |
@@ -47,11 +47,22 @@ |
{ |
if (response && element.parentNode) |
{ |
+ var property = "display"; |
+ var value = "none"; |
+ |
// <frame> cannot be removed, doing that will mess up the frameset |
if (tag == "frame") |
- element.style.setProperty("visibility", "hidden", "important"); |
- else |
- element.style.setProperty("display", "none", "important"); |
+ { |
+ property = "visibility"; |
+ value = "hidden"; |
+ } |
+ |
+ // <input type="image"> elements try to load their image again |
+ // when the "display" CSS property is set. So we have to check |
+ // that it isn't already collapsed to avoid an infinite recursion. |
+ if (element.style.getPropertyValue(property) != value || |
+ element.style.getPropertyPriority(property) != "important") |
+ element.style.setProperty(property, value, "important"); |
} |
} |
); |