Title: [151990] trunk/Source/WebCore
Revision
151990
Author
rn...@webkit.org
Date
2013-06-26 08:38:58 -0700 (Wed, 26 Jun 2013)

Log Message

Remove many static_casts to Element types from AccessibilityNodeObject
https://bugs.webkit.org/show_bug.cgi?id=118021

Reviewed by Chris Fleizach.

Merge https://chromium.googlesource.com/chromium/blink/+/ecd837f94996a20fdb8798e24f26cf6edea2a423.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isReadOnly):
(WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
(WebCore::AccessibilityNodeObject::text):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (151989 => 151990)


--- trunk/Source/WebCore/ChangeLog	2013-06-26 15:18:41 UTC (rev 151989)
+++ trunk/Source/WebCore/ChangeLog	2013-06-26 15:38:58 UTC (rev 151990)
@@ -1,3 +1,17 @@
+2013-06-26  Ryosuke Niwa  <rn...@webkit.org>
+
+        Remove many static_casts to Element types from AccessibilityNodeObject
+        https://bugs.webkit.org/show_bug.cgi?id=118021
+
+        Reviewed by Chris Fleizach.
+
+        Merge https://chromium.googlesource.com/chromium/blink/+/ecd837f94996a20fdb8798e24f26cf6edea2a423.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::isReadOnly):
+        (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
+        (WebCore::AccessibilityNodeObject::text):
+
 2013-06-26  Christophe Dumez  <ch.du...@sisa.samsung.com>
 
         Stop inheriting SVGExternalResourcesRequired, SVGFitToViewBox and SVGZoomAndPan

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (151989 => 151990)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-06-26 15:18:41 UTC (rev 151989)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-06-26 15:38:58 UTC (rev 151990)
@@ -695,7 +695,7 @@
         return true;
 
     if (node->hasTagName(textareaTag))
-        return static_cast<HTMLTextAreaElement*>(node)->isReadOnly();
+        return toHTMLFormControlElement(node)->isReadOnly();
 
     if (node->hasTagName(inputTag)) {
         HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
@@ -1374,10 +1374,10 @@
     Node* owner = document->ownerElement();
     if (owner) {
         if (owner->hasTagName(frameTag) || owner->hasTagName(iframeTag)) {
-            const AtomicString& title = static_cast<HTMLFrameElementBase*>(owner)->getAttribute(titleAttr);
+            const AtomicString& title = toElement(owner)->getAttribute(titleAttr);
             if (!title.isEmpty())
                 return title;
-            return static_cast<HTMLFrameElementBase*>(owner)->getNameAttribute();
+            return toElement(owner)->getNameAttribute();
         }
         if (owner->isHTMLElement())
             return toHTMLElement(owner)->getNameAttribute();
@@ -1643,12 +1643,8 @@
     if (!node)
         return String();
 
-    if (isNativeTextControl()) {
-        if (node->hasTagName(textareaTag))
-            return static_cast<HTMLTextAreaElement*>(node)->value();
-        if (node->hasTagName(inputTag))
-            return node->toInputElement()->value();
-    }
+    if (isNativeTextControl() && (node->hasTagName(textareaTag) || node->hasTagName(inputTag)))
+        return toHTMLTextFormControlElement(node)->value();
 
     if (!node->isElementNode())
         return String();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to