Issue #2736 - Part 10: Re-work <source> srcset attribute.

Use subject principal as triggering principal in <source> "srcset"
attribute for <picture>.
This commit is contained in:
Moonchild 2025-05-04 14:39:03 +02:00 committed by roytam1
commit faf4f2c23f
4 changed files with 21 additions and 4 deletions

View file

@ -102,6 +102,11 @@ HTMLSourceElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsIPrincipal* aMaybeScriptedPrincipal,
bool aNotify)
{
if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::srcset) {
mSrcsetTriggeringPrincipal = nsContentUtils::GetAttrTriggeringPrincipal(
this, aValue ? aValue->GetStringValue() : EmptyString(),
aMaybeScriptedPrincipal);
}
// If we are associated with a <picture> with a valid <img>, notify it of
// responsive parameter changes
Element *parent = nsINode::GetParentElement();