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

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

Issue 1972523002: [asan][Editing] Check node->layoutObject in CaretBase::caretLayoutObject (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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..3a37af5290f8c760a08312865f05a3cee73e52fe 100644
--- a/third_party/WebKit/Source/core/editing/CaretBase.cpp
+++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp
@@ -64,6 +64,8 @@ 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);
+ // caretRendersInsideNode can layout
+ layoutObject = node->layoutObject();
yosin_UTC9 2016/05/12 06:55:31 We can't explain what this line does. When layout
yosin_UTC9 2016/05/24 08:40:18 Could you change this to below? // TODO(yoichio):
yoichio 2016/05/25 06:46:50 Done.
return paintedByBlock ? toLayoutBlock(layoutObject) : layoutObject->containingBlock();
}
@@ -128,6 +130,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