<?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>314084</bug_id>
          
          <creation_ts>2026-05-05 06:50:24 -0700</creation_ts>
          <short_desc>Bad metrics calculated for  annotation/annotation-xml elements with padding</short_desc>
          <delta_ts>2026-05-05 07:02:02 -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>
    
    <blocked>314085</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>2207648</commentid>
    <comment_count>0</comment_count>
      <attachid>479476</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2026-05-05 06:50:24 -0700</bug_when>
    <thetext>Created attachment 479476
testcase

Testcase:

&lt;!DOCTYPE html&gt;
&lt;meta charset=&quot;utf-8&quot;/&gt;
&lt;style&gt;
  annotation-xml, annotation, mrow {
      font-family: math;
      display: initial;
      padding: 50px;
      border: 1px solid red;
      background: lightblue;
      opacity: .8;
  }
&lt;/style&gt;
&lt;p&gt;Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello&lt;/p&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;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;
&lt;p&gt;World World World World World World World World World World World World&lt;/p&gt;

The annotation and annotation-xml boxes overlap with the &quot;Hello World&quot; text around.

Note that the rendering is quite broken. If you remove `opacity: .8` nothing is shown. Also the annotation and annotation-xml text is not visible because of bug 314081.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>479476</attachid>
            <date>2026-05-05 06:50:24 -0700</date>
            <delta_ts>2026-05-05 06:50:24 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>styled-semantics-annotation.html</filename>
            <type>text/html</type>
            <size>647</size>
            <attacher name="Frédéric Wang Nélar">fred.wang</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxtZXRhIGNoYXJzZXQ9InV0Zi04Ii8+CjxzdHlsZT4KICBhbm5vdGF0
aW9uLXhtbCwgYW5ub3RhdGlvbiwgbXJvdyB7CiAgICAgIGZvbnQtZmFtaWx5OiBtYXRoOwogICAg
ICBkaXNwbGF5OiBpbml0aWFsOwogICAgICBwYWRkaW5nOiA1MHB4OwogICAgICBib3JkZXI6IDFw
eCBzb2xpZCByZWQ7CiAgICAgIGJhY2tncm91bmQ6IGxpZ2h0Ymx1ZTsKICAgICAgb3BhY2l0eTog
Ljg7CiAgfQo8L3N0eWxlPgo8cD5IZWxsbyBIZWxsbyBIZWxsbyBIZWxsbyBIZWxsbyBIZWxsbyBI
ZWxsbyBIZWxsbyBIZWxsbyBIZWxsbyBIZWxsbyBIZWxsbzwvcD4KPG1hdGg+CiAgPHNlbWFudGlj
cz4KICAgIDxtdGV4dD48L210ZXh0Pjxhbm5vdGF0aW9uPmFubm90YXRpb248L2Fubm90YXRpb24+
CiAgPC9zZW1hbnRpY3M+CjwvbWF0aD4KPG1hdGg+CiAgPHNlbWFudGljcz4KICAgIDxtdGV4dD48
L210ZXh0Pjxhbm5vdGF0aW9uLXhtbCBlbmNvZGluZz0idGV4dC9odG1sIj48c3Bhbj5hbm5vdGF0
aW9uLXhtbDwvc3Bhbj48L2Fubm90YXRpb24teG1sPgogIDwvc2VtYW50aWNzPgo8L21hdGg+Cjxw
PldvcmxkIFdvcmxkIFdvcmxkIFdvcmxkIFdvcmxkIFdvcmxkIFdvcmxkIFdvcmxkIFdvcmxkIFdv
cmxkIFdvcmxkIFdvcmxkPC9wPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>