<?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>268542</bug_id>
          
          <creation_ts>2024-02-01 04:33:29 -0800</creation_ts>
          <short_desc>Parsing of floating-point number values in attributes should allow leading ascii whitespace, plus sign, and trailing junk</short_desc>
          <delta_ts>2024-05-08 17:19:13 -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>DOM</component>
          <version>Safari 17</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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>
          
          <blocked>255467</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Thomas Broyer">t.broyer</reporter>
          <assigned_to name="sideshowbarker">mike</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>akeerthi</cc>
    
    <cc>annevk</cc>
    
    <cc>mike</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2009693</commentid>
    <comment_count>0</comment_count>
      <attachid>469649</attachid>
    <who name="Thomas Broyer">t.broyer</who>
    <bug_when>2024-02-01 04:33:29 -0800</bug_when>
    <thetext>Created attachment 469649
Test case reduction

Per HTML rules for parsing floating-point values [1], leading ASCII whitespace, plus (+) sign, and trailing junk (similar to integers).

This is not the case for the progress element&apos;s max and value attributes, and meter element&apos;s value, min, max, low, high, and optimum attributes, that are all defined to use these rules [2,3,4].

Reproduced in Epiphany 6.0 and WebKitGTK MiniBrowser (same user agent): Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15

These are not tested by Web Platform Tests because meter attributes have a &quot;custom getter&quot;, and the progress element&apos;s max attribute is of type &quot;limited double&quot; which is not implemented in the test harness (reflection.js).

[1] https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#rules-for-parsing-floating-point-number-values
[2] https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element:rules-for-parsing-floating-point-number-values
[3] https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element:rules-for-parsing-floating-point-number-values-2
[4] https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element:rules-for-parsing-floating-point-number-values</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2009698</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-01 04:47:46 -0800</bug_when>
    <thetext>*** Safari 17.3 ***

progress.value (&quot; 50&quot;): 0
progress.max (&quot;100junk&quot;): 1

meter.min (&quot;\t1&quot;): 0
meter.low (&quot;+2&quot;): 0
meter.optimum (&quot;\n3&quot;): 0.5
meter.value (&quot;\r4&quot;): 0
meter.high (&quot;4.5.6&quot;): 1
meter.max (&quot;\f7&quot;): 1

*** Chrome Canary 123 ***

progress.value (&quot; 50&quot;): 0
progress.max (&quot;100junk&quot;): 1

meter.min (&quot;\t1&quot;): 0
meter.low (&quot;+2&quot;): 0
meter.optimum (&quot;\n3&quot;): 0.5
meter.value (&quot;\r4&quot;): 0
meter.high (&quot;4.5.6&quot;): 1
meter.max (&quot;\f7&quot;): 1

*** Firefox Nightly 124 ***

progress.value (&quot; 50&quot;): 1
progress.max (&quot;100junk&quot;): 1

meter.min (&quot;\t1&quot;): 1
meter.low (&quot;+2&quot;): 2
meter.optimum (&quot;\n3&quot;): 3
meter.value (&quot;\r4&quot;): 4
meter.high (&quot;4.5.6&quot;): 7
meter.max (&quot;\f7&quot;): 7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2009779</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Broyer">t.broyer</who>
    <bug_when>2024-02-01 09:38:56 -0800</bug_when>
    <thetext>This Pull Request to Web Platform Tests would test this for the progress element&apos;s max value: https://github.com/web-platform-tests/wpt/pull/44355</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010002</commentid>
    <comment_count>3</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2024-02-01 19:44:40 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/23719</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010044</commentid>
    <comment_count>4</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2024-02-02 00:41:40 -0800</bug_when>
    <thetext>I had trouble reading comment 0, but it seems the problem is that due to lack of test coverage we never aligned parsing for the attributes enumerated in comment 0 with the HTML standard.

We have a larger problem with parsing floating-point values which is that we handle whitespace incorrectly (this is not covered by WPT and the same overall bug is applicable to Chromium), as tracked by bug 255467.

It seems Mike discovered this, but we might need a different approach towards fixing the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010045</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Broyer">t.broyer</who>
    <bug_when>2024-02-02 00:51:51 -0800</bug_when>
    <thetext>(In reply to Anne van Kesteren from comment #4)
&gt; I had trouble reading comment 0, 

Ah sorry, the first sentence was incomplete and should have read:

&gt; Per HTML rules for parsing floating-point values [1], leading ASCII whitespace, plus (+) sign, and trailing junk **should be ignored** (similar to integers).

Hope that makes it a bit clearer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011709</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-02-08 04:34:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/122533439&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034166</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-05-08 17:19:11 -0700</bug_when>
    <thetext>Committed 278541@main (806925c1274e): &lt;https://commits.webkit.org/278541@main&gt;

Reviewed commits have been landed. Closing PR #23719 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>469649</attachid>
            <date>2024-02-01 04:33:29 -0800</date>
            <delta_ts>2024-02-01 04:33:29 -0800</delta_ts>
            <desc>Test case reduction</desc>
            <filename>webkit-double-attributes.html</filename>
            <type>text/html</type>
            <size>1138</size>
            <attacher name="Thomas Broyer">t.broyer</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgo8dGl0bGU+PC90aXRsZT4KPGJvZHk+Cjxwcm9ncmVzcyB2
YWx1ZT0iIDUwIiBtYXg9IjEwMGp1bmsiPjwvcHJvZ3Jlc3M+CjxtZXRlciBtaW49IgkxIiBsb3c9
IisyIiBvcHRpbXVtPSImI3gwYTszIiB2YWx1ZT0iJiN4MGQ7NCIgaGlnaD0iNC41LjYiIG1heD0i
JiN4MGM7NyI+PC9tZXRlcj4KPHByZT4KPC9wcmU+CjxzY3JpcHQ+CmNvbnN0IHByb2dyZXNzID0g
ZG9jdW1lbnQucXVlcnlTZWxlY3RvcigicHJvZ3Jlc3MiKTsKY29uc3QgbWV0ZXIgPSBkb2N1bWVu
dC5xdWVyeVNlbGVjdG9yKCJtZXRlciIpOwpsZXQgcyA9ICIiOwpzICs9ICJcbnByb2dyZXNzLnZh
bHVlICgiICsgSlNPTi5zdHJpbmdpZnkocHJvZ3Jlc3MuZ2V0QXR0cmlidXRlKCJ2YWx1ZSIpKSAr
ICIpOiAiICsgcHJvZ3Jlc3MudmFsdWU7CnMgKz0gIlxucHJvZ3Jlc3MubWF4ICgiICsgSlNPTi5z
dHJpbmdpZnkocHJvZ3Jlc3MuZ2V0QXR0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