<?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>211013</bug_id>
          
          <creation_ts>2020-04-25 00:24:52 -0700</creation_ts>
          <short_desc>getShaderPrecisionFormat returns the wrong values</short_desc>
          <delta_ts>2020-05-02 21:55:34 -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>WebGL</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Gregg Tavares">gman</reporter>
          <assigned_to name="Dean Jackson">dino</assigned_to>
          <cc>darin</cc>
    
    <cc>dino</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>graouts</cc>
    
    <cc>kbr</cc>
    
    <cc>kondapallykalyan</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1645549</commentid>
    <comment_count>0</comment_count>
    <who name="Gregg Tavares">gman</who>
    <bug_when>2020-04-25 00:24:52 -0700</bug_when>
    <thetext>Checking the code it&apos;s appears to be hard coded

https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp#L362</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645701</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-04-25 17:27:45 -0700</bug_when>
    <thetext>&lt;rdar://problem/62378056&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645863</commentid>
    <comment_count>2</comment_count>
      <attachid>397638</attachid>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-26 17:42:13 -0700</bug_when>
    <thetext>Created attachment 397638
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645866</commentid>
    <comment_count>3</comment_count>
      <attachid>397638</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-04-26 17:58:47 -0700</bug_when>
    <thetext>Comment on attachment 397638
Patch

This wasn’t an anti-fingerprinting measure?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646107</commentid>
    <comment_count>4</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-27 11:30:54 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #3)
&gt; Comment on attachment 397638 [details]
&gt; Patch
&gt; 
&gt; This wasn’t an anti-fingerprinting measure?

That&apos;s a good point. Let me look at the history.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646124</commentid>
    <comment_count>5</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-27 12:11:03 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #3)
&gt; Comment on attachment 397638 [details]
&gt; Patch
&gt; 
&gt; This wasn’t an anti-fingerprinting measure?

They were always exposed as constant values!

https://trac.webkit.org/changeset/113092/webkit

+    // These constants came from the Chromium port; we believe they originally
+    // came from making the actual API call on a representative desktop system.

Unfortunately my macOS systems return the same value, so I can&apos;t see if Chrome/Edge + Firefox do this properly. I&apos;ll have to look at their code.

For iOS, this does expose different values (from macOS). I&apos;ll also check an Android device.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646170</commentid>
    <comment_count>6</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-04-27 13:30:29 -0700</bug_when>
    <thetext>The original code came from early WebGL implementations, where this API call only existed on mobile devices and not desktop.

It&apos;s important for correctness and portability to expose this accurately. Gregg&apos;s encountered portability issues and a new WebGL conformance test which fails without this change is incoming in https://github.com/KhronosGroup/WebGL/pull/3061 .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646173</commentid>
    <comment_count>7</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-27 13:34:18 -0700</bug_when>
    <thetext>The main issue is that the hard-coded values are higher than what we support on iOS, which could lead to people thinking the device is more powerful (or accurate) than it really is.

So if we&apos;re going to hard-code values, we should pick the lowest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646174</commentid>
    <comment_count>8</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-27 13:36:50 -0700</bug_when>
    <thetext>(In reply to Kenneth Russell from comment #6)
&gt; The original code came from early WebGL implementations, where this API call
&gt; only existed on mobile devices and not desktop.

It&apos;s strange then that we hard-coded it to a desktop value then, and never asked for the real value on a mobile device.

&gt; 
&gt; It&apos;s important for correctness and portability to expose this accurately.
&gt; Gregg&apos;s encountered portability issues and a new WebGL conformance test
&gt; which fails without this change is incoming in
&gt; https://github.com/KhronosGroup/WebGL/pull/3061 .

It does expose a fingerprint though. I think I need to check how much the values can vary between devices (desktop to desktop, and mobile to mobile).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646196</commentid>
    <comment_count>9</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-04-27 14:06:00 -0700</bug_when>
    <thetext>This will likely mainly allow distinguishing between desktop and mobile GPUs, especially since there are relatively few GPU types on both macOS and iOS. The user agent string already provides essentially this information, in allowing distinguishing between operating systems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646256</commentid>
    <comment_count>10</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-27 15:04:57 -0700</bug_when>
    <thetext>Apple&apos;s OpenGL team confirmed that all iOS devices return the same values, as do all macOS devices. So this isn&apos;t extra fingerprinting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1646258</commentid>
    <comment_count>11</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-04-27 15:08:44 -0700</bug_when>
    <thetext>Committed r260789: &lt;https://trac.webkit.org/changeset/260789&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1648311</commentid>
    <comment_count>12</comment_count>
    <who name="Gregg Tavares">gman</who>
    <bug_when>2020-05-02 21:55:34 -0700</bug_when>
    <thetext>Just FYI. Even if they were different on every GPU not exposing them would not add new fingerprinting. The whole point of the new conformance test is to actually render to find out what the precision is because the value was wrong here.

I&apos;m sure a better test could derive any precision even if it was not reported here</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>397638</attachid>
            <date>2020-04-26 17:42:13 -0700</date>
            <delta_ts>2020-04-26 17:58:25 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-211013-20200427104212.patch</filename>
            <type>text/plain</type>
            <size>2827</size>
            <attacher name="Dean Jackson">dino</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjYwNjY3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggOTdlMTAzNDgwODM5NmRh
YjAwZWUxZDIwOTYxNDI1YjZjYTk0ODllNy4uZmQxNjQ5OGQ4ZmE0YTQxNGEzZjFiY2NlZmNmM2E5
ZDU4MTMxNDI3MyAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDIzIEBACisyMDIwLTA0LTI2ICBEZWFu
IEphY2tzb24gIDxkaW5vQGFwcGxlLmNvbT4KKworICA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pbnRlcm5hbGZvcm1hdCwgR0NHTHNpemVpIHdp
ZHRoLCBHQ0dMc2l6ZWkgaGVpZ2h0LCBHQ0dMaW50IGJvcmRlciwgR0NHTGVudW0gZm9ybWF0LCBH
Q0dMZW51bSB0eXBlLCBjb25zdCB2b2lkKiBwaXhlbHMpCg==
</data>
<flag name="review"
          id="413032"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>