<?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>219280</bug_id>
          
          <creation_ts>2020-11-24 14:54:50 -0800</creation_ts>
          <short_desc>REGRESSION (?): Presence of whitespace after a hidden inline element moves the baseline</short_desc>
          <delta_ts>2020-12-01 16:52:23 -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>Layout and Rendering</component>
          <version>Safari 14</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=218044</see_also>
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kit Grose">kit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1710025</commentid>
    <comment_count>0</comment_count>
      <attachid>414852</attachid>
    <who name="Kit Grose">kit</who>
    <bug_when>2020-11-24 14:54:50 -0800</bug_when>
    <thetext>Created attachment 414852
HTML file demonstrating the issue

Relatively recently, a WebKit change introduced a change to the way the baseline is computed which visually broke the navigation on a website I work on.

After much experimentation, the issue seems to be that the presence of any whitespace following an inline element styled with `display: none` moves the baseline for that item, such that the surrounding `inline-block` elements no longer visually align to the baseline. Making the inline element visible corrects the problem, as does trimming the whitespace that follows it. The obvious workaround is to set `vertical-align` to any value other than `baseline`, which does correct the issue in this case.

I&apos;ve been unable to get the WebKit Build Archives to run on my Mac to confirm if it affects the latest builds of WebKit, and the Safari Technology Preview no longer runs on Mojave, but I have been able to get a friend to confirm the issue affects Safari 10.14 in macOS 11 (Big Sur) too. I have confirmed that the issue does not affect Firefox nor Chrome.

Please find a trivial reproduction example attached. Boxes A and B should be aligned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710026</commentid>
    <comment_count>1</comment_count>
      <attachid>414853</attachid>
    <who name="Kit Grose">kit</who>
    <bug_when>2020-11-24 14:57:13 -0800</bug_when>
    <thetext>Created attachment 414853
Screenshot of the output of the HTML test case

I&apos;ve attached a screenshot of the output of the test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710639</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-11-30 09:31:10 -0800</bug_when>
    <thetext>&lt;rdar://problem/71808556&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710660</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2020-11-30 10:17:01 -0800</bug_when>
    <thetext>I can reproduce this in STP 110 but not in more recent builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1710661</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2020-11-30 10:20:18 -0800</bug_when>
    <thetext>Seem to be related to whether Next-gen line layout integration is enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1711046</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2020-12-01 08:50:08 -0800</bug_when>
    <thetext>This is behaving correctly in recent trunk builds. Please test in the next Safari Tech Preview.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1711209</commentid>
    <comment_count>6</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2020-12-01 16:15:23 -0800</bug_when>
    <thetext>progressed at r268821 (http://trac.webkit.org/changeset/268821/webkit)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>414852</attachid>
            <date>2020-11-24 14:54:50 -0800</date>
            <delta_ts>2020-11-24 14:54:50 -0800</delta_ts>
            <desc>HTML file demonstrating the issue</desc>
            <filename>webkit-line-height-bug.html</filename>
            <type>text/html</type>
            <size>371</size>
            <attacher name="Kit Grose">kit</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPldlYktpdCBsaW5lLWhl
aWdodCBidWc8L3RpdGxlPgogICAgPHN0eWxlPgogICAgICBkaXYgewogICAgICAgIGRpc3BsYXk6
IGlubGluZS1ibG9jazsKICAgICAgfQoKICAgICAgcCB7CiAgICAgICAgYm9yZGVyOiAxcHggc29s
aWQgcmVkOwogICAgICB9CgogICAgICBzcGFuIHsKICAgICAgICBkaXNwbGF5OiBub25lOwogICAg
ICB9CiAgICA8L3N0eWxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgIDxkaXY+CiAgICAgIDxwPkE8
L3A+CiAgICA8L2Rpdj4KICAgIDxkaXY+CiAgICAgICAgPHA+QiA8c3Bhbj48L3NwYW4+IDwvcD4K
ICAgIDwvZGl2PgogIDwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>414853</attachid>
            <date>2020-11-24 14:57:13 -0800</date>
            <delta_ts>2020-11-24 14:57:13 -0800</delta_ts>
            <desc>Screenshot of the output of the HTML test case</desc>
            <filename>sample-output.png</filename>
            <type>image/png</type>
            <size>554</size>
            <attacher name="Kit Grose">kit</attacher>
            
              <data encoding="base64">iVBORw0KGgoAAAANSUhEUgAAAC0AAAApCAIAAAAu6TfbAAAB8UlEQVR4AWL4PzgAoP06gFAkCuMA
Xgm1miKb0shUEqmgCEoMCUISAZACxIkggQoAUSoQCcAABM5UCAoIUhCkQJBQuHJ/u24tztw2Mzew
7zPy+jTv/Xrf+9R8bwdxEAdx/KLof14KOUR/gDiEHcKVFq43//LKsqxKpdJoNKFQyOFw+P3+Uqm0
Wq3EO0RsAN5eLhetVut0Ot8z2+2WYRiDwXA8HhV14JWiKLfb/ZGsVCrYIY7j5HEcDgcRjvv9nkgk
sEObzUYeRyAQmEwmX3SYTKZut1uv12OxmE6na7Va8pyP2WyGvU2n0190mM3mRqORyWRomjYajRhf
r1cZHNls1ufzoQt2u92z56NQKOA79Pt9qY79fh8Oh+fzOaYrl8vPOhaLBW5EG0t11Gq1Xq+HQTAY
ROHRmU853muaSqUkOW63m8vlOp/PGOPoYcZOpyPgOJ1OarXaarU+Hg9k1ut1PB7HXcPhUJJjNBrZ
7fYfb5HP5zGj1+vFGn91/Hx5jUajqrdgGMZisdhsNpZlB4OB1H6JRCLtdpv7E8lkEmuMx2OBugiE
SMdyuUSbfM5Pp1M4oFHUkcvlqtXq5zwqgjKBAqJCjmKxiPU8Hg/P8x/5ZrOp1+uRx+EFRQmHuN85
4Ushh/ggjv/zv5A8RxEHcRAHcfwGNvOkrME2BjAAAAAASUVORK5CYII=
</data>

          </attachment>
      

    </bug>

</bugzilla>