Bug 48132 - Long lines in non-white-space-pre editable documents show cursor in wrong place
Summary: Long lines in non-white-space-pre editable documents show cursor in wrong place
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://marijnhaverbeke.nl/webkit_long...
Keywords:
Depends on: 52737 52778
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-22 07:41 PDT by Marijn Haverbeke
Modified: 2011-05-02 19:53 PDT (History)
13 users (show)

See Also:


Attachments
Using LogicalLayoutOverflow (800 bytes, patch)
2010-11-08 12:25 PST, Levi Weintraub
no flags Details | Formatted Diff | Diff
Patch (33.91 KB, patch)
2010-11-08 16:53 PST, Levi Weintraub
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marijn Haverbeke 2010-10-22 07:41:34 PDT
See the link I provided, and follow the instructions.

Basically, Webkit refuses to show the cursor sitting past the right edge of the screen in an editable document that is, in principle, line-wrapping, but has a line that can't be wrapped and creates a horizontal scrollbar.
Comment 1 Levi Weintraub 2010-11-08 12:25:06 PST
Created attachment 73265 [details]
Using LogicalLayoutOverflow

This bug happen because RenderText::localCaretRect snaps the caret rect to its containing RenderBlock's logicalLeft and logicalRight when in autoWrap content. logicalLeft and Right don't take into account overflow, so the caret is clipped to the logical bounds.
Comment 2 Levi Weintraub 2010-11-08 16:53:01 PST
Created attachment 73308 [details]
Patch
Comment 3 Darin Adler 2011-01-10 14:38:55 PST
Comment on attachment 73308 [details]
Patch

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

> LayoutTests/editing/selection/caret-painting-in-overflowing-autowrap-content.html:7
> +</body></html>
>  \ No newline at end of file

Normally we put a newline at the end of the file to avoid this.
Comment 4 Levi Weintraub 2011-01-10 14:40:50 PST
(In reply to comment #3)
> (From update of attachment 73308 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=73308&action=review
> 
> > LayoutTests/editing/selection/caret-painting-in-overflowing-autowrap-content.html:7
> > +</body></html>
> >  \ No newline at end of file
> 
> Normally we put a newline at the end of the file to avoid this.

Thanks for the review! I'll fix that to avoid the problem.
Comment 5 Levi Weintraub 2011-01-19 11:28:19 PST
Landed in r76144
Comment 6 WebKit Review Bot 2011-01-19 12:03:50 PST
http://trac.webkit.org/changeset/76144 might have broken SnowLeopard Intel Release (Tests)
Comment 7 Levi Weintraub 2011-01-19 18:03:44 PST
Committed r76187: <http://trac.webkit.org/changeset/76187>
Comment 8 Levi Weintraub 2011-01-19 18:04:28 PST
(In reply to comment #7)
> Committed r76187: <http://trac.webkit.org/changeset/76187>

Fixed the expected results as they were initially incorrect.
Comment 9 WebKit Review Bot 2011-01-19 19:14:11 PST
http://trac.webkit.org/changeset/76187 might have broken SnowLeopard Intel Release (Tests)
The following tests are not passing:
fast/forms/input-text-scroll-left-on-blur.html
Comment 10 Dmitry Titov 2011-01-19 21:03:31 PST
Rolled out in http://trac.webkit.org/changeset/76202

It broke fast/forms/input-text-scroll-left-on-blur.html on Snow Leopard bot: http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20%28Tests%29/builds/23925

Also, 4 existing tests failed (they all show caret in various forms) on all 3 platforms in Chromium:
http://build.chromium.org/p/chromium.webkit/builders/Webkit%20Linux/builds/28
http://build.chromium.org/p/chromium.webkit/builders/Webkit%20Mac10.5/builds/9
http://build.chromium.org/p/chromium.webkit/builders/Webkit%20Win/builds/13

I could have rebaselined those without you, but I was not sure the behavior change is right.
Sorry for second rollout, it'd be better to add those other tests into test_expectations.txt and watch the effects of the relanded patch until dust settles.
Comment 11 Levi Weintraub 2011-01-20 10:40:17 PST
(In reply to comment #10)
> Rolled out in http://trac.webkit.org/changeset/76202
> 
> It broke fast/forms/input-text-scroll-left-on-blur.html on Snow Leopard bot: http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20%28Tests%29/builds/23925

Darn! Sorry to be such a thorn in your side on this one. I'll get to the bottom of it, thanks again!
Comment 12 Levi Weintraub 2011-05-02 19:53:05 PDT
This was fixed in http://trac.webkit.org/changeset/84659 (from https://bugs.webkit.org/show_bug.cgi?id=49508)