Bug 91061 - Incorrect rounding in ceiledLayoutUnit and roundedLayoutUnit
Summary: Incorrect rounding in ceiledLayoutUnit and roundedLayoutUnit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Allan Sandfeld Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-12 02:17 PDT by Allan Sandfeld Jensen
Modified: 2012-07-25 09:45 PDT (History)
5 users (show)

See Also:


Attachments
Patch (3.62 KB, patch)
2012-07-12 02:26 PDT, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Sandfeld Jensen 2012-07-12 02:17:02 PDT
When subpixel layout is enabled, the two functions ceiledLayoutUnit and roundedLayoutUnit  both returns the flooredLayoutUnit instead of ceiled or rounded values. 

The function FractionalUnit::fromFloatCeil was recently added to solve the same problem in updatePreferredWidth in RenderBlock.cpp, and can be reused to fix ceiledLayoutUnit.
Comment 1 Allan Sandfeld Jensen 2012-07-12 02:26:25 PDT
Created attachment 151892 [details]
Patch
Comment 2 Emil A Eklund 2012-07-12 11:10:19 PDT
Comment on attachment 151892 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=151892&action=review

Good catch, thank you!

> Source/WebCore/platform/FractionalLayoutUnit.h:97
> +    static FractionalLayoutUnit fromFloatRound(float value)

We probably want to assert that the value is in bounds here too.
Comment 3 Allan Sandfeld Jensen 2012-07-12 11:37:51 PDT
(In reply to comment #2)
> (From update of attachment 151892 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=151892&action=review
> 
> Good catch, thank you!
> 
> > Source/WebCore/platform/FractionalLayoutUnit.h:97
> > +    static FractionalLayoutUnit fromFloatRound(float value)
> 
> We probably want to assert that the value is in bounds here too.

I believe in this case the values are asserted to be in bounds in the constructor, so I don't think we need to assert it in the fromFloatRound function.
Comment 4 Emil A Eklund 2012-07-16 13:21:47 PDT
(In reply to comment #3)
> I believe in this case the values are asserted to be in bounds in the constructor, so I don't think we need to assert it in the fromFloatRound function.

You are right, that should be enough. Thanks.
Comment 5 Adam Barth 2012-07-25 08:46:41 PDT
Comment on attachment 151892 [details]
Patch

rs=me based on eae's unofficial review.
Comment 6 WebKit Review Bot 2012-07-25 09:45:39 PDT
Comment on attachment 151892 [details]
Patch

Clearing flags on attachment: 151892

Committed r123626: <http://trac.webkit.org/changeset/123626>
Comment 7 WebKit Review Bot 2012-07-25 09:45:43 PDT
All reviewed patches have been landed.  Closing bug.