RESOLVED FIXED 145393
Subpixel rendering: Pixel crack in text selection of simple text in <textarea>.
https://bugs.webkit.org/show_bug.cgi?id=145393
Summary Subpixel rendering: Pixel crack in text selection of simple text in <textarea>.
zalan
Reported 2015-05-26 15:40:42 PDT
1. Open <https://bugs.webkit.org/enter_bug.cgi?product=WebKit> 2. Paste "Inspector doesn't do this. I have been aware of this " (with trailing space) into Desc. 3. Select the "this " at the end. Notice the pixel crack between 'this' and ' '
Attachments
Patch (5.50 KB, patch)
2015-05-26 16:18 PDT, zalan
no flags
Archive of layout-test-results from ews102 for mac-mavericks (595.42 KB, application/zip)
2015-05-26 16:40 PDT, Build Bot
no flags
Patch (6.25 KB, patch)
2015-05-26 18:59 PDT, zalan
no flags
Patch (6.18 KB, patch)
2015-05-26 19:00 PDT, zalan
no flags
zalan
Comment 1 2015-05-26 15:40:58 PDT
zalan
Comment 2 2015-05-26 16:18:42 PDT
Build Bot
Comment 3 2015-05-26 16:40:47 PDT
Comment on attachment 253755 [details] Patch Attachment 253755 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5313444962107392 New failing tests: platform/mac/editing/input/caret-primary-bidi.html
Build Bot
Comment 4 2015-05-26 16:40:51 PDT
Created attachment 253758 [details] Archive of layout-test-results from ews102 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-mavericks Platform: Mac OS X 10.9.5
zalan
Comment 5 2015-05-26 18:59:25 PDT
zalan
Comment 6 2015-05-26 19:00:55 PDT
Darin Adler
Comment 7 2015-05-27 12:16:37 PDT
Comment on attachment 253768 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253768&action=review > Source/WebCore/ChangeLog:11 > + Float to LayoutUnit conversion is lossy. To ensure that selection > + painting always lines up (snaps) properly, the calculated width needs to > + be adjusted by ceiling the float to the next LayoutUnit value. What’s the default? To round instead of doing a ceil? I find this change really mysterious. When would we need to do this? Why do we have a default conversion from float to LayoutUnit if it’s not always the right thing to do?
zalan
Comment 8 2015-05-28 16:26:24 PDT
Comment on attachment 253768 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253768&action=review >> Source/WebCore/ChangeLog:11 >> + be adjusted by ceiling the float to the next LayoutUnit value. > > What’s the default? To round instead of doing a ceil? > > I find this change really mysterious. When would we need to do this? Why do we have a default conversion from float to LayoutUnit if it’s not always the right thing to do? The default behavior is explicit floor through integer arithmetics. LayoutUnit has int m_value which in case of LayoutUnit(float floatValue) becomes m_value = floatValue * 64. I assume the reason why we ended up with truncation was because of the potential performance impact (calling ceil() vs. integer arithmetics back then) and expect a few cases, truncated values just worked fine (we are talking about 1/64 of a pixel). ::fromFloatCeil() was introduced at the very beginning of the subpixel project when WebCore became LayoutUnit aware to compensate for the lossyness in cases where we have to ensure that the converted value is never smaller than the original (container sizing for example to prevent the content from getting wrapped). This is mainly the case for inline content as text measuring is float based and while transferring (width)values to block level, we have to make sure that the float -> LayoutUnit() conversion does not result in smaller container than its content's size.
WebKit Commit Bot
Comment 9 2015-05-28 17:15:43 PDT
Comment on attachment 253768 [details] Patch Clearing flags on attachment: 253768 Committed r184970: <http://trac.webkit.org/changeset/184970>
WebKit Commit Bot
Comment 10 2015-05-28 17:15:55 PDT
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 11 2015-05-28 19:47:22 PDT
This test fails on Windows, Gtk and Efl. Could you please update the results?
zalan
Comment 12 2015-05-29 08:23:19 PDT
(In reply to comment #11) > This test fails on Windows, Gtk and Efl. Could you please update the results? Thanks for the headsup. https://trac.webkit.org/changeset/184986
Note You need to log in before you can comment on or make changes to this bug.