Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index f6115d2dcd08747a10e4163e65bbc7ddf896dc80..f08e63e1b00be59083f3051fba30d7db24fdc307 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -248,27 +248,28 @@ void HTMLImageElement::setBestFitURLAndDPRFromImageCandidate(
}
}
-void HTMLImageElement::parseAttribute(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& value) {
+void HTMLImageElement::parseAttribute(
+ const AttributeModificationParams& params) {
+ const QualifiedName& name = params.name;
if (name == altAttr || name == titleAttr) {
if (userAgentShadowRoot()) {
Element* text = userAgentShadowRoot()->getElementById("alttext");
String value = altText();
- if (text && text->textContent() != value)
+ if (text && text->textContent() != params.newValue)
text->setTextContent(altText());
}
} else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) {
selectSourceURL(ImageLoader::UpdateIgnorePreviousError);
} else if (name == usemapAttr) {
- setIsLink(!value.isNull());
+ setIsLink(!params.newValue.isNull());
} else if (name == referrerpolicyAttr) {
m_referrerPolicy = ReferrerPolicyDefault;
- if (!value.isNull())
+ if (!params.newValue.isNull()) {
SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords(
- value, &m_referrerPolicy);
+ params.newValue, &m_referrerPolicy);
+ }
} else {
- HTMLElement::parseAttribute(name, oldValue, value);
+ HTMLElement::parseAttribute(params);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageElement.h ('k') | third_party/WebKit/Source/core/html/HTMLInputElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698