| Index: third_party/WebKit/Source/core/dom/Element.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
|
| index a2390f6390500a66411bcdf3d0d29807dc3f0715..4a1b2838b6bfc4688e2acdf84f863f6d0cc4ad7f 100644
|
| --- a/third_party/WebKit/Source/core/dom/Element.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp
|
| @@ -430,6 +430,14 @@ bool Element::ShouldIgnoreAttributeCase() const {
|
| return IsHTMLElement() && GetDocument().IsHTMLDocument();
|
| }
|
|
|
| +const AtomicString& Element::nonce() const {
|
| + return HasRareData() ? GetElementRareData()->GetNonce() : g_empty_atom;
|
| +}
|
| +
|
| +void Element::setNonce(const AtomicString& nonce) {
|
| + EnsureElementRareData().SetNonce(nonce);
|
| +}
|
| +
|
| void Element::scrollIntoView(bool align_to_top) {
|
| GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
|
|
| @@ -1657,6 +1665,12 @@ Node::InsertionNotificationRequest Element::InsertedInto(
|
| if (parentElement() && parentElement()->IsInCanvasSubtree())
|
| SetIsInCanvasSubtree(true);
|
|
|
| + if (hasAttribute(nonceAttr) && getAttribute(nonceAttr) != g_empty_atom) {
|
| + setNonce(getAttribute(nonceAttr));
|
| + if (RuntimeEnabledFeatures::hideNonceContentAttributeEnabled())
|
| + setAttribute(nonceAttr, g_empty_atom);
|
| + }
|
| +
|
| return kInsertionDone;
|
| }
|
|
|
| @@ -3999,6 +4013,9 @@ void Element::CloneAttributesFromElement(const Element& other) {
|
| AttributeChangedFromParserOrByCloning(
|
| attr.GetName(), attr.Value(), AttributeModificationReason::kByCloning);
|
| }
|
| +
|
| + if (other.nonce() != g_null_atom)
|
| + setNonce(other.nonce());
|
| }
|
|
|
| void Element::CloneDataFromElement(const Element& other) {
|
|
|