<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>180346</bug_id>
          
          <creation_ts>2017-12-04 03:12:58 -0800</creation_ts>
          <short_desc>Improve downcast of MathML element classes</short_desc>
          <delta_ts>2017-12-04 03:12:58 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>MathML</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>161300</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Frédéric Wang Nélar">fred.wang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>lambda</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1377638</commentid>
    <comment_count>0</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2017-12-04 03:12:58 -0800</bug_when>
    <thetext>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 &apos;nodeForNonAnonymous&apos;
Source/WebCore/rendering/mathml/RenderMathMLFraction.h:    MathMLFractionElement&amp; element() const { return static_cast&lt;MathMLFractionElement&amp;&gt;(nodeForNonAnonymous()); }
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:    return static_cast&lt;MathMLOperatorElement&amp;&gt;(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLPadded.h:    MathMLPaddedElement&amp; element() const { return static_cast&lt;MathMLPaddedElement&amp;&gt;(nodeForNonAnonymous()); }
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp:    return static_cast&lt;MathMLRootElement&amp;&gt;(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp:    return static_cast&lt;MathMLRowElement&amp;&gt;(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp:    return static_cast&lt;MathMLScriptsElement&amp;&gt;(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLSpace.h:    MathMLSpaceElement&amp; element() const { return static_cast&lt;MathMLSpaceElement&amp;&gt;(nodeForNonAnonymous()); }
Source/WebCore/rendering/mathml/RenderMathMLToken.cpp:    return static_cast&lt;MathMLTokenElement&amp;&gt;(nodeForNonAnonymous());
Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp:    return static_cast&lt;MathMLUnderOverElement&amp;&gt;(nodeForNonAnonymous());</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>