Bug 1415352: Part 1a - Pass subject principal through to ParseAttribute. r=bz

This is necessary in order to parse style attributes using the subject
principal of the caller, rather than defaulting to the page principal.

MozReview-Commit-ID: GIshajQ28la
This commit is contained in:
Kris Maglione
2017-11-01 20:35:52 -07:00
parent 6e1ea609ed
commit 48e53b3df5
104 changed files with 210 additions and 68 deletions

View File

@@ -70,8 +70,11 @@ HTMLOutputElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
}
bool
HTMLOutputElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
const nsAString& aValue, nsAttrValue& aResult)
HTMLOutputElement::ParseAttribute(int32_t aNamespaceID,
nsAtom* aAttribute,
const nsAString& aValue,
nsIPrincipal* aMaybeScriptedPrincipal,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::_for) {
@@ -81,7 +84,9 @@ HTMLOutputElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
}
return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute,
aValue, aResult);
aValue,
aMaybeScriptedPrincipal,
aResult);
}
void