Bug 986730 - Put all anonymous content into the XBL scope. r=smaug

This commit is contained in:
Bobby Holley 2014-04-06 12:32:39 -07:00
parent a9af8f39e2
commit 5c2ac5c86b
2 changed files with 6 additions and 6 deletions

View File

@ -414,7 +414,9 @@ protected:
//
mozilla::dom::ParentObject GetParentObjectInternal(nsINode* aNativeParent) const {
mozilla::dom::ParentObject p(aNativeParent);
p.mUseXBLScope = ChromeOnlyAccess();
// Note that mUseXBLScope is a no-op for chrome, and other places where we
// don't use XBL scopes.
p.mUseXBLScope = IsInAnonymousSubtree();
return p;
}

View File

@ -22,11 +22,10 @@
onTestEvent = function(target) {
ok(true, 'called event handler');
// First, dispatch an event to the anonymous content. The event
// handlers on the AC should run, but they won't until bug 948000
// is fixed. So the check here is a todo().
// Try calling event handlers on anonymous content.
var e = new MouseEvent('click');
document.getAnonymousNodes(target)[1].dispatchEvent(e);
ok(window.calledEventHandlerOnAC, "Should invoke event handler on AC");
// Now, dispatch a key event to test key handlers and move the test along.
var k = document.createEvent('KeyboardEvent');
@ -50,7 +49,6 @@
win = XPCNativeWrapper.unwrap(window);
SpecialPowers = win.SpecialPowers;
ok = win.ok = SpecialPowers.wrap(window.parent).ok;
todo = win.todo = SpecialPowers.wrap(window.parent).todo;
is = win.is = SpecialPowers.wrap(window.parent).is;
info = win.info = SpecialPowers.wrap(window.parent).info;
@ -73,6 +71,6 @@
<handler event="testEvent" action="onTestEvent(this)" allowuntrusted="true"/>
<handler event="keyup" action="ok(true, 'called key handler'); doFinish();" allowuntrusted="true"/>
</handlers>
<content>Anonymous Content<html:div onclick="todo(true, 'called event handler on ac, this needs bug 948000');"></html:div><html:b style="display:none"><children/></html:b></content>
<content>Anonymous Content<html:div onclick="window.calledEventHandlerOnAC = true;"></html:div><html:b style="display:none"><children/></html:b></content>
</binding>
</bindings>