Summary: | Subpixel rendering: Inline text selection painting should not snap to integral CSS pixel position. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | zalan <zalan> | ||||||
Component: | Layout and Rendering | Assignee: | 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
zalan
2014-04-24 19:28:59 PDT
Created attachment 230131 [details]
Patch
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. Created attachment 230545 [details]
Patch
Comment on attachment 230545 [details]
Patch
EWS testing.
(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 on attachment 230545 [details] Patch Clearing flags on attachment: 230545 Committed r168095: <http://trac.webkit.org/changeset/168095> All reviewed patches have been landed. Closing bug. (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. (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. |