Index: Source/core/editing/FrameSelection.cpp |
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp |
index 55db7b776bc49c8f96fb84cccf87fef731630808..382c3ddf8a6a40c23d47edecbd59ee823a08f78b 100644 |
--- a/Source/core/editing/FrameSelection.cpp |
+++ b/Source/core/editing/FrameSelection.cpp |
@@ -1222,13 +1222,22 @@ static bool isNonOrphanedCaret(const VisibleSelection& selection) |
return selection.isCaret() && !selection.start().isOrphan() && !selection.end().isOrphan(); |
} |
+static bool isTextFormControl(const VisibleSelection& selection) |
+{ |
+ return !!enclosingTextFormControl(selection.start()); |
yosin_UTC9
2014/07/29 07:00:20
nit: I don't think we need to use |!!| for casting
yoichio
2014/07/29 08:05:17
Done.
|
+} |
+ |
LayoutRect FrameSelection::localCaretRect() |
{ |
if (shouldUpdateCaretRect()) { |
- if (!isNonOrphanedCaret(m_selection)) |
+ if (!isNonOrphanedCaret(m_selection)) { |
clearCaretRect(); |
- else if (updateCaretRect(m_frame->document(), VisiblePosition(m_selection.start(), m_selection.affinity()))) |
- m_absCaretBoundsDirty = true; |
+ } else { |
+ if (isTextFormControl(m_selection)) |
yosin_UTC9
2014/07/29 07:00:20
nit: We can combine |else| and |if|.
yoichio
2014/07/29 08:05:17
Done.
|
+ m_absCaretBoundsDirty |= updateCaretRect(m_frame->document(), PositionWithAffinity(m_selection.start().isCandidate() ? m_selection.start() : Position(), m_selection.affinity())); |
yosin_UTC9
2014/07/29 07:00:20
Q: Why do we need to check |start()| is editable p
yoichio
2014/07/29 08:05:17
updateCaretRect suppose that an argument Visible p
|
+ else |
+ m_absCaretBoundsDirty |= updateCaretRect(m_frame->document(), VisiblePosition(m_selection.start(), m_selection.affinity())); |
+ } |
} |
return localCaretRectWithoutUpdate(); |