Bug 80881 - Implement proper sub-pixel support in RenderFileUploadControl
Summary: Implement proper sub-pixel support in RenderFileUploadControl
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Levi Weintraub
URL:
Keywords:
Depends on:
Blocks: 60318
  Show dependency treegraph
 
Reported: 2012-03-12 13:49 PDT by Levi Weintraub
Modified: 2012-03-14 15:02 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.80 KB, patch)
2012-03-12 14:16 PDT, Levi Weintraub
no flags Details | Formatted Diff | Diff
Patch (3.63 KB, patch)
2012-03-12 14:27 PDT, Levi Weintraub
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.