VERIFIED FIXED 8089
REGRESSION: Caret position is off in native text field with text-align:right
https://bugs.webkit.org/show_bug.cgi?id=8089
Summary REGRESSION: Caret position is off in native text field with text-align:right
mitz
Reported 2006-03-30 12:52:39 PST
In a new text field with text-align: right, the caret is positioned 1 pixel to the right of where it is supposed to be when the field is empty, and 1 pixel to the left when the field contains text (which is 2px to the left from the initial position).
Attachments
patch with detailed change log (7.33 KB, patch)
2006-04-01 15:16 PST, Darin Adler
mjs: review+
Darin Adler
Comment 1 2006-04-01 13:39:38 PST
Looking at the behavior it seems that it's correct when there is text. I looked at it side by side with an LTR field and it seems to be fine. So I'll try to fix the bug about where it is without the text.
Darin Adler
Comment 2 2006-04-01 13:46:07 PST
I assume the relevant function is RenderBox::caretRect.
Darin Adler
Comment 3 2006-04-01 14:36:43 PST
No, turns out it's RenderFlow::caretRect.
Darin Adler
Comment 4 2006-04-01 14:42:14 PST
The code wasn't taking into account the width of the caret itself. But once I added code to do that, we end up with what Mitz called the right result, which unfortunately is one pixel to the right of what we get once we start typing. Working on it.
Darin Adler
Comment 5 2006-04-01 14:59:09 PST
1px was the width of the caret, 1px was the padding.
Darin Adler
Comment 6 2006-04-01 15:16:20 PST
Created attachment 7449 [details] patch with detailed change log
Maciej Stachowiak
Comment 7 2006-04-01 15:58:26 PST
Comment on attachment 7449 [details] patch with detailed change log r=me
mitz
Comment 8 2006-04-04 01:52:26 PDT
Verified in r13675 nightly.
Note You need to log in before you can comment on or make changes to this bug.