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

Unified Diff: safari/ext/content.js

Issue 5641434644348928: Fixed element collapsing in Safari (Closed)
Patch Set: Addressed comments Created Jan. 16, 2014, 1:20 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: safari/ext/content.js
===================================================================
--- a/safari/ext/content.js
+++ b/safari/ext/content.js
@@ -318,7 +318,16 @@
isTopLevel: window == window.top
}
}))
+ {
event.preventDefault();
+
+ // Safari doesn't dispatch an "error" event when preventing an element
+ // from loading by cancelling the "beforeload" event. So we have to
+ // dispatch it manually. Otherwise element collapsing wouldn't work.
+ var evt = document.createEvent("Event");
+ evt.initEvent(type == "sub_frame" ? "load" : "error");
+ event.target.dispatchEvent(evt);
+ }
}, true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld