<?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>314081</bug_id>
          
          <creation_ts>2026-05-05 06:23:32 -0700</creation_ts>
          <short_desc>text/non-MathML children of annotation/annotation-xml are not rendered</short_desc>
          <delta_ts>2026-05-07 01:00: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>New Bugs</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>
          
          <blocked>195797</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Frédéric Wang Nélar">fred.wang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eri</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2207639</commentid>
    <comment_count>0</comment_count>
      <attachid>479475</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2026-05-05 06:23:32 -0700</bug_when>
    <thetext>Created attachment 479475
testcase

Consider the following test case:

&lt;!DOCTYPE html&gt;
&lt;meta charset=&quot;utf-8&quot;/&gt;
&lt;style&gt;
  annotation-xml, annotation { display: initial; }
&lt;/style&gt;
&lt;math&gt;
  &lt;semantics&gt;
    &lt;mtext&gt;&lt;/mtext&gt;
    &lt;annotation&gt;annotation&lt;/annotation&gt;
  &lt;/semantics&gt;
&lt;/math&gt;
&lt;math&gt;
  &lt;semantics&gt;
    &lt;!-- encoding attribute guarantees the HTML parser keeps the span as a child of annotation-xml --&gt;
    &lt;mtext&gt;&lt;/mtext&gt;&lt;annotation-xml encoding=&quot;text/html&quot;&gt;&lt;span&gt;annotation-xml&lt;/span&gt;&lt;/annotation-xml&gt;
  &lt;/semantics&gt;
&lt;/math&gt;


Firefox and Chromium will render the text &quot;annotation&quot; and &quot;annotation-xml&quot;. WebKit will only render annotation-xml

This seems to be a regression from https://github.com/WebKit/WebKit/pull/51387/changes#diff-a9625de9071fd6b99215283bb592203a7ee03edf7e696a4261babbc7a409b660 because now annotation only accepts MathML children, not text node.

The spec is not really clear about what to do with &quot;invalid&quot; children: https://github.com/w3c/mathml-core/issues/57

However, typical use case from MathML3 is to have text children for annotation and non-MathML markup for annotation-xml, so probably previous code was correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208503</commentid>
    <comment_count>1</comment_count>
    <who name="Eri">eri</who>
    <bug_when>2026-05-07 01:00:36 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64452</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>479475</attachid>
            <date>2026-05-05 06:23:32 -0700</date>
            <delta_ts>2026-05-05 06:23:32 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>visible-semantics-annotation.html</filename>
            <type>text/html</type>
            <size>460</size>
            <attacher name="Frédéric Wang Nélar">fred.wang</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxtZXRhIGNoYXJzZXQ9InV0Zi04Ii8+CjxzdHlsZT4KICBhbm5vdGF0
aW9uLXhtbCwgYW5ub3RhdGlvbiB7IGRpc3BsYXk6IGluaXRpYWw7IH0KPC9zdHlsZT4KPG1hdGg+
CiAgPHNlbWFudGljcz4KICAgIDxtdGV4dD48L210ZXh0PgogICAgPGFubm90YXRpb24+YW5ub3Rh
dGlvbjwvYW5ub3RhdGlvbj4KICA8L3NlbWFudGljcz4KPC9tYXRoPgo8bWF0aD4KICA8c2VtYW50
aWNzPgogICAgPCEtLSBlbmNvZGluZyBhdHRyaWJ1dGUgZ3VhcmFudGVlcyB0aGUgSFRNTCBwYXJz
ZXIga2VlcHMgdGhlIHNwYW4gYXMgYSBjaGlsZCBvZiBhbm5vdGF0aW9uLXhtbCAtLT4KICAgIDxt
dGV4dD48L210ZXh0Pjxhbm5vdGF0aW9uLXhtbCBlbmNvZGluZz0idGV4dC9odG1sIj48c3Bhbj5h
bm5vdGF0aW9uLXhtbDwvc3Bhbj48L2Fubm90YXRpb24teG1sPgogIDwvc2VtYW50aWNzPgo8L21h
dGg+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>