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

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

Issue 2636623002: Fix crash in localSelectionRectOfPositionTemplate() in VisibleUnits.cpp (Closed)
Patch Set: add a test 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 | third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7551fa9aca421a97db3626f5ab5ffe45be2a8c94..9f5b6c74d802bef024ec38d51b3bf9498a1c7b56 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -2566,6 +2566,9 @@ LayoutRect localSelectionRectOfPositionTemplate(
InlineBoxPosition boxPosition =
computeInlineBoxPosition(position.position(), position.affinity());
+ // |boxPosition.inlineBox| can be null. See http://crbug.com/680428.
+ if (!boxPosition.inlineBox)
+ return LayoutRect();
InlineTextBox* box = toInlineTextBox(boxPosition.inlineBox);
if (layoutObject->style()->isHorizontalWritingMode()) {
@@ -2598,6 +2601,13 @@ LayoutRect localCaretRectOfPosition(
position, layoutObject);
}
+LayoutRect localSelectionRectOfPosition(
yosin_UTC9 2017/01/18 05:37:50 This function doesn't relate to change of this pat
joone 2017/01/18 07:52:17 This function should have been added to the previo
+ const PositionInFlatTreeWithAffinity& position,
+ LayoutObject*& layoutObject) {
+ return localSelectionRectOfPositionTemplate<EditingInFlatTreeStrategy>(
+ position, layoutObject);
+}
+
static LayoutUnit boundingBoxLogicalHeight(LayoutObject* o,
const LayoutRect& rect) {
return o->style()->isHorizontalWritingMode() ? rect.height() : rect.width();
@@ -3288,6 +3298,12 @@ IntRect absoluteCaretBoundsOf(
visiblePosition);
}
+IntRect absoluteSelectionBoundsOf(
yosin_UTC9 2017/01/18 05:37:50 This function doesn't relate to change of this pat
joone 2017/01/18 07:52:17 Ditto.
+ const VisiblePositionInFlatTree& visiblePosition) {
+ return absoluteSelectionBoundsOfAlgorithm<EditingInFlatTreeStrategy>(
+ visiblePosition);
+}
+
template <typename Strategy>
static VisiblePositionTemplate<Strategy> skipToEndOfEditingBoundary(
const VisiblePositionTemplate<Strategy>& pos,
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698