Title: [159021] trunk/Source/WebCore
Revision
159021
Author
[email protected]
Date
2013-11-10 02:56:32 -0800 (Sun, 10 Nov 2013)

Log Message

Simplify some is-this-a-MathML-element? checks.
<https://webkit.org/b/124119>

As of r158198, the MathML-ness of an Element is determined by
a Node flag, so there's no need to cast to Element before checking
on this. Simplify accordingly.

Reviewed by Antti Koivisto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (159020 => 159021)


--- trunk/Source/WebCore/ChangeLog	2013-11-10 08:57:08 UTC (rev 159020)
+++ trunk/Source/WebCore/ChangeLog	2013-11-10 10:56:32 UTC (rev 159021)
@@ -1,5 +1,16 @@
 2013-11-10  Andreas Kling  <[email protected]>
 
+        Simplify some is-this-a-MathML-element? checks.
+        <https://webkit.org/b/124119>
+
+        As of r158198, the MathML-ness of an Element is determined by
+        a Node flag, so there's no need to cast to Element before checking
+        on this. Simplify accordingly.
+
+        Reviewed by Antti Koivisto.
+
+2013-11-10  Andreas Kling  <[email protected]>
+
         Remove RenderTheme::shouldOpenPickerWithF4Key().
 
         Rubber-stamped by Anders Carlsson.

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (159020 => 159021)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-11-10 08:57:08 UTC (rev 159020)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-11-10 10:56:32 UTC (rev 159021)
@@ -1275,7 +1275,7 @@
 #endif
     
 #if ENABLE(MATHML)
-    if (node->isElementNode() && toElement(node)->isMathMLElement())
+    if (node->isMathMLElement())
         textOrder.append(AccessibilityText(getAttribute(MathMLNames::alttextAttr), AlternativeText));
 #endif
 }
@@ -1484,7 +1484,7 @@
 #endif
     
 #if ENABLE(MATHML)
-    if (m_node && m_node->isElementNode() && toElement(m_node)->isMathMLElement())
+    if (m_node && m_node->isMathMLElement())
         return getAttribute(MathMLNames::alttextAttr);
 #endif
 

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (159020 => 159021)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2013-11-10 08:57:08 UTC (rev 159020)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2013-11-10 10:56:32 UTC (rev 159021)
@@ -257,8 +257,8 @@
         // MathML elements make anonymous RenderObjects, then set their node to the parent's node.
         // This makes it so that the renderer() != renderer()->node()->renderer()
         // (which is what isInlineElementContinuation() uses as a determinant).
-        if (r->node()->isElementNode() && toElement(r->node())->isMathMLElement())
-            return 0;
+        if (r->node()->isMathMLElement())
+            return nullptr;
 #endif
         
         return toRenderInline(r->node()->renderer());
@@ -3404,7 +3404,7 @@
     if (!m_renderer || !node)
         return false;
     
-    return node->isElementNode() && toElement(node)->isMathMLElement();
+    return node->isMathMLElement();
 }
 
 bool AccessibilityRenderObject::isMathFraction() const

Modified: trunk/Source/WebCore/mathml/MathMLElement.h (159020 => 159021)


--- trunk/Source/WebCore/mathml/MathMLElement.h	2013-11-10 08:57:08 UTC (rev 159020)
+++ trunk/Source/WebCore/mathml/MathMLElement.h	2013-11-10 10:56:32 UTC (rev 159021)
@@ -54,8 +54,7 @@
 };
 
 void isMathMLElement(const MathMLElement&); // Catch unnecessary runtime check of type known at compile time.
-inline bool isMathMLElement(const Element& element) { return element.isMathMLElement(); }
-inline bool isMathMLElement(const Node& node) { return node.isElementNode() && toElement(node).isMathMLElement(); }
+inline bool isMathMLElement(const Node& node) { return node.isMathMLElement(); }
 NODE_TYPE_CASTS(MathMLElement)
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to