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

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

Issue 2904833002: LayoutObject::AbsoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)
Patch Set: RebasedAndUpdatedWithComments Created 3 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
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..a5bf691d42bc3612bc1addaa45e9bc88e53af662 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* const baseLayoutObject =
+ range.StartPosition().NodeAsRangeFirstNode()->GetLayoutObject();
+ if (!baseLayoutObject)
return FloatRect();
return FindInPageRectFromAbsoluteRect(
- LayoutObject::AbsoluteBoundingBoxRectForRange(range),
- range->FirstNode()->GetLayoutObject());
+ LayoutObject::AbsoluteBoundingBoxRectForRange(range), baseLayoutObject);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/editing/FindInPageCoordinates.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698