Bug 131468

Summary: Subpixel rendering: RenderLayer's size is set using enclosingRect() which can result in cruft.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, kondapallykalyan, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

Description zalan 2014-04-09 17:38:46 PDT
when background color is present on a non-simple-container.
Comment 1 zalan 2014-04-20 16:22:44 PDT
Created attachment 229775 [details]
Patch
Comment 2 Darin Adler 2014-04-20 20:15:37 PDT
Comment on attachment 229775 [details]
Patch

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

> Source/WebCore/rendering/RenderLayerBacking.cpp:715
> +    * GraphicsLayer: device pixel positioned. Positioned is floored, size is ceiled.

I think this is a typo. “Position is floored”, is what you want. Also, it should be either “ceil’d” or “ceilinged”.

It seems to me that combining “position is floored” with “size is ceilinged” could result in incorrect behavior. If the position was 0.95 and the size was 0.1, then the floored position would be 0, the ceillinged size would be 1, and the right would be 1, but the right of the original would be 1.05.
Comment 3 zalan 2014-04-20 20:44:31 PDT
(In reply to comment #2)
> (From update of attachment 229775 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=229775&action=review
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:715
> > +    * GraphicsLayer: device pixel positioned. Positioned is floored, size is ceiled.
> 
> I think this is a typo. “Position is floored”, is what you want. Also, it should be either “ceil’d” or “ceilinged”.
Thanks, indeed! (I was just following the 'ceiled' term introduced for LayoutUnit rounding functions by the original subpixel code, but I agree that I should use proper English terms in comments.) 

> It seems to me that combining “position is floored” with “size is ceilinged” could result in incorrect behavior. If the position was 0.95 and the size was 0.1, then the floored position would be 0, the ceillinged size would be 1, and the right would be 1, but the right of the original would be 1.05.
I need to fix these comments! We call floor on minX, minY corner, while ceil on the maxX, maxY, so your example results (0, 0) (2, 2) on a 1x display while (0.5, 0.5) (1.5, 1.5) on a retina display.
Comment 4 zalan 2014-04-20 22:22:12 PDT
Committed r167582: <http://trac.webkit.org/changeset/167582>