зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset e9d838084096 (bug 1181555
) for Linux x64 opt and B2G Desktop Linux x64 opt Hazard analysis fail. r=backout
This commit is contained in:
Родитель
8a7ee4c7f1
Коммит
1ecd8dc0b9
|
@ -579,12 +579,6 @@ this.PermissionsTable = { geolocation: {
|
|||
privileged: DENY_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
},
|
||||
"moz-extremely-unstable-and-will-change-webcomponents": {
|
||||
app: DENY_ACTION,
|
||||
trusted: DENY_ACTION,
|
||||
privileged: ALLOW_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -92,7 +92,6 @@
|
|||
#include "nsIAuthPrompt2.h"
|
||||
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsIPrincipal.h"
|
||||
|
||||
#include "nsIDOMWindow.h"
|
||||
|
@ -5832,31 +5831,9 @@ nsDocument::CustomElementConstructor(JSContext* aCx, unsigned aArgc, JS::Value*
|
|||
bool
|
||||
nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject)
|
||||
{
|
||||
if (Preferences::GetBool("dom.webcomponents.enabled")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for the webcomponents permission. See Bug 1181555.
|
||||
JSAutoCompartment ac(aCx, aObject);
|
||||
JS::Rooted<JSObject*> global(aCx, JS_GetGlobalForObject(aCx, aObject));
|
||||
nsCOMPtr<nsPIDOMWindow> window =
|
||||
do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(global));
|
||||
|
||||
if (window) {
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPermissionManager> permMgr =
|
||||
do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
uint32_t perm;
|
||||
rv = permMgr->TestPermissionFromWindow(
|
||||
window, "moz-extremely-unstable-and-will-change-webcomponents", &perm);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
return perm == nsIPermissionManager::ALLOW_ACTION;
|
||||
}
|
||||
|
||||
return false;
|
||||
JS::Rooted<JSObject*> obj(aCx, aObject);
|
||||
return Preferences::GetBool("dom.webcomponents.enabled") ||
|
||||
IsInCertifiedApp(aCx, obj);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче