Bug 1406278: Part 1 - Pass subject principal to SetAttribute and friends. r=bz
In order to tailor certain security checks to the caller that is attempting to load a particular piece of content, we need to be able to attach an appropriate triggering principal to the corresponding requests. Since most HTML content is loaded based on attribute values, that means capturing the subject principal of the caller who sets those attributes, which means making it available to AfterSetAttr hooks. MozReview-Commit-ID: BMDL2Uepg0X
This commit is contained in:
@@ -1316,7 +1316,9 @@ HTMLSelectElement::BeforeSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
nsresult
|
||||
HTMLSelectElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
const nsAttrValue* aValue,
|
||||
const nsAttrValue* aOldValue, bool aNotify)
|
||||
const nsAttrValue* aOldValue,
|
||||
nsIPrincipal* aSubjectPrincipal,
|
||||
bool aNotify)
|
||||
{
|
||||
if (aNameSpaceID == kNameSpaceID_None) {
|
||||
if (aName == nsGkAtoms::disabled) {
|
||||
@@ -1349,6 +1351,7 @@ HTMLSelectElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
|
||||
return nsGenericHTMLFormElementWithState::AfterSetAttr(aNameSpaceID, aName,
|
||||
aValue, aOldValue,
|
||||
aSubjectPrincipal,
|
||||
aNotify);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user