[webkit-changes] cvs commit: WebCore/khtml/rendering render_text.cpp
David
harrison at opensource.apple.com
Mon Jun 27 12:12:34 PDT 2005
harrison 05/06/27 12:12:34
Modified: . ChangeLog
khtml/rendering render_text.cpp
Log:
Reviewed by Ken.
Test cases added: None because this relies on mouse clicking.
<rdar://problem/4140688> assertion failure double-clicking text to select
* khtml/rendering/render_text.cpp:
(RenderText::positionForCoordinates):
Use setAffinityUsingLinePosition.
Revision Changes Path
1.4318 +12 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4317
retrieving revision 1.4318
diff -u -r1.4317 -r1.4318
--- ChangeLog 25 Jun 2005 17:21:53 -0000 1.4317
+++ ChangeLog 27 Jun 2005 19:12:30 -0000 1.4318
@@ -1,3 +1,15 @@
+2005-06-27 David Harrison <harrison at apple.com>
+
+ Reviewed by Ken.
+
+ Test cases added: None because this relies on mouse clicking.
+
+ <rdar://problem/4140688> assertion failure double-clicking text to select
+
+ * khtml/rendering/render_text.cpp:
+ (RenderText::positionForCoordinates):
+ Use setAffinityUsingLinePosition.
+
2005-06-25 Darin Adler <darin at apple.com>
- updated a layout test so that it doesn't depend on a remote resource via http
1.183 +8 -4 WebCore/khtml/rendering/render_text.cpp
Index: render_text.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_text.cpp,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -r1.182 -r1.183
--- render_text.cpp 27 May 2005 20:54:21 -0000 1.182
+++ render_text.cpp 27 Jun 2005 19:12:34 -0000 1.183
@@ -954,8 +954,9 @@
// check to see if position goes in this box
int offset = box->offsetForPosition(_x - absx);
if (offset != -1) {
- EAffinity affinity = offset >= box->m_len && !box->nextOnLine() ? UPSTREAM : DOWNSTREAM;
- return VisiblePosition(element(), offset + box->m_start, affinity);
+ VisiblePosition result = VisiblePosition(element(), offset + box->m_start, UPSTREAM);
+ setAffinityUsingLinePosition(result);
+ return result;
}
}
else if (!box->prevOnLine() && _x < absx + box->m_x) {
@@ -963,10 +964,13 @@
// and the x coordinate is to the left of the first text box left edge
return VisiblePosition(element(), box->m_start, DOWNSTREAM);
}
- else if (!box->nextOnLine() && _x >= absx + box->m_x + box->m_width)
+ else if (!box->nextOnLine() && _x >= absx + box->m_x + box->m_width) {
// box is last on line
// and the x coordinate is to the right of the last text box right edge
- return VisiblePosition(element(), box->m_start + box->m_len, UPSTREAM);
+ VisiblePosition result = VisiblePosition(element(), box->m_start + box->m_len, UPSTREAM);
+ setAffinityUsingLinePosition(result);
+ return result;
+ }
}
}
More information about the webkit-changes
mailing list