<?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>123348</bug_id>
          
          <creation_ts>2013-10-25 11:04:59 -0700</creation_ts>
          <short_desc>[MathML] Layout invalid markup as an &lt;mrow&gt;</short_desc>
          <delta_ts>2024-07-22 16:38:18 -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>MathML</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=254093</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=179739</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>153991</dependson>
    
    <dependson>276917</dependson>
          <blocked>195797</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aestes</cc>
    
    <cc>ahmad.saleem792</cc>
    
    <cc>alex</cc>
    
    <cc>commit-queue</cc>
    
    <cc>fred.wang</cc>
    
    <cc>mrobinson</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>943663</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-10-25 11:04:59 -0700</bug_when>
    <thetext>Currently, certain invalid MathML documents (such as a MathML document containing arbitrary HTML markup) is rendered improperly.  According to the MathML specification, we should be providing better error information.

From http://www.w3.org/TR/MathML3/chapter6.html), Section 6.4 Combining MathML and Other Formats:

&quot;In the standard schema, elements from other namespaces are not allowed, but attributes from other namespaces are permitted. MathML processors that encounter unknown XML markup should behave as follows:

An attribute from a non-MathML namespace should be silently ignored.
An element from a non-MathML namespace should be treated as an error, except in an annotation-xml element. If the element is a child of a presentation element, it should be handled as described in Section 3.3.5 Error Message &lt;merror&gt;. If the element is a child of a content element, it should be handled as described in Section 4.2.9 Error Markup &lt;cerror&gt;.

For example, if the second child of an mfrac element is an unknown element, the fraction should be rendered with a denominator that indicates the error.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>943736</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2013-10-25 13:55:49 -0700</bug_when>
    <thetext>I looked at the torture tests in WebKitGTK+ and they seem fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>943815</commentid>
    <comment_count>2</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-10-25 16:32:06 -0700</bug_when>
    <thetext>See also http://www.whatwg.org/specs/web-apps/current-work/multipage/the-map-element.html#mathml:

&quot;User agents must act as if any MathML element whose contents does not match the element&apos;s content model was replaced, for the purposes of MathML layout and rendering, by an merror element in the MathML namespace containing some appropriate error message.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>943954</commentid>
    <comment_count>3</comment_count>
      <attachid>215269</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2013-10-27 05:25:03 -0700</bug_when>
    <thetext>Created attachment 215269
testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>944120</commentid>
    <comment_count>4</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-10-28 09:34:34 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; I looked at the torture tests in WebKitGTK+ and they seem fine.

I think this comment was intended for Bug 121728. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1174394</commentid>
    <comment_count>5</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2016-03-14 03:58:56 -0700</bug_when>
    <thetext>At the moment, the choice in the in-progress MathML refactoring is just to not display anything for invalid markup. However, we may do something as in Gecko and the refactoring will make that much easier. So I&apos;m making this depends on bug 153991.

(That said, I suspect we want to spend more time on supporting valid markup than on deciding a fallback rendering for invalid markup...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894759</commentid>
    <comment_count>6</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2022-08-30 02:54:56 -0700</bug_when>
    <thetext>Renaming the bug. MathML Core says to render invalid markup as an mrow, for example:

&quot;If the &lt;mfrac&gt; element has less or more than two in-flow children, its layout algorithm is the same as the &lt;mrow&gt; 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.&quot;

Chromium does that, and there is a plan for Firefox to align with that behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894849</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-30 09:51:35 -0700</bug_when>
    <thetext>&lt;rdar://problem/99335890&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1917556</commentid>
    <comment_count>8</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2022-12-08 05:34:25 -0800</bug_when>
    <thetext>Firefox 106 and Chrome 109 implements the &quot;mrow fallback&quot; behavior described in the MathML Core specification and there is a WPT test for that: https://wpt.fyi/results/mathml/presentation-markup/mrow/mrow-fallback.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2045797</commentid>
    <comment_count>9</comment_count>
    <who name="Harry Chen">harpsichen</who>
    <bug_when>2024-07-11 11:44:56 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/30705</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2047625</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-07-22 16:17:42 -0700</bug_when>
    <thetext>Committed 281218@main (eaf4e99ac1b0): &lt;https://commits.webkit.org/281218@main&gt;

Reviewed commits have been landed. Closing PR #30705 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2047629</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2024-07-22 16:25:14 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 276917</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2047639</commentid>
    <comment_count>12</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2024-07-22 16:38:18 -0700</bug_when>
    <thetext>Reverted this by mistake. The revert has been undone in https://commits.webkit.org/281221@main.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>215269</attachid>
            <date>2013-10-27 05:25:03 -0700</date>
            <delta_ts>2013-10-27 05:25:03 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>error.html</filename>
            <type>text/html</type>
            <size>719</size>
            <attacher name="Frédéric Wang Nélar">fred.wang</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPnRlc3RjYXNlIGVycm9y
PC90aXRsZT4KICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ii8+CiAgICA8c2NyaXB0IHR5cGU9InRl
eHQveC1tYXRoamF4LWNvbmZpZyI+CiAgICAgIE1hdGhKYXguSHViLkNvbmZpZyh7CiAgICAgICAg
amF4OiBbImlucHV0L01hdGhNTCIsICJvdXRwdXQvTmF0aXZlTU1MIl0sCiAgICAgICAgZWxlbWVu
dHM6IFsibWF0aGpheCJdCiAgICAgIH0pOwogICAgPC9zY3JpcHQ+CiAgICA8c2NyaXB0IHR5cGU9
InRleHQvamF2YXNjcmlwdCIgc3JjPSJodHRwOi8vY2RuLm1hdGhqYXgub3JnL21hdGhqYXgvbGF0
ZXN0L01hdGhKYXguanM/Y29uZmlnPVRlWC1BTVMtTU1MX0hUTUxvck1NTCI+PC9zY3JpcHQ+CiAg
PC9oZWFkPgogIDxib2R5PgoKICAgIDxwPk5hdGl2ZSBNYXRoTUw6CiAgICAgIDxtYXRoPjxtZnJh
Yz48bWk+eDwvbWk+PC9tZnJhYz48L21hdGg+IDsKICAgICAgPG1hdGg+PG1mcmFjPjxtaT54PC9t
aT48bXlub2RlLz48L21mcmFjPjwvbWF0aD4KICAgIDwvcD4KCiAgICA8ZGl2IGlkPSJtYXRoamF4
Ij4KICAgICAgTWF0aEpheDoKICAgICAgPG1hdGg+PG1mcmFjPjxtaT54PC9taT48L21mcmFjPjwv
bWF0aD4gOwogICAgICA8bWF0aD48bWZyYWM+PG1pPng8L21pPjxteW5vZGUvPjwvbWZyYWM+PC9t
YXRoPgogICAgPC9kaXY+CgogIDwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>