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

Unified Diff: third_party/WebKit/Source/core/html/HTMLAnchorElement.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/HTMLAnchorElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
index cef5930786dbd65f28a6ce07e20a674c5a654400..790628cb60d15a2d56a1d2318cc1564535388722 100644
--- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
@@ -251,33 +251,30 @@ void HTMLAnchorElement::setActive(bool down) {
ContainerNode::setActive(down);
}
-void HTMLAnchorElement::attributeChanged(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& newValue,
- AttributeModificationReason reason) {
- HTMLElement::attributeChanged(name, oldValue, newValue, reason);
- if (reason != AttributeModificationReason::kDirectly)
+void HTMLAnchorElement::attributeChanged(
+ const AttributeModificationParams& params) {
+ HTMLElement::attributeChanged(params);
+ if (params.reason != AttributeModificationReason::kDirectly)
return;
- if (name != hrefAttr && isLink())
+ if (params.name != hrefAttr && isLink())
return;
if (adjustedFocusedElementInTreeScope() != this)
return;
blur();
}
-void HTMLAnchorElement::parseAttribute(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& value) {
- if (name == hrefAttr) {
+void HTMLAnchorElement::parseAttribute(
+ const AttributeModificationParams& params) {
+ if (params.name == hrefAttr) {
bool wasLink = isLink();
- setIsLink(!value.isNull());
+ setIsLink(!params.newValue.isNull());
if (wasLink || isLink()) {
pseudoStateChanged(CSSSelector::PseudoLink);
pseudoStateChanged(CSSSelector::PseudoVisited);
pseudoStateChanged(CSSSelector::PseudoAnyLink);
}
if (isLink()) {
- String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
+ String parsedURL = stripLeadingAndTrailingHTMLSpaces(params.newValue);
if (document().isDNSPrefetchEnabled()) {
if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "https") ||
parsedURL.startsWith("//"))
@@ -285,14 +282,13 @@ void HTMLAnchorElement::parseAttribute(const QualifiedName& name,
}
}
invalidateCachedVisitedLinkHash();
- logUpdateAttributeIfIsolatedWorldAndInDocument("a", hrefAttr, oldValue,
- value);
- } else if (name == nameAttr || name == titleAttr) {
+ logUpdateAttributeIfIsolatedWorldAndInDocument("a", params);
+ } else if (params.name == nameAttr || params.name == titleAttr) {
// Do nothing.
- } else if (name == relAttr) {
- setRel(value);
+ } else if (params.name == relAttr) {
+ setRel(params.newValue);
} else {
- HTMLElement::parseAttribute(name, oldValue, value);
+ HTMLElement::parseAttribute(params);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLAnchorElement.h ('k') | third_party/WebKit/Source/core/html/HTMLAreaElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698