Bug 82540

Summary: Fix rounding in RenderInline::paintOutlineForLine
Product: WebKit Reporter: Emil A Eklund <eae>
Component: Layout and RenderingAssignee: Emil A Eklund <eae>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, jchaffraix, leviw, simon.fraser, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 60318    
Attachments:
Description Flags
Patch
eric: review+
Patch
webkit.review.bot: commit-queue-
Patch for landing none

Description Emil A Eklund 2012-03-28 15:17:51 PDT
Currently some of the values are computed by adding an offset to a rounded value. Instead we should always round (or pixel snap) as the very last step.
Comment 1 Emil A Eklund 2012-03-28 15:21:49 PDT
Created attachment 134420 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-03-28 15:46:05 PDT
Comment on attachment 134420 [details]
Patch

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

LGTM.

> Source/WebCore/ChangeLog:8
> +        No new tests.

Why is always more important than what. :)
Comment 3 Eric Seidel (no email) 2012-03-28 15:46:33 PDT
Comment on attachment 134420 [details]
Patch

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

> Source/WebCore/rendering/RenderInline.cpp:1473
> +    int pixelSnappedLastLineLeft = roundToInt(paintOffset.x() + lastline.x());
> +    int pixelSnappedLastLineRight = snapSizeToPixel(lastline.width(), paintOffset.x() + lastline.x()) + pixelSnappedLastLineLeft;
> +
> +    int pixelSnappedNextLineLeft = roundToInt(paintOffset.x() + nextline.x());
> +    int pixelSnappedNextLineRight = snapSizeToPixel(nextline.width(), paintOffset.x() + nextline.x()) + pixelSnappedNextLineLeft;

I'm a little surprised we don't get these from an object, like some rect for the line...
Comment 4 Emil A Eklund 2012-03-28 15:57:29 PDT
(In reply to comment #3)
> (From update of attachment 134420 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=134420&action=review
> 
> > Source/WebCore/rendering/RenderInline.cpp:1473
> > +    int pixelSnappedLastLineLeft = roundToInt(paintOffset.x() + lastline.x());
> > +    int pixelSnappedLastLineRight = snapSizeToPixel(lastline.width(), paintOffset.x() + lastline.x()) + pixelSnappedLastLineLeft;
> > +
> > +    int pixelSnappedNextLineLeft = roundToInt(paintOffset.x() + nextline.x());
> > +    int pixelSnappedNextLineRight = snapSizeToPixel(nextline.width(), paintOffset.x() + nextline.x()) + pixelSnappedNextLineLeft;
> 
> I'm a little surprised we don't get these from an object, like some rect for the line...

How do you mean? Compute a rect for each line and use that instead?


> Why is always more important than what. :)

Good point, I'll make sure to update the ChangeLog before I commit.
Comment 5 Eric Seidel (no email) 2012-03-28 16:14:32 PDT
Comment on attachment 134420 [details]
Patch

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

>>> Source/WebCore/rendering/RenderInline.cpp:1473
>>> +    int pixelSnappedNextLineRight = snapSizeToPixel(nextline.width(), paintOffset.x() + nextline.x()) + pixelSnappedNextLineLeft;
>> 
>> I'm a little surprised we don't get these from an object, like some rect for the line...
> 
> How do you mean? Compute a rect for each line and use that instead?

Honestly, I dont' have a clear suggestion, as I haven't fully paged in this code.  But it seems like these are minX(), maxX() on LayoutRect?
Comment 6 Emil A Eklund 2012-03-28 16:16:52 PDT
(In reply to comment #5)
> Honestly, I dont' have a clear suggestion, as I haven't fully paged in this code.  But it seems like these are minX(), maxX() on LayoutRect?

Correct. I suppose we could use a rect for this and ignore the y axis.
Comment 7 Emil A Eklund 2012-03-28 18:23:06 PDT
Created attachment 134463 [details]
Patch
Comment 8 WebKit Review Bot 2012-03-28 18:34:11 PDT
Comment on attachment 134463 [details]
Patch

Rejecting attachment 134463 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1

ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://queues.webkit.org/results/12194031
Comment 9 Emil A Eklund 2012-03-28 18:36:14 PDT
Created attachment 134465 [details]
Patch for landing
Comment 10 WebKit Review Bot 2012-03-28 19:11:59 PDT
Comment on attachment 134465 [details]
Patch for landing

Clearing flags on attachment: 134465

Committed r112492: <http://trac.webkit.org/changeset/112492>
Comment 11 WebKit Review Bot 2012-03-28 19:12:03 PDT
All reviewed patches have been landed.  Closing bug.