- Revision
- 174084
- Author
- cdu...@apple.com
- Date
- 2014-09-29 13:50:45 -0700 (Mon, 29 Sep 2014)
Log Message
Use SPECIALIZE_TYPE_TRAITS_*() macro for MathMLElement
https://bugs.webkit.org/show_bug.cgi?id=137222
Reviewed by Ryosuke Niwa.
Use SPECIALIZE_TYPE_TRAITS_*() macro for MathMLElement instead of
NODE_TYPE_CASTS() + NodeTypeCastTraits template specialization.
No new tests, no behavior change.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::accessibilityDescription):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isMathElement):
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::attributeChanged):
* mathml/MathMLElement.h:
(WebCore::isMathMLElement):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::getSelectedSemanticsChild):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (174083 => 174084)
--- trunk/Source/WebCore/ChangeLog 2014-09-29 20:39:49 UTC (rev 174083)
+++ trunk/Source/WebCore/ChangeLog 2014-09-29 20:50:45 UTC (rev 174084)
@@ -1,3 +1,28 @@
+2014-09-29 Christophe Dumez <cdu...@apple.com>
+
+ Use SPECIALIZE_TYPE_TRAITS_*() macro for MathMLElement
+ https://bugs.webkit.org/show_bug.cgi?id=137222
+
+ Reviewed by Ryosuke Niwa.
+
+ Use SPECIALIZE_TYPE_TRAITS_*() macro for MathMLElement instead of
+ NODE_TYPE_CASTS() + NodeTypeCastTraits template specialization.
+
+ No new tests, no behavior change.
+
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::accessibilityDescription):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isMathElement):
+ * css/CSSDefaultStyleSheets.cpp:
+ (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
+ * mathml/MathMLElement.cpp:
+ (WebCore::MathMLElement::attributeChanged):
+ * mathml/MathMLElement.h:
+ (WebCore::isMathMLElement):
+ * mathml/MathMLSelectElement.cpp:
+ (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
+
2014-09-29 Eric Carlson <eric.carl...@apple.com>
[Mac] Remove MediaPlayerPrivateQTKit frame rate code
Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (174083 => 174084)
--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2014-09-29 20:39:49 UTC (rev 174083)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2014-09-29 20:50:45 UTC (rev 174084)
@@ -63,6 +63,7 @@
#include "HitTestResult.h"
#include "LabelableElement.h"
#include "LocalizedStrings.h"
+#include "MathMLElement.h"
#include "MathMLNames.h"
#include "NodeList.h"
#include "NodeTraversal.h"
@@ -1502,7 +1503,7 @@
return downcast<SVGElement>(*m_node).title();
#if ENABLE(MATHML)
- if (m_node && m_node->isMathMLElement())
+ if (m_node && is<MathMLElement>(*m_node))
return getAttribute(MathMLNames::alttextAttr);
#endif
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (174083 => 174084)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2014-09-29 20:39:49 UTC (rev 174083)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2014-09-29 20:50:45 UTC (rev 174084)
@@ -3491,7 +3491,7 @@
if (!m_renderer || !node)
return false;
- return node->isMathMLElement();
+ return is<MathMLElement>(node);
}
bool AccessibilityRenderObject::isMathFraction() const
Modified: trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp (174083 => 174084)
--- trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp 2014-09-29 20:39:49 UTC (rev 174083)
+++ trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp 2014-09-29 20:50:45 UTC (rev 174084)
@@ -34,6 +34,7 @@
#include "HTMLAnchorElement.h"
#include "HTMLAudioElement.h"
#include "HTMLBRElement.h"
+#include "MathMLElement.h"
#include "MediaQueryEvaluator.h"
#include "Page.h"
#include "RenderTheme.h"
@@ -166,7 +167,7 @@
}
#if ENABLE(MATHML)
- if (element.isMathMLElement() && !mathMLStyleSheet) {
+ if (is<MathMLElement>(element) && !mathMLStyleSheet) {
// MathML rules.
mathMLStyleSheet = parseUASheet(mathmlUserAgentStyleSheet, sizeof(mathmlUserAgentStyleSheet));
defaultStyle->addRulesFromSheet(mathMLStyleSheet, screenEval());
Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (174083 => 174084)
--- trunk/Source/WebCore/mathml/MathMLElement.cpp 2014-09-29 20:39:49 UTC (rev 174083)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp 2014-09-29 20:50:45 UTC (rev 174084)
@@ -294,7 +294,7 @@
{
if (isSemanticAnnotation() && (name == MathMLNames::srcAttr || name == MathMLNames::encodingAttr)) {
Element* parent = parentElement();
- if (parent && parent->isMathMLElement() && parent->hasTagName(semanticsTag))
+ if (parent && is<MathMLElement>(parent) && parent->hasTagName(semanticsTag))
downcast<MathMLElement>(*parent).updateSelectedChild();
}
StyledElement::attributeChanged(name, oldValue, newValue, reason);
Modified: trunk/Source/WebCore/mathml/MathMLElement.h (174083 => 174084)
--- trunk/Source/WebCore/mathml/MathMLElement.h 2014-09-29 20:39:49 UTC (rev 174083)
+++ trunk/Source/WebCore/mathml/MathMLElement.h 2014-09-29 20:50:45 UTC (rev 174084)
@@ -73,16 +73,10 @@
virtual void updateSelectedChild() { }
};
-void isMathMLElement(const MathMLElement&); // Catch unnecessary runtime check of type known at compile time.
-inline bool isMathMLElement(const Node& node) { return node.isMathMLElement(); }
+SPECIALIZE_TYPE_TRAITS_BEGIN(MathMLElement)
+ static bool isMathMLElement(const Node& node) { return node.isMathMLElement(); }
+SPECIALIZE_TYPE_TRAITS_END()
-template <typename ArgType>
-struct NodeTypeCastTraits<const MathMLElement, ArgType> {
- static bool isType(ArgType& node) { return isMathMLElement(node); }
-};
-
-NODE_TYPE_CASTS(MathMLElement)
-
inline bool Node::hasTagName(const MathMLQualifiedName& name) const
{
return isMathMLElement() && downcast<MathMLElement>(*this).hasTagName(name);
Modified: trunk/Source/WebCore/mathml/MathMLSelectElement.cpp (174083 => 174084)
--- trunk/Source/WebCore/mathml/MathMLSelectElement.cpp 2014-09-29 20:39:49 UTC (rev 174083)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.cpp 2014-09-29 20:50:45 UTC (rev 174084)
@@ -157,7 +157,7 @@
if (!child)
return nullptr;
- if (!child->isMathMLElement() || !downcast<MathMLElement>(*child).isPresentationMathML()) {
+ if (!is<MathMLElement>(child) || !downcast<MathMLElement>(*child).isPresentationMathML()) {
// The first child is not a presentation MathML element. Hence we move to the second child and start searching an annotation child that could be displayed.
child = child->nextElementSibling();
} else if (!downcast<MathMLElement>(*child).isSemanticAnnotation()) {
@@ -167,7 +167,7 @@
// Otherwise, the first child is an <annotation> or <annotation-xml> element. This is invalid, but some people use this syntax so we take care of this case too and start the search from this first child.
for ( ; child; child = child->nextElementSibling()) {
- if (!child->isMathMLElement())
+ if (!is<MathMLElement>(child))
continue;
if (child->hasTagName(MathMLNames::annotationTag)) {