Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/FindInPageCoordinates.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/FindInPageCoordinates.cpp b/third_party/WebKit/Source/core/editing/FindInPageCoordinates.cpp |
| index f09f593b58fefd3e0cc77bdbd5a08c49fa9b5d21..264ed7d90800f6a9d26556a3444c293f339823dc 100644 |
| --- a/third_party/WebKit/Source/core/editing/FindInPageCoordinates.cpp |
| +++ b/third_party/WebKit/Source/core/editing/FindInPageCoordinates.cpp |
| @@ -146,13 +146,17 @@ FloatRect FindInPageRectFromAbsoluteRect( |
| return normalized_rect; |
| } |
| -FloatRect FindInPageRectFromRange(Range* range) { |
| - if (!range || !range->FirstNode()) |
| +FloatRect FindInPageRectFromRange(const EphemeralRange& range) { |
| + if (range.IsNull() || !range.StartPosition().NodeAsRangeFirstNode()) |
| + return FloatRect(); |
| + |
| + const LayoutObject* baseLayoutObject = |
|
yosin_UTC9
2017/05/24 09:35:51
nit: s/const LayoutObject*/const LayoutObject* con
|
| + range.StartPosition().NodeAsRangeFirstNode()->GetLayoutObject(); |
| + if (!baseLayoutObject) |
| return FloatRect(); |
| return FindInPageRectFromAbsoluteRect( |
| - LayoutObject::AbsoluteBoundingBoxRectForRange(range), |
| - range->FirstNode()->GetLayoutObject()); |
| + LayoutObject::AbsoluteBoundingBoxRectForRange(range), baseLayoutObject); |
| } |
| } // namespace blink |