Backed out changeset f786dcb23eca (bug 1092156)

This commit is contained in:
Carsten "Tomcat" Book 2014-11-07 16:34:22 +01:00
parent 5b6c60725b
commit 45d236bfbb
2 changed files with 2 additions and 12 deletions

View File

@ -2266,12 +2266,7 @@ CreateNativeGlobalForInner(JSContext* aCx,
top = aNewInner->GetTop();
}
JS::CompartmentOptions options;
// Sometimes add-ons load their own XUL windows, either as separate top-level
// windows or inside a browser element. In such cases we want to tag the
// window's compartment with the add-on ID. See bug 1092156.
options.setAddonId(MapURIToAddonID(aURI));
if (top) {
if (top->GetGlobalJSObject()) {
options.setSameZoneAs(top->GetGlobalJSObject());

View File

@ -346,13 +346,8 @@ XPCWrappedNativeScope::EnsureAddonScope(JSContext *cx, JSAddonId *addonId)
MOZ_ASSERT(addonId);
MOZ_ASSERT(nsContentUtils::IsSystemPrincipal(GetPrincipal()));
// In bug 1092156, we found that add-on scopes don't work correctly when the
// window navigates. The add-on global's prototype is an outer window, so,
// after the navigation, looking up window properties in the add-on scope
// will fail. However, in most cases where the window can be navigated, the
// entire window is part of the add-on. To solve the problem, we avoid
// returning an add-on scope for a window that is already tagged with the
// add-on ID.
// If the global is already part of the add-on then there's no reason to
// create a new one.
if (AddonIdOfObject(global) == addonId)
return global;