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

Unified Diff: Source/core/accessibility/AccessibilityRenderObject.cpp

Issue 18888002: Introduce isHTMLAnchorElement and toHTMLAnchorElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « Source/core/accessibility/AccessibilityNodeObject.cpp ('k') | Source/core/css/CSSDefaultStyleSheets.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AccessibilityRenderObject.cpp
diff --git a/Source/core/accessibility/AccessibilityRenderObject.cpp b/Source/core/accessibility/AccessibilityRenderObject.cpp
index 2b8b25120e7ac98ada150d0b93ebfdf9262f1a8d..c9cafe31d37013d403e1c720d828f81fdc4ed5e6 100644
--- a/Source/core/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/core/accessibility/AccessibilityRenderObject.cpp
@@ -511,10 +511,10 @@ bool AccessibilityRenderObject::isLinked() const
return false;
Element* anchor = anchorElement();
- if (!anchor || !anchor->hasTagName(aTag))
+ if (!anchor || !isHTMLAnchorElement(anchor))
return false;
- return !static_cast<HTMLAnchorElement*>(anchor)->href().isEmpty();
+ return !toHTMLAnchorElement(anchor)->href().isEmpty();
}
bool AccessibilityRenderObject::isLoaded() const
@@ -928,8 +928,8 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const
KURL AccessibilityRenderObject::url() const
{
- if (isAnchor() && m_renderer->node()->hasTagName(aTag)) {
- if (HTMLAnchorElement* anchor = static_cast<HTMLAnchorElement*>(anchorElement()))
+ if (isAnchor() && isHTMLAnchorElement(m_renderer->node())) {
+ if (HTMLAnchorElement* anchor = toHTMLAnchorElement(anchorElement()))
return anchor->href();
}
@@ -1664,7 +1664,7 @@ Element* AccessibilityRenderObject::anchorElement() const
// NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElement
Node* node = currRenderer->node();
for ( ; node; node = node->parentNode()) {
- if (node->hasTagName(aTag) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
+ if (isHTMLAnchorElement(node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
return toElement(node);
}
@@ -2083,9 +2083,9 @@ AccessibilityObject* AccessibilityRenderObject::internalLinkElement() const
return 0;
// Right now, we do not support ARIA links as internal link elements
- if (!element->hasTagName(aTag))
+ if (!isHTMLAnchorElement(element))
return 0;
- HTMLAnchorElement* anchor = static_cast<HTMLAnchorElement*>(element);
+ HTMLAnchorElement* anchor = toHTMLAnchorElement(element);
KURL linkURL = anchor->href();
String fragmentIdentifier = linkURL.fragmentIdentifier();
« no previous file with comments | « Source/core/accessibility/AccessibilityNodeObject.cpp ('k') | Source/core/css/CSSDefaultStyleSheets.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698