Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Issue 2590433002: Stricter float-to-int conversion in SVGIntegerOptionalInteger (Closed)

Created:
4 years ago by fs
Modified:
4 years ago
Reviewers:
pdr., Stephen Chennney
CC:
fs, blink-reviews, chromium-reviews, krit, f(malita), gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Stricter float-to-int conversion in SVGIntegerOptionalInteger SVGIntegerOptionalInteger parses values as floats but stores them as integers. Add helpers to avoid issues with overflow and to make this conversion the same way in all places it's needed. The "normal" parsing code would truncate the float value while the parsing code for animation values would round. Make them both use truncation (and the avoid duplicating the code.) BUG=675130 Committed: https://crrev.com/c81442affec64a78e310df6c7dfd5a05ff520cf4 Cr-Commit-Position: refs/heads/master@{#439533}

Patch Set 1 #

Patch Set 2 : Truncate, don't round #

Patch Set 3 : ...and back to doing things differently. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -15 lines) Patch
A third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html View 1 chunk +20 lines, -0 lines 4 comments Download
M third_party/WebKit/Source/core/svg/SVGIntegerOptionalInteger.cpp View 1 2 3 chunks +8 lines, -15 lines 0 comments Download

Messages

Total messages: 24 (15 generated)
fs
4 years ago (2016-12-19 16:24:25 UTC) #12
pdr.
LGTM https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html File third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html (right): https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html#newcode1 third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html:1: <!DOCTYPE html> Please don't rewrite this, but for ...
4 years ago (2016-12-19 19:42:54 UTC) #13
fs
https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html File third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html (right): https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html#newcode1 third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html:1: <!DOCTYPE html> On 2016/12/19 at 19:42:54, pdr (OOO Dec ...
4 years ago (2016-12-19 19:54:54 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2590433002/40001
4 years ago (2016-12-19 20:01:19 UTC) #16
pdr.
https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html File third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html (right): https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html#newcode1 third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html:1: <!DOCTYPE html> On 2016/12/19 at 19:54:54, fs wrote: > ...
4 years ago (2016-12-19 20:01:51 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-12-19 20:07:54 UTC) #20
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/c81442affec64a78e310df6c7dfd5a05ff520cf4 Cr-Commit-Position: refs/heads/master@{#439533}
4 years ago (2016-12-19 20:10:55 UTC) #22
fs
https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html File third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html (right): https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html#newcode1 third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html:1: <!DOCTYPE html> On 2016/12/19 at 20:01:51, pdr (OOO Dec ...
4 years ago (2016-12-19 20:16:23 UTC) #23
pdr.
4 years ago (2016-12-19 21:55:52 UTC) #24
Message was sent while issue was closed.
On 2016/12/19 at 20:16:23, fs wrote:
>
https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/Layo...
> File
third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html
(right):
> 
>
https://codereview.chromium.org/2590433002/diff/40001/third_party/WebKit/Layo...
>
third_party/WebKit/LayoutTests/svg/dom/integer-optional-integer-value-range.html:1:
<!DOCTYPE html>
> On 2016/12/19 at 20:01:51, pdr (OOO Dec 23 to Jan 2) wrote:
> > On 2016/12/19 at 19:54:54, fs wrote:
> > > On 2016/12/19 at 19:42:54, pdr (OOO Dec 23 to Jan 2) wrote:
> > > > Please don't rewrite this, but for future patches like this, can you try
creating unittests instead of layouttests?
> > > 
> > > The reason for adding a layout test here is because it's web exposed
behavior. I find that unit tests are not as well suitable for those types of
tests. (As an example, Gecko passes the first of tests but fails the second -
likely because they store a [clamped] float value. I've considered doing that as
well.)
> > 
> > In terms of web exposed behavior, unittests and layouttests should be
equivalent with a possible exception of running javascript. Do you mean that
it's just easier to test against firefox if we use an html file?
> 
> Yes, that's a large part of it. It also makes sure we don't miss to consider
any WebIDL behavior (easily forgotten in a unit test.)

cool, sgtm

Powered by Google App Engine
This is Rietveld 408576698