Bug 775346 - Make sure DOM events match current document. r=mbrubeck

--HG--
extra : rebase_source : 7d482561fd601501323ce494659e6e7f8d30eb92
This commit is contained in:
Brian Nicholson 2012-07-25 15:35:37 -07:00
parent 8286463b20
commit 540b00b964

View File

@ -2587,8 +2587,8 @@ Tab.prototype = {
case "DOMContentLoaded": {
let target = aEvent.originalTarget;
// ignore on frames
if (target.defaultView != this.browser.contentWindow)
// ignore on frames and other documents
if (target != this.browser.contentDocument)
return;
// Sample the background color of the page and pass it along. (This is used to draw the
@ -2633,8 +2633,8 @@ Tab.prototype = {
if (!target.href || target.disabled)
return;
// ignore on frames
if (target.ownerDocument.defaultView != this.browser.contentWindow)
// ignore on frames and other documents
if (target.ownerDocument != this.browser.contentDocument)
return;
// sanitize the rel string
@ -2687,8 +2687,8 @@ Tab.prototype = {
if (!aEvent.isTrusted)
return;
// ignore on frames
if (aEvent.target.defaultView != this.browser.contentWindow)
// ignore on frames and other documents
if (aEvent.originalTarget != this.browser.contentDocument)
return;
sendMessageToJava({