Bug 180346 - Improve downcast of MathML element classes
Summary: Improve downcast of MathML element classes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 161300
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-04 03:12 PST by Frédéric Wang (:fredw)
Modified: 2017-12-04 03:12 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2017-12-04 03:12:58 PST
See bug 161300 comment 3.

Currently we only have a SPECIALIZE_TYPE_TRAITS macro for the base MathMLElement class and we use static_cast in renderer classes:

fred@igalia-fwang:~/src-obj/webkit/WebKit$ grep MathML Source/WebCore/rendering/mathml/* | grep 'nodeForNonAnonymous'
Source/WebCore/rendering/mathml/RenderMathMLFraction.h:    MathMLFractionElement& element() const { return static_cast<MathMLFractionElement&>(nodeForNonAnonymous()); }
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:    return static_cast<MathMLOperatorElement&>(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLPadded.h:    MathMLPaddedElement& element() const { return static_cast<MathMLPaddedElement&>(nodeForNonAnonymous()); }
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp:    return static_cast<MathMLRootElement&>(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp:    return static_cast<MathMLRowElement&>(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp:    return static_cast<MathMLScriptsElement&>(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLSpace.h:    MathMLSpaceElement& element() const { return static_cast<MathMLSpaceElement&>(nodeForNonAnonymous()); }
Source/WebCore/rendering/mathml/RenderMathMLToken.cpp:    return static_cast<MathMLTokenElement&>(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp:    return static_cast<MathMLUnderOverElement&>(nodeForNonAnonymous());