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

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

Issue 2650953004: Check isText() when editing traverses layout tree for ::first-letter (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
Index: third_party/WebKit/Source/core/editing/VisibleUnits.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index 6c84cce709433b1d60cfd067351462a395797e76..57d30becb90fca68d0ac7e085fd8c473508e7180 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -2698,9 +2698,10 @@ LayoutObject* associatedLayoutObjectOf(const Node& node, int offsetInNode) {
layoutTextFragment->firstLetterPseudoElement()->layoutObject();
// TODO(yosin): We're not sure when |firstLetterLayoutObject| has
// multiple child layout object.
- DCHECK_EQ(firstLetterLayoutObject->slowFirstChild(),
- firstLetterLayoutObject->slowLastChild());
- return firstLetterLayoutObject->slowFirstChild();
+ LayoutObject* child = firstLetterLayoutObject->slowFirstChild();
+ CHECK(child && child->isText());
+ DCHECK_EQ(child, firstLetterLayoutObject->slowLastChild());
+ return child;
}
int caretMinOffset(const Node* node) {

Powered by Google App Engine
This is Rietveld 408576698