Bug 1947732 - Provide nsIPrincipal to GetTrustedTypesCompliantString. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D246424
This commit is contained in:
@@ -4327,7 +4327,7 @@ void Element::SetInnerHTML(const TrustedHTMLOrNullIsEmptyString& aInnerHTML,
|
||||
const nsAString* compliantString =
|
||||
TrustedTypeUtils::GetTrustedTypesCompliantString(
|
||||
aInnerHTML, sink, kTrustedTypesOnlySinkGroup, *this,
|
||||
compliantStringHolder, aError);
|
||||
aSubjectPrincipal, compliantStringHolder, aError);
|
||||
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
@@ -4347,6 +4347,7 @@ void Element::GetOuterHTML(OwningTrustedHTMLOrNullIsEmptyString& aOuterHTML) {
|
||||
}
|
||||
|
||||
void Element::SetOuterHTML(const TrustedHTMLOrNullIsEmptyString& aOuterHTML,
|
||||
nsIPrincipal* aSubjectPrincipal,
|
||||
ErrorResult& aError) {
|
||||
constexpr nsLiteralString sink = u"Element outerHTML"_ns;
|
||||
|
||||
@@ -4354,7 +4355,7 @@ void Element::SetOuterHTML(const TrustedHTMLOrNullIsEmptyString& aOuterHTML,
|
||||
const nsAString* compliantString =
|
||||
TrustedTypeUtils::GetTrustedTypesCompliantString(
|
||||
aOuterHTML, sink, kTrustedTypesOnlySinkGroup, *this,
|
||||
compliantStringHolder, aError);
|
||||
aSubjectPrincipal, compliantStringHolder, aError);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
@@ -4416,14 +4417,14 @@ enum nsAdjacentPosition { eBeforeBegin, eAfterBegin, eBeforeEnd, eAfterEnd };
|
||||
|
||||
void Element::InsertAdjacentHTML(
|
||||
const nsAString& aPosition, const TrustedHTMLOrString& aTrustedHTMLOrString,
|
||||
ErrorResult& aError) {
|
||||
nsIPrincipal* aSubjectPrincipal, ErrorResult& aError) {
|
||||
constexpr nsLiteralString kSink = u"Element insertAdjacentHTML"_ns;
|
||||
|
||||
Maybe<nsAutoString> compliantStringHolder;
|
||||
const nsAString* compliantString =
|
||||
TrustedTypeUtils::GetTrustedTypesCompliantString(
|
||||
aTrustedHTMLOrString, kSink, kTrustedTypesOnlySinkGroup, *this,
|
||||
compliantStringHolder, aError);
|
||||
aSubjectPrincipal, compliantStringHolder, aError);
|
||||
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
@@ -5485,9 +5486,10 @@ EditorBase* Element::GetExtantEditor() const {
|
||||
}
|
||||
|
||||
void Element::SetHTMLUnsafe(const TrustedHTMLOrString& aHTML,
|
||||
nsIPrincipal* aSubjectPrincipal,
|
||||
ErrorResult& aError) {
|
||||
nsContentUtils::SetHTMLUnsafe(this, this, aHTML, false /*aIsShadowRoot*/,
|
||||
aError);
|
||||
aSubjectPrincipal, aError);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/#event-beforematch
|
||||
|
||||
Reference in New Issue
Block a user