<?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>276026</bug_id>
          
          <creation_ts>2024-06-28 20:01:55 -0700</creation_ts>
          <short_desc>[MathML] &lt;mfrac&gt; with out-of-flow numerator/denominator produces unexpected result</short_desc>
          <delta_ts>2024-07-04 05:24:36 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>179739</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="alan">zalan</reporter>
          <assigned_to name="alan">zalan</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>changseok</cc>
    
    <cc>dbarton</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>fred.wang</cc>
    
    <cc>glenn</cc>
    
    <cc>koivisto</cc>
    
    <cc>kondapallykalyan</cc>
    
    <cc>pdr</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2043730</commentid>
    <comment_count>0</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2024-06-28 20:01:55 -0700</bug_when>
    <thetext>&lt;rdar://130757408&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043734</commentid>
    <comment_count>1</comment_count>
      <attachid>471770</attachid>
    <who name="alan">zalan</who>
    <bug_when>2024-06-28 20:35:08 -0700</bug_when>
    <thetext>Created attachment 471770
[fast-cq]Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043787</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-06-29 13:03:42 -0700</bug_when>
    <thetext>Committed 280505@main (c37d84f4267d): &lt;https://commits.webkit.org/280505@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 471770.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044400</commentid>
    <comment_count>3</comment_count>
      <attachid>471770</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2024-07-03 00:14:47 -0700</bug_when>
    <thetext>Comment on attachment 471770
[fast-cq]Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=471770&amp;action=review

&gt; COMMIT_MESSAGE:8
&gt; +(Alternatively we can mark such content as invalid as they are certainly expected to be inflow boxes, but the rest of the MathML renderers follow this logic.)

For reference the behavior described in MathML Core (  https://www.w3.org/TR/mathml-core/#fractions-mfrac ):

&gt; If the &lt;mfrac&gt; element has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called numerator, the second in-flow child is called denominator and the layout algorithm is explained below. 

We should probably review all the MathML elements and see if they follow this logic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044427</commentid>
    <comment_count>4</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2024-07-03 05:24:58 -0700</bug_when>
    <thetext>(In reply to Frédéric Wang (:fredw) from comment #3)
&gt; Comment on attachment 471770 [details]
&gt; [fast-cq]Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=471770&amp;action=review
&gt; 
&gt; &gt; COMMIT_MESSAGE:8
&gt; &gt; +(Alternatively we can mark such content as invalid as they are certainly expected to be inflow boxes, but the rest of the MathML renderers follow this logic.)
&gt; 
&gt; For reference the behavior described in MathML Core ( 
&gt; https://www.w3.org/TR/mathml-core/#fractions-mfrac ):
&gt; 
&gt; &gt; If the &lt;mfrac&gt; element has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called numerator, the second in-flow child is called denominator and the layout algorithm is explained below. 
Thank you!
I did a quick search before submitting this patch and landed on the spec, hence my hesitation in the changelog entry.

&gt; 
&gt; We should probably review all the MathML elements and see if they follow
&gt; this logic.
Yeah, we should certainly do that!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044662</commentid>
    <comment_count>5</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2024-07-04 04:04:51 -0700</bug_when>
    <thetext>(In reply to zalan from comment #4)
&gt; &gt; We should probably review all the MathML elements and see if they follow
&gt; &gt; this logic.
&gt; Yeah, we should certainly do that!

OK apparently I already had opened bug 179739 for that and more recently MathML Core specified how to handle it. I&apos;ll propose this task to an Igalia&apos;s Coding Experience student.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2044669</commentid>
    <comment_count>6</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2024-07-04 05:24:36 -0700</bug_when>
    <thetext>(In reply to Frédéric Wang (:fredw) from comment #5)
&gt; (In reply to zalan from comment #4)
&gt; &gt; &gt; We should probably review all the MathML elements and see if they follow
&gt; &gt; &gt; this logic.
&gt; &gt; Yeah, we should certainly do that!
&gt; 
&gt; OK apparently I already had opened bug 179739 for that and more recently
&gt; MathML Core specified how to handle it. I&apos;ll propose this task to an
&gt; Igalia&apos;s Coding Experience student.
Awesome! Thank you for taking care of this!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>471770</attachid>
            <date>2024-06-28 20:35:08 -0700</date>
            <delta_ts>2024-06-30 06:09:26 -0700</delta_ts>
            <desc>[fast-cq]Patch</desc>
            <filename>bug-276026-20240628203507.patch</filename>
            <type>text/plain</type>
            <size>3479</size>
            <attacher name="alan">zalan</attacher>
            
              <data encoding="base64">RnJvbSA4YWFlZDU4MWFkZWE3YmUyOTI4OTRkZTBiZGMyMmIzNmUwYzlhYmIyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGFuIEJhcmFkbGF5IDx6YWxhbkBhcHBsZS5jb20+CkRhdGU6
IEZyaSwgMjggSnVuIDIwMjQgMjA6MjU6MTkgLTA3MDAKU3ViamVjdDogW1BBVENIXSBbTWF0aE1M
XSA8bWZyYWM+IHdpdGggb3V0LW9mLWZsb3cgbnVtZXJhdG9yL2Rlbm9taW5hdG9yCiBwcm9kdWNl
cyB1bmV4cGVjdGVkIHJlc3VsdCBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/
aWQ9Mjc2MDI2CiA8cmRhcjovLzEzMDc1NzQwOD4KClJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEp
LgoKT3V0LW9mLWZsb3cgKG51bWVyYXRvci9kZW5vbWluYXRvcikgY2hpbGRyZW4gaGF2ZSB0byBn
ZXQgaW5zZXJ0ZWQgdG8gdGhlaXIgY29udGFpbmluZyBibG9jaydzIGxpc3Qgd2hpbGUgcnVubmlu
ZyBpbmZsb3cgbGF5b3V0LgooQWx0ZXJuYXRpdmVseSB3ZSBjYW4gbWFyayBzdWNoIGNvbnRlbnQg
YXMgaW52YWxpZCBhcyB0aGV5IGFyZSBjZXJ0YWlubHkgZXhwZWN0ZWQgdG8gYmUgaW5mbG93IGJv
eGVzLCBidXQgdGhlIHJlc3Qgb2YgdGhlIE1hdGhNTCByZW5kZXJlcnMgZm9sbG93IHRoaXMgbG9n
aWMuKQoKKiBMYXlvdXRUZXN0cy9tYXRobWwvb3V0LW9mLWZsb3ctZnJhY3Rpb24tY29udGVudC1j
cmFzaC1leHBlY3RlZC50eHQ6IEFkZGVkLgoqIExheW91dFRlc3RzL21hdGhtbC9vdXQtb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XY+Cis8ZGl2IGlkPSJodG1s
dmFyMDAwMjciPgorPG1hdGg+PG1mcmFjPjxtaT48L21pPjxtaT48bWkgaWQ9Zm9vPjwvZGl2Pgor
PHNjcmlwdD4KK2lmICh3aW5kb3cudGVzdFJ1bm5lcikKKyAgdGVzdFJ1bm5lci5kdW1wQXNUZXh0
KCk7CisKK2h0bWx2YXIwMDAwNy5hcHBlbmQoImZvbyIpOworZG9jdW1lbnQuZ2V0RWxlbWVudEJ5
SWQoImZvbyIpLmFwcGVuZENoaWxkKGh0bWx2YXIwMDAwMyk7CitodG1sdmFyMDAwMjQuYXBwZW5k
Q2hpbGQoaHRtbHZhcjAwMDI3KTsKK3dpbmRvdy5maW5kKCJmb28iLHRydWUsdHJ1ZSxmYWxzZSxm
YWxzZSk7Citkb2N1bWVudC5leGVjQ29tbWFuZCgiaW5zZXJ0SFRNTCIsICIiKTsKKzwvc2NyaXB0
Pgo=
</data>
<flag name="review"
          id="497275"
          type_id="1"
          status="+"
          setter="koivisto"
    />
          </attachment>
      

    </bug>

</bugzilla>