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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 2672743002: android: Fix crash in blink::LayoutText::localCaretRect() (Closed)
Patch Set: Created 3 years, 11 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/layout/LayoutText.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp
index 8920eabe57c990ce87f7fb7ec84b112a32f82385..5b8de4d5aca83c20aaefd844e32be4bea10545f3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -755,6 +755,9 @@ LayoutRect LayoutText::localCaretRect(InlineBox* inlineBox,
// Get caret height from a font of character.
const ComputedStyle* styleToUse =
caretBox->getLineLayoutItem().style(caretBox->isFirstLineStyle());
+ if (!styleToUse->font().primaryFont())
+ return LayoutRect();
+
int height = styleToUse->font().primaryFont()->getFontMetrics().height();
int top = caretBox->logicalTop().toInt();
« 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