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

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

Issue 476223003: Use tighter typing for Document::ownerElement() return value (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXNodeObject.cpp
diff --git a/Source/core/accessibility/AXNodeObject.cpp b/Source/core/accessibility/AXNodeObject.cpp
index 932711060a11db06ce160fa875015e169d91e8f5..b4ee0532311e7b0c1f1f13cb9b6294bf735d84da 100644
--- a/Source/core/accessibility/AXNodeObject.cpp
+++ b/Source/core/accessibility/AXNodeObject.cpp
@@ -1637,25 +1637,21 @@ String AXNodeObject::alternativeTextForWebArea() const
return ariaLabel;
}
- Node* owner = document->ownerElement();
- if (owner) {
+ if (HTMLFrameOwnerElement* owner = document->ownerElement()) {
if (isHTMLFrameElementBase(*owner)) {
- const AtomicString& title = toElement(owner)->getAttribute(titleAttr);
+ const AtomicString& title = owner->getAttribute(titleAttr);
if (!title.isEmpty())
return title;
- return toElement(owner)->getNameAttribute();
}
- if (owner->isHTMLElement())
- return toHTMLElement(owner)->getNameAttribute();
+ return owner->getNameAttribute();
}
String documentTitle = document->title();
if (!documentTitle.isEmpty())
return documentTitle;
- owner = document->body();
- if (owner && owner->isHTMLElement())
- return toHTMLElement(owner)->getNameAttribute();
+ if (HTMLElement* body = document->body())
+ return body->getNameAttribute();
return String();
}
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698