RESOLVED FIXED 13153
REGRESSION: Visual highlighting of pre-populated blank line in textarea is broken
https://bugs.webkit.org/show_bug.cgi?id=13153
Summary REGRESSION: Visual highlighting of pre-populated blank line in textarea is br...
David Kilzer (:ddkilzer)
Reported 2007-03-21 21:20:01 PDT
Summary: When a <textarea> element is pre-populated with content, and that content includes blank lines, it's not possible to see the entire blank highlighted until the next character is selected. Steps to reproduce: 1. Open Safari/WebKit. 2. Open test case (to be posted soon). 3. Tab into the textarea after the page loads. (Not required; you may click the mouse to get an insertion pointer on the first line.) 4. Hold down the shift key, then hit the down arrow once. Expected results: The entire first line of the textarea should be highlighted because it's blank. Actual results: Nothing on the first line is highlighted. Regression: This is a regression from shipping Safari 2.0.4 (419.3) on Mac OS X 10.4.9 (8P135). Tested with a local debug build of WebKit r20375 with the above software. Notes: - The content is actually selected, but the highlight doesn't paint correctly. - Deleting the pre-populated content and retyping it will make the blank line highlightable.
Attachments
Test case (26 bytes, text/html)
2007-03-21 21:20 PDT, David Kilzer (:ddkilzer)
no flags
Highlight hard line breaks when their beginning is selected (58.61 KB, patch)
2007-03-23 07:45 PDT, mitz
adele: review+
David Kilzer (:ddkilzer)
Comment 1 2007-03-21 21:20:56 PDT
Created attachment 13757 [details] Test case
Mark Rowe (bdash)
Comment 2 2007-03-21 22:31:17 PDT
mitz
Comment 3 2007-03-23 02:56:33 PDT
The root cause is the way pre-wrapped text behaves in WebCore. If you take something like <pre> foo </pre> and double- or triple-click the first (empty) line, nothing will be highlighted. Similarly if you triple-click "foo" only "foo" will be highlighted, not the entire line. When you enter the text manually, <br> elements are generated for the empty lines. Those highlight correctly.
mitz
Comment 4 2007-03-23 02:58:00 PDT
Another place where this behavior constitutes a regression is plain-text documents :-)
mitz
Comment 5 2007-03-23 07:45:05 PDT
Created attachment 13779 [details] Highlight hard line breaks when their beginning is selected Includes a pixel test, updated pixel results and change log entries. Fixes this bug and another bug (also covered by the test) where the highlight did not extend to the end of the line if there were skipped spaces.
Adele Peterson
Comment 6 2007-03-23 21:55:32 PDT
Committed revision 20459
Note You need to log in before you can comment on or make changes to this bug.