mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 22:08:40 +09:00
Issue #2736 - Part 4: Re-work img <src> attribute.
Use subject principal as triggering principal in <img> "src" attribute. Also get rid of the `BeforeMaybeChangeAttr`/`AfterMaybeChangeAttr` dance: It makes more logical sense for these effects to happen _after_ the attribute has actually been changed.
This commit is contained in:
parent
166b25a42c
commit
c8db9efb3c
9 changed files with 168 additions and 71 deletions
|
|
@ -734,7 +734,8 @@ nsresult
|
|||
nsImageLoadingContent::LoadImage(const nsAString& aNewURI,
|
||||
bool aForce,
|
||||
bool aNotify,
|
||||
ImageLoadType aImageLoadType)
|
||||
ImageLoadType aImageLoadType,
|
||||
nsIPrincipal* aTriggeringPrincipal)
|
||||
{
|
||||
// First, get a document (needed for security checks and the like)
|
||||
nsIDocument* doc = GetOurOwnerDoc();
|
||||
|
|
@ -768,7 +769,8 @@ nsImageLoadingContent::LoadImage(const nsAString& aNewURI,
|
|||
|
||||
NS_TryToSetImmutable(imageURI);
|
||||
|
||||
return LoadImage(imageURI, aForce, aNotify, aImageLoadType, false, doc);
|
||||
return LoadImage(imageURI, aForce, aNotify, aImageLoadType, false, doc,
|
||||
nsIRequest::LOAD_NORMAL, aTriggeringPrincipal);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
@ -778,7 +780,8 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
|||
ImageLoadType aImageLoadType,
|
||||
bool aLoadStart,
|
||||
nsIDocument* aDocument,
|
||||
nsLoadFlags aLoadFlags)
|
||||
nsLoadFlags aLoadFlags,
|
||||
nsIPrincipal* aTriggeringPrincipal)
|
||||
{
|
||||
MOZ_ASSERT(!mIsStartingImageLoad, "some evil code is reentering LoadImage.");
|
||||
if (mIsStartingImageLoad) {
|
||||
|
|
@ -886,7 +889,7 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
|||
nsresult rv = nsContentUtils::LoadImage(aNewURI,
|
||||
thisNode,
|
||||
aDocument,
|
||||
aDocument->NodePrincipal(),
|
||||
aTriggeringPrincipal ? aTriggeringPrincipal : aDocument->NodePrincipal(),
|
||||
aDocument->GetDocumentURI(),
|
||||
referrerPolicy,
|
||||
this, loadFlags,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue