Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: third_party/WebKit/Source/core/editing/CaretBase.cpp

Issue 2042153002: Check node->layoutObject in CaretBase::caretLayoutObject (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/CaretBase.cpp
diff --git a/third_party/WebKit/Source/core/editing/CaretBase.cpp b/third_party/WebKit/Source/core/editing/CaretBase.cpp
index 1b4a8f0db8493ee309eaced8f6f1e16349c86d6f..e4f5106a735e9c53443c9d4a8257daa9bac5aede 100644
--- a/third_party/WebKit/Source/core/editing/CaretBase.cpp
+++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp
@@ -64,6 +64,11 @@ LayoutBlock* CaretBase::caretLayoutObject(Node* node)
// if caretNode is a block and caret is inside it then caret should be painted by that block
bool paintedByBlock = layoutObject->isLayoutBlock() && caretRendersInsideNode(node);
+ // TODO(yoichio): This function is called at least
+ // DocumentLifeCycle::LayoutClean but caretRendersInsideNode above can
+ // layout. Thus |node->layoutObject()| can be changed then this is bad
+ // design. We should make caret painting algorithm clean.
+ CHECK_EQ(layoutObject, node->layoutObject()) << "Layout tree should not changed";
return paintedByBlock ? toLayoutBlock(layoutObject) : layoutObject->containingBlock();
}
@@ -128,6 +133,9 @@ IntRect CaretBase::absoluteBoundsForLocalRect(Node* node, const LayoutRect& rect
return caretPainter->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
}
+// TODO(yoichio): |node| is FrameSelection::m_previousCaretNode and this is bad
+// design. We should use only previous layoutObject or Rectangle to invalidate
+// old caret.
void CaretBase::invalidateLocalCaretRect(Node* node, const LayoutRect& rect)
{
LayoutBlockItem caretPainter = LayoutBlockItem(caretLayoutObject(node));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698