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

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

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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: Source/core/accessibility/AccessibilityRenderObject.cpp
diff --git a/Source/core/accessibility/AccessibilityRenderObject.cpp b/Source/core/accessibility/AccessibilityRenderObject.cpp
index f604032cd1fa4c5b05b7da55878a491bc130c9e4..e70aaf1d761db15dbcc9634d52eac35e69b0e0db 100644
--- a/Source/core/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/core/accessibility/AccessibilityRenderObject.cpp
@@ -227,11 +227,11 @@ LayoutRect AccessibilityRenderObject::elementRect() const
for (const AccessibilityObject* obj = this; obj; obj = obj->parentObject()) {
if (obj->isAccessibilityRenderObject())
- static_cast<const AccessibilityRenderObject*>(obj)->checkCachedElementRect();
+ toAccessibilityRenderObject(obj)->checkCachedElementRect();
}
for (const AccessibilityObject* obj = this; obj; obj = obj->parentObject()) {
if (obj->isAccessibilityRenderObject())
- static_cast<const AccessibilityRenderObject*>(obj)->updateCachedElementRect();
+ toAccessibilityRenderObject(obj)->updateCachedElementRect();
}
return m_cachedElementRect;
@@ -1157,7 +1157,7 @@ String AccessibilityRenderObject::textUnderElement() const
// CSS content is used to insert text or when a RenderCounter is used.)
RenderText* renderTextObject = toRenderText(m_renderer);
if (renderTextObject->isTextFragment())
- return String(static_cast<RenderTextFragment*>(m_renderer)->contentString());
+ return String(toRenderTextFragment(m_renderer)->contentString());
else
return String(renderTextObject->text());
}
@@ -1324,7 +1324,7 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityHitTest(const IntPo
if (result && result->accessibilityIsIgnored()) {
// If this element is the label of a control, a hit test should return the control.
if (result->isAccessibilityRenderObject()) {
- AccessibilityObject* controlObject = static_cast<AccessibilityRenderObject*>(result)->correspondingControlForLabelElement();
+ AccessibilityObject* controlObject = toAccessibilityRenderObject(result)->correspondingControlForLabelElement();
if (controlObject && !controlObject->exposesTitleUIElement())
return controlObject;
}
@@ -1694,7 +1694,7 @@ void AccessibilityRenderObject::handleActiveDescendantChanged()
Document& doc = renderer()->document();
if (!doc.frame()->selection().isFocusedAndActive() || doc.focusedElement() != element)
return;
- AccessibilityRenderObject* activedescendant = static_cast<AccessibilityRenderObject*>(activeDescendant());
+ AccessibilityRenderObject* activedescendant = toAccessibilityRenderObject(activeDescendant());
if (activedescendant && shouldNotifyActiveDescendant())
doc.axObjectCache()->postNotification(m_renderer, AXObjectCache::AXActiveDescendantChanged, true);
@@ -2197,7 +2197,7 @@ void AccessibilityRenderObject::addTextFieldChildren()
if (!spinButtonElement || !spinButtonElement->isSpinButtonElement())
return;
- AccessibilitySpinButton* axSpinButton = static_cast<AccessibilitySpinButton*>(axObjectCache()->getOrCreate(SpinButtonRole));
+ AccessibilitySpinButton* axSpinButton = toAccessibilitySpinButton(axObjectCache()->getOrCreate(SpinButtonRole));
axSpinButton->setSpinButtonElement(toSpinButtonElement(spinButtonElement));
axSpinButton->setParent(this);
m_children.append(axSpinButton);
@@ -2326,7 +2326,7 @@ bool AccessibilityRenderObject::inheritsPresentationalRole() const
if (!parent->isAccessibilityRenderObject())
return false;
- Node* elementNode = static_cast<AccessibilityRenderObject*>(parent)->node();
+ Node* elementNode = toAccessibilityRenderObject(parent)->node();
if (!elementNode || !elementNode->isElementNode())
return false;
« no previous file with comments | « Source/core/accessibility/AccessibilityMenuList.cpp ('k') | Source/core/accessibility/AccessibilityTableHeaderContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698