Fix for this bug:
<rdar://problem/
3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
* khtml/rendering/render_text.cpp:
(RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8182
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2004-12-10 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by John
+
+ Fix for this bug:
+
+ <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
+
+ * khtml/rendering/render_text.cpp:
+ (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
+
2004-12-10 Ken Kocienda <kocienda@apple.com>
Reviewed by John
// Find the text box for the given offset
InlineTextBox *box = 0;
for (box = firstTextBox(); box; box = box->nextTextBox()) {
- if (affinity == DOWNSTREAM && offset == box->m_start + box->m_len) {
- // We're at the end of a line and affinity is downstream.
+ int pastEnd = box->m_start + box->m_len + 1;
+ InlineTextBox *nextBox = box->nextTextBox();
+ if (affinity == DOWNSTREAM && nextBox && !box->nextOnLine() &&
+ offset == pastEnd && nextBox->m_start != pastEnd) {
+ // We're at the end of a line broken on a word boundary and affinity is downstream.
// Try to jump down to the next line.
if (box->nextTextBox()) {
// Use the next text box