Bug 1034682 - Set wantXrays to false for content XBL scopes. r=billm

This commit is contained in:
Bobby Holley 2014-07-11 15:56:27 -07:00
parent 28f31fb0c4
commit c14d9c63b1
2 changed files with 12 additions and 1 deletions

View File

@ -213,8 +213,16 @@ XPCWrappedNativeScope::EnsureContentXBLScope(JSContext *cx)
// Set up the sandbox options. Note that we use the DOM global as the
// sandboxPrototype so that the XBL scope can access all the DOM objects
// it's accustomed to accessing.
//
// In general wantXrays shouldn't matter much here, but there are weird
// cases when adopting bound content between same-origin globals where a
// <destructor> in one content XBL scope sees anonymous content in another
// content XBL scope. When that happens, we hit LookupBindingMember for an
// anonymous element that lives in a content XBL scope, which isn't a tested
// or audited codepath. So let's avoid hitting that case by opting out of
// same-origin Xrays.
SandboxOptions options;
options.wantXrays = true;
options.wantXrays = false;
options.wantComponents = true;
options.proto = global;
options.sameZoneAs = global;

View File

@ -171,6 +171,9 @@
<destructor>
<![CDATA[
// Touch a non-existent property on our anonymous input field. This
// serves as test coverage for bug 1034682.
this.inputField.foo;
if (this.inputField.value)
this.boxObject.setProperty('value', this.inputField.value);
this.mInputField = null;