[webkit-changes] cvs commit: WebCore/khtml/editing
SelectionController.cpp SelectionController.h
Justin
justing at opensource.apple.com
Tue Nov 1 14:29:20 PST 2005
justing 05/11/01 14:29:20
Modified: . ChangeLog
khtml/editing SelectionController.cpp SelectionController.h
Log:
Reviewed by harrison
Tweaked my previous fix for caret movement while scrolling.
* khtml/editing/SelectionController.cpp:
(khtml::SelectionController::SelectionController): Forgot to copy m_caretPositionOnLayout.
(khtml::SelectionController::operator=): Ditto.
(khtml::SelectionController::layout): Initialize m_caretPositionOnLayout to a dummy value when the selection isNone.
* khtml/editing/SelectionController.h: Tweaked my comment.
Revision Changes Path
1.325 +12 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.324
retrieving revision 1.325
diff -u -r1.324 -r1.325
--- ChangeLog 1 Nov 2005 19:20:40 -0000 1.324
+++ ChangeLog 1 Nov 2005 22:29:15 -0000 1.325
@@ -1,5 +1,17 @@
2005-11-01 Justin Garcia <justin.garcia at apple.com>
+ Reviewed by harrison
+
+ Tweaked my previous fix for caret movement while scrolling.
+
+ * khtml/editing/SelectionController.cpp:
+ (khtml::SelectionController::SelectionController): Forgot to copy m_caretPositionOnLayout.
+ (khtml::SelectionController::operator=): Ditto.
+ (khtml::SelectionController::layout): Initialize m_caretPositionOnLayout to a dummy value when the selection isNone.
+ * khtml/editing/SelectionController.h: Tweaked my comment.
+
+2005-11-01 Justin Garcia <justin.garcia at apple.com>
+
Reviewed by darin
Fixes <rdar://problem/4074536> Seed: Mail crash adjusting quote level - KHTMLPart::computeAndSetTypingStyle
1.100 +4 -0 WebCore/khtml/editing/SelectionController.cpp
Index: SelectionController.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/SelectionController.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- SelectionController.cpp 1 Nov 2005 19:04:21 -0000 1.99
+++ SelectionController.cpp 1 Nov 2005 22:29:19 -0000 1.100
@@ -117,6 +117,7 @@
// and the old rectangle needs to be repainted.
if (!m_needsLayout) {
m_caretRect = o.m_caretRect;
+ m_caretPositionOnLayout = o.m_caretPositionOnLayout;
}
}
@@ -151,6 +152,7 @@
// and the old rectangle needs to be repainted.
if (!m_needsLayout) {
m_caretRect = o.m_caretRect;
+ m_caretPositionOnLayout = o.m_caretPositionOnLayout;
}
return *this;
@@ -667,12 +669,14 @@
{
if (isNone() || !m_start.node()->inDocument() || !m_end.node()->inDocument()) {
m_caretRect = QRect();
+ m_caretPositionOnLayout = QPoint();
return;
}
m_start.node()->getDocument()->updateRendering();
m_caretRect = QRect();
+ m_caretPositionOnLayout = QPoint();
if (isCaret()) {
Position pos = m_start;
1.44 +5 -2 WebCore/khtml/editing/SelectionController.h
Index: SelectionController.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/SelectionController.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- SelectionController.h 1 Nov 2005 19:04:21 -0000 1.43
+++ SelectionController.h 1 Nov 2005 22:29:19 -0000 1.44
@@ -145,8 +145,11 @@
EAffinity m_affinity; // the upstream/downstream affinity of the selection
QRect m_caretRect; // caret coordinates, size, and position
- QPoint m_caretPositionOnLayout; // When asked for caretRect(), we correct m_caretRect for offset due to scrolling.
- // This is faster than recalcuating m_caretRect.
+
+ // m_caretPositionOnLayout stores the scroll offset on the previous call to SelectionController::layout().
+ // When asked for caretRect(), we correct m_caretRect for offset due to scrolling since the last layout().
+ // This is faster than doing another layout().
+ QPoint m_caretPositionOnLayout;
bool m_baseIsStart : 1; // true if base node is before the extent node
bool m_needsLayout : 1; // true if the caret and expectedVisible rectangles need to be calculated
More information about the webkit-changes
mailing list