Bug 80881

Summary: Implement proper sub-pixel support in RenderFileUploadControl
Product: WebKit Reporter: Levi Weintraub <leviw>
Component: Layout and RenderingAssignee: Levi Weintraub <leviw>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, eae, eric, jchaffraix, simon.fraser, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 60318    
Attachments:
Description Flags
Patch
none
Patch none

Description Levi Weintraub 2012-03-12 13:49:47 PDT
We currently do some improper truncating and promoting of LayoutUnits to floats without pixel snapping in RenderFileUploadControl.
Comment 1 Levi Weintraub 2012-03-12 14:16:07 PDT
Created attachment 131406 [details]
Patch
Comment 2 Emil A Eklund 2012-03-12 14:21:31 PDT
Comment on attachment 131406 [details]
Patch

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

> Source/WebCore/rendering/RenderFileUploadControl.cpp:107
> +        IntRect clipRect = pixelSnappedIntRect(LayoutRect(paintOffset.x() + borderLeft(), paintOffset.y() + borderTop(),

Isn't there a pixelSnappedIntRect implementation that takes x, y, w, h? Seems better than creating a LayoutRect and then immediately snapping it.

> Source/WebCore/rendering/RenderFileUploadControl.cpp:157
> +            input->icon()->paint(paintInfo.context, IntRect(roundedIntPoint(LayoutPoint(iconX, iconY)), IntSize(iconWidth, iconHeight)));

IntRect(iconX.round(), iconY.round(), iconWidth, iconHeight) seems easier.
Comment 3 Levi Weintraub 2012-03-12 14:27:50 PDT
Created attachment 131413 [details]
Patch
Comment 4 Emil A Eklund 2012-03-12 14:30:50 PDT
Looks good, thanks!
Comment 5 Levi Weintraub 2012-03-14 10:38:28 PDT
Any takers on a review?
Comment 6 Dimitri Glazkov (Google) 2012-03-14 13:54:31 PDT
Comment on attachment 131413 [details]
Patch

ok
Comment 7 Levi Weintraub 2012-03-14 14:14:18 PDT
Comment on attachment 131413 [details]
Patch

Thanks for the review, Mr. Glazkov :)
Comment 8 WebKit Review Bot 2012-03-14 15:02:17 PDT
Comment on attachment 131413 [details]
Patch

Clearing flags on attachment: 131413

Committed r110761: <http://trac.webkit.org/changeset/110761>
Comment 9 WebKit Review Bot 2012-03-14 15:02:22 PDT
All reviewed patches have been landed.  Closing bug.