WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
103984
IntSize::scale() should return rounded value
https://bugs.webkit.org/show_bug.cgi?id=103984
Summary
IntSize::scale() should return rounded value
Mikhail Pozdnyakov
Reported
2012-12-04 01:32:37 PST
Currently IntSize::scale() just casts 'float' result to 'int' loosing all the data after '.' instead of rounding the float value to the nearest integer. For example scaling (10, 10) by 0.999999 will result (9,9). Also it's causing flakiness of css3/device-adapt/viewport-width-not-affecting-next-page.html on WK2 EFL.
Attachments
patch
(3.28 KB, patch)
2012-12-04 01:38 PST
,
Mikhail Pozdnyakov
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Mikhail Pozdnyakov
Comment 1
2012-12-04 01:38:56 PST
Created
attachment 177447
[details]
patch
Kenneth Rohde Christiansen
Comment 2
2012-12-04 01:45:15 PST
Comment on
attachment 177447
[details]
patch I assume you ran layout tests and checked other call sites
Dominik Röttsches (drott)
Comment 3
2012-12-04 02:35:28 PST
(In reply to
comment #0
)
> Currently IntSize::scale() just casts 'float' result to 'int' loosing all the data after '.' instead of > rounding the float value to the nearest integer. For example scaling (10, 10) by 0.999999 will result (9,9). > Also it's causing flakiness of css3/device-adapt/viewport-width-not-affecting-next-page.html on WK2 EFL.
Should the viewport code maybe use LayoutUnits instead? (without knowing much about it).
Mikhail Pozdnyakov
Comment 4
2012-12-04 03:28:44 PST
(In reply to
comment #2
)
> (From update of
attachment 177447
[details]
) > I assume you ran layout tests and checked other call sites
Some EWS bots (chromium at least) check layout tests as well. Anyway I've just run the tests locally and did not discover regressions.
WebKit Review Bot
Comment 5
2012-12-04 07:42:39 PST
Comment on
attachment 177447
[details]
patch Clearing flags on attachment: 177447 Committed
r136509
: <
http://trac.webkit.org/changeset/136509
>
WebKit Review Bot
Comment 6
2012-12-04 07:42:42 PST
All reviewed patches have been landed. Closing bug.
Emil A Eklund
Comment 7
2012-12-04 09:27:47 PST
This change broke at least 12 tests. Most of them seem harmless but this one is worrying as it changes how the image is aligned:
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=fast%2Fbackgrounds%2Fsize%2Fcontain-and-cover-zoomed.html
Darin Adler
Comment 8
2012-12-04 09:45:35 PST
This is a really low level change to make. We have to look at every call site and make sure that rounding is desired. It wasn’t an accident before that this function truncated; how did we determine call sites did not depend on that?
Darin Adler
Comment 9
2012-12-04 09:46:34 PST
A much safer change would be to rename scale to describe the rounding vs. truncating behavior and possibly splitting it into more than one function if callers need more than one kind of behavior. If there are many tests broken, this should be rolled out and the change should be redone more carefully.
Emil A Eklund
Comment 10
2012-12-04 09:58:21 PST
I'm with Darin on this one. Unless I hear back from either of you in the next hour or so I'll rollout this change.
Kenneth Rohde Christiansen
Comment 11
2012-12-04 10:41:41 PST
Fine with me, please roll out. As I wrote before "I assume you ran layout tests and checked other call sites"
WebKit Review Bot
Comment 12
2012-12-04 10:46:04 PST
Re-opened since this is blocked by
bug 104015
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