Bug 132164

Summary: Subpixel rendering: Inline text selection painting should not snap to integral CSS pixel position.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, esprehn+autocc, glenn, kondapallykalyan, mitz, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description zalan 2014-04-24 19:28:59 PDT
ssia. patch is coming up.
Comment 1 zalan 2014-04-24 19:40:08 PDT
Created attachment 230131 [details]
Patch
Comment 2 Darin Adler 2014-04-29 09:02:46 PDT
Comment on attachment 230131 [details]
Patch

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

I wish I understood the difference between “rounding” and “pixel snapping”.

> Source/WebCore/rendering/EllipsisBox.cpp:140
> +    FloatRect clipRect = pixelSnappedForPainting(x() + paintOffset.x(), top + paintOffset.y(), m_logicalWidth, h, renderer().document().deviceScaleFactor());
> +
>      context->clip(clipRect);

Not sure we need a local variable for this.

> Source/WebCore/rendering/InlineTextBox.cpp:760
> +    LayoutUnit selHeight = std::max<LayoutUnit>(0, selectionBottom - selectionTop);

Might be nice to use the word “selection” instead of the abbreviation “sel” here.

> Source/WebCore/rendering/InlineTextBox.cpp:765
> +    FloatRect clipRect = pixelSnappedForPainting(LayoutRect(LayoutPoint(localOrigin), LayoutSize(m_logicalWidth, selHeight)), deviceScaleFactor);
>      context->clip(clipRect);

Not sure we need a local variable for this.

> Source/WebCore/rendering/InlineTextBox.h:199
>  INLINE_BOX_OBJECT_TYPE_CASTS(InlineTextBox, isInlineTextBox())
> -
> -void alignSelectionRectToDevicePixels(FloatRect&);
> -
>  } // namespace WebCore

Should leave a blank line here.
Comment 3 zalan 2014-04-30 17:25:56 PDT
Created attachment 230545 [details]
Patch
Comment 4 zalan 2014-04-30 17:26:13 PDT
Comment on attachment 230545 [details]
Patch

EWS testing.
Comment 5 zalan 2014-04-30 17:31:19 PDT
(In reply to comment #2)
> (From update of attachment 230131 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=230131&action=review
> 
> I wish I understood the difference between “rounding” and “pixel snapping”.
Nothing, they both round. It is indeed confusing and I am planning to cleanup and fix all these different/legacy terms soon after I removed the compile time flag for subpixel layout.
Comment 6 WebKit Commit Bot 2014-05-01 06:32:14 PDT
Comment on attachment 230545 [details]
Patch

Clearing flags on attachment: 230545

Committed r168095: <http://trac.webkit.org/changeset/168095>
Comment 7 WebKit Commit Bot 2014-05-01 06:32:19 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 mitz 2014-05-02 11:33:07 PDT
(In reply to comment #6)
> (From update of attachment 230545 [details])
> Clearing flags on attachment: 230545
> 
> Committed r168095: <http://trac.webkit.org/changeset/168095>

This caused bug 132474.
Comment 9 zalan 2014-05-02 11:36:44 PDT
(In reply to comment #8)
> (In reply to comment #6)
> > (From update of attachment 230545 [details] [details])
> > Clearing flags on attachment: 230545
> > 
> > Committed r168095: <http://trac.webkit.org/changeset/168095>
> 
> This caused bug 132474.
This patch made the inline text snapping errors visible for selections. It gets fixed when inline texts start setting its position properly on device pixels.