mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-29 03:44:37 +00:00
Bug 333922 - Setting designMode doesn't work with enhanced privileges on a frame with a different domain, r+sr=bzbarsky
This commit is contained in:
parent
46799013e7
commit
0a6dcb125d
@ -3673,13 +3673,16 @@ nsHTMLDocument::SetDesignMode(const nsAString & aDesignMode)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIPrincipal> subject;
|
||||
nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager();
|
||||
rv = secMan->GetSubjectPrincipal(getter_AddRefs(subject));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (subject) {
|
||||
rv = secMan->CheckSameOriginPrincipal(subject, NodePrincipal());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!nsContentUtils::IsCallerTrustedForWrite()) {
|
||||
nsCOMPtr<nsIPrincipal> subject;
|
||||
nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager();
|
||||
rv = secMan->GetSubjectPrincipal(getter_AddRefs(subject));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (subject) {
|
||||
rv = secMan->CheckSameOriginPrincipal(subject, NodePrincipal());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIEditingSession> editSession = do_GetInterface(docshell);
|
||||
|
Loading…
Reference in New Issue
Block a user