<?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>230348</bug_id>
          
          <creation_ts>2021-09-16 07:03:24 -0700</creation_ts>
          <short_desc>AX: Why does -apple-system-body default to 13px on macOS?</short_desc>
          <delta_ts>2021-09-19 11:27:22 -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>Text</component>
          <version>Safari 14</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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="Šime Vidas">sime.vidas</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andresg_22</cc>
    
    <cc>ap</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1794035</commentid>
    <comment_count>0</comment_count>
    <who name="Šime Vidas">sime.vidas</who>
    <bug_when>2021-09-16 07:03:24 -0700</bug_when>
    <thetext>Steps to reproduce:

1. Add this CSS to the page:

  html {
    font: -apple-system-body;
  }

2. Observe that the default text size in Safari on macOS is 13px.

Live demo: https://output.jsbin.com/nofobeh/quiet

Why 13px? That’s a reduction of 3px from the usual default of 16px. This is a problem for websites that want to use -apple-system-body in order to support the text size accessibility preference on iOS. How should such websites handle the 13px default in desktop Safari?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794036</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-16 07:04:49 -0700</bug_when>
    <thetext>&lt;rdar://problem/83195793&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794836</commentid>
    <comment_count>2</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2021-09-18 20:11:09 -0700</bug_when>
    <thetext>This matches platform conventions on macOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794837</commentid>
    <comment_count>3</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2021-09-18 20:13:55 -0700</bug_when>
    <thetext>If you want, you can do something like:

&lt;style&gt;
:root {
    font -apple-system-body;
}
#myElement {
    font-size: 130rem;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794861</commentid>
    <comment_count>4</comment_count>
    <who name="Šime Vidas">sime.vidas</who>
    <bug_when>2021-09-19 03:47:31 -0700</bug_when>
    <thetext>The problem is that on every other platform and browser, the default font size is 16px, so if I use em or rem units to increase the font-size for desktop Safari, it will be too big in all other browsers.

  html {
    font: -apple-system-body;
  }

  body {
    font-size: 1.2307692rem;
  }

With this code, the font-size will by default be exactly 16px in desktop Safari but 19.69px in all other browsers (including iOS Safari!). The only way to get a consistent 16px across all browsers seems to be to detect desktop Safari and add the body font-size: 1.2307692rem increase to that browser only.

Since there is no “Larger text” accessibility setting on macOS, I think it would be best if font: -apple-system-body was just ignored and didn’t result in a font-size decrease to 13px.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1794905</commentid>
    <comment_count>5</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2021-09-19 11:27:22 -0700</bug_when>
    <thetext>You should be able to use @supports with font: -apple-system-body to conditionalize the size adjustments. CSS variables will also help here.

The purpose of -apple-system-body is to match platform conventions to allow content to show UI that looks like native UI. Putting -apple-system-body in a WKWebView and putting that next to native UI in an app needs to result in them having the same size.

https://github.com/w3c/csswg-drafts/issues/3708 has a bunch of other ideas for new ways to expose the dynamic text size of the system. Maybe you’re advocating for something new, rather than adjusting the behavior of -apple-system-body? If there is to be a new mechanism, it should probably go to the CSSWG first, rather than start in WebKit’s bug tracker.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>