WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 178061
Fix bugs related to setting reflected floating point DOM attributes
https://bugs.webkit.org/show_bug.cgi?id=178061
Summary
Fix bugs related to setting reflected floating point DOM attributes
Darin Adler
Reported
2017-10-07 23:02:19 PDT
Fix bugs related to setting reflected floating point DOM attributes
Attachments
Patch
(47.09 KB, patch)
2017-10-08 01:41 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Patch
(47.36 KB, patch)
2017-10-08 01:48 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Patch
(42.66 KB, patch)
2017-10-08 01:52 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2017-10-08 01:41:35 PDT
Created
attachment 323129
[details]
Patch
Darin Adler
Comment 2
2017-10-08 01:48:09 PDT
Created
attachment 323130
[details]
Patch
Darin Adler
Comment 3
2017-10-08 01:52:50 PDT
Created
attachment 323131
[details]
Patch
Chris Dumez
Comment 4
2017-10-08 10:10:28 PDT
Comment on
attachment 323131
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=323131&action=review
> Source/WebCore/ChangeLog:13 > + (WebCore::HTMLProgressElement::setMax): Changed the semantics to match what
May want to mention:
https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#limited-to-numbers-greater-than-zero
> Source/WebCore/html/HTMLProgressElement.cpp:101 > + setAttributeWithoutSynchronization(valueAttr, AtomicString::number(value));
The specification [1[ says to use the "best representation of the number as a floating-point number" [2]. It basically says to use Ecma's ToString(), so shouldn't it call String::numberToStringECMAScript() ? Same for meter.value. -
https://html.spec.whatwg.org/multipage/form-elements.html#dom-progress-value
-
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#best-representation-of-the-number-as-a-floating-point-number
Darin Adler
Comment 5
2017-10-08 12:31:59 PDT
Comment on
attachment 323131
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=323131&action=review
>> Source/WebCore/ChangeLog:13 >> + (WebCore::HTMLProgressElement::setMax): Changed the semantics to match what > > May want to mention: >
https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#limited-to-numbers-greater-than-zero
OK
>> Source/WebCore/html/HTMLProgressElement.cpp:101 >> + setAttributeWithoutSynchronization(valueAttr, AtomicString::number(value)); > > The specification [1[ says to use the "best representation of the number as a floating-point number" [2]. It basically says to use Ecma's ToString(), so shouldn't it call String::numberToStringECMAScript() ? > Same for meter.value. > > -
https://html.spec.whatwg.org/multipage/form-elements.html#dom-progress-value
> -
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#best-representation-of-the-number-as-a-floating-point-number
Yes, exactly. AtomicSstring::number does exactly the same thing as String::numberToStringECMAScript. The String::number function needs to be renamed to include the words “fixed precision” and we will not use it that much any more going forward. I am trying to make the ECMAScript behavior, which is a great default anyway, the default stringifying for doubles throughout WebKit over time. So yes, this is what this patch does and that’s why the tests are passing now. I could have renamed the AtomicStriing::number function to add the word ECMAScript, but then I would’ve had to change all the call sites, and all of them want the ECMAScript semantic. I chose to do it this way: it’s a bit more subtle but I think it’s good forward-looking.
Darin Adler
Comment 6
2017-10-08 12:37:15 PDT
Maybe I should add more tests; not sure every last behavior change is sufficiently covered.
Darin Adler
Comment 7
2017-10-08 14:25:20 PDT
Now that EWS has run: review anyone?
WebKit Commit Bot
Comment 8
2017-10-08 15:17:49 PDT
Comment on
attachment 323131
[details]
Patch Clearing flags on attachment: 323131 Committed
r223035
: <
http://trac.webkit.org/changeset/223035
>
WebKit Commit Bot
Comment 9
2017-10-08 15:17:51 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10
2017-10-08 15:18:24 PDT
<
rdar://problem/34877132
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug