<?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>226334</bug_id>
          
          <creation_ts>2021-05-27 08:58:01 -0700</creation_ts>
          <short_desc>Canvas textBaseline &quot;top&quot; inconsistent with Chrome</short_desc>
          <delta_ts>2024-10-07 13:28:28 -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>Canvas</component>
          <version>Safari 14</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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ashley Gullen">ashley</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>ryan</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1764342</commentid>
    <comment_count>0</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2021-05-27 08:58:01 -0700</bug_when>
    <thetext>When drawing text with canvas2d with the &quot;top&quot; baseline, Safari&apos;s positioning is different to Chrome.

Minimal repro: https://downloads.scirra.com/labs/bugs/text-top-baseline/index.html

Comparison Safari vs. Chrome image: https://downloads.scirra.com/labs/bugs/text-top-baseline/comparison.png

Observed result: notice the text in Safari is positioned a few pixels lower from the top.

Expected result: text positioning to be consistent across browsers. This issue makes it difficult to get consistent text positioning when drawing text to canvases, particularly if the text is positioned relatively to other content, such as a box drawn around it, or when trying to calculate vertical alignment.

I am not sure which browser is correct, so I&apos;m filing issues with both Safari and Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1764343</commentid>
    <comment_count>1</comment_count>
    <who name="Ashley Gullen">ashley</who>
    <bug_when>2021-05-27 09:00:34 -0700</bug_when>
    <thetext>Corresponding Chrome issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1213949</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1766408</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-03 08:58:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/78817913&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1766840</commentid>
    <comment_count>3</comment_count>
      <attachid>430593</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2021-06-04 10:59:17 -0700</bug_when>
    <thetext>Created attachment 430593
test case

I think there is also a bug in displaying the text with hanging and middle baseline, see the attached &quot;test case&quot;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>430593</attachid>
            <date>2021-06-04 10:59:17 -0700</date>
            <delta_ts>2021-06-04 10:59:17 -0700</delta_ts>
            <desc>test case</desc>
            <filename>canvas-baseline-test.html</filename>
            <type>text/html</type>
            <size>694</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PGh0bWw+PGhlYWQ+CjxtZXRhIGNoYXJzZXQ9InV0ZjgiPgo8dGl0bGU+VGV4dCB0b3AgYmFzZWxp
bmU8L3RpdGxlPgo8L2hlYWQ+Cjxib2R5Pgo8Y2FudmFzIGlkPSJjYW52YXMiIHdpZHRoPSI3MDAi
IGhlaWdodD0iNjAwIj48L2NhbnZhcz4KPHNjcmlwdD4KCWNvbnN0IGJhc2VsaW5lcyA9IFsndG9w
JywgJ2hhbmdpbmcnLCAnbWlkZGxlJywgJ2FscGhhYmV0aWMnLCAnaWRlb2dyYXBoaWMnLCAnYm90
dG9tJ107CgoJY29uc3QgY2FudmFzID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNhbnZhcyIp
OwoJY29uc3QgY3R4ID0gY2FudmFzLmdldENvbnRleHQoIjJkIik7CgljdHguZm9udCA9ICIzNnB0
IEFyaWFsIjsKCWN0eC5maWxsU3R5bGUgPSAiYmxhY2siOwoJY3R4LnN0cm9rZVN0eWxlID0gJ3Jl
ZCc7CgoJYmFzZWxpbmVzLmZvckVhY2goZnVuY3Rpb24oYmFzZWxpbmUsIGluZGV4KSB7CgkJY3R4
LnRleHRCYXNlbGluZSA9IGJhc2VsaW5lOwoJCWNvbnN0IHkgPSBpbmRleCAqIDgwOwogIAkJY3R4
LmJlZ2luUGF0aCgpOwogIAkJY3R4Lm1vdmVUbygwLCB5ICsgMC41KTsKICAJCWN0eC5saW5lVG8o
ODAwLCB5ICsgMC41KTsKICAJCWN0eC5zdHJva2UoKTsKCQljdHguZmlsbFRleHQoJ0FiY2RlZmdo
aWprbG1ub3AgKCcgKyBiYXNlbGluZSArICcpJywgMCwgeSk7Cgl9KTsKPC9zY3JpcHQ+Cgo8L2Jv
ZHk+PC9odG1sPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>