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

Unified Diff: third_party/WebKit/Source/web/FindInPageCoordinates.cpp

Issue 2775663008: LayoutObject::absoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)
Patch Set: Review comments Addressed Created 3 years, 9 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/web/FindInPageCoordinates.cpp
diff --git a/third_party/WebKit/Source/web/FindInPageCoordinates.cpp b/third_party/WebKit/Source/web/FindInPageCoordinates.cpp
index c3e592e3451d8cb0eaff9b2e34fdb5f50c6fab26..e071714ae623db5c2b06ae37670343f310720cc3 100644
--- a/third_party/WebKit/Source/web/FindInPageCoordinates.cpp
+++ b/third_party/WebKit/Source/web/FindInPageCoordinates.cpp
@@ -143,13 +143,17 @@ FloatRect findInPageRectFromAbsoluteRect(const FloatRect& inputRect,
return normalizedRect;
}
-FloatRect findInPageRectFromRange(Range* range) {
- if (!range || !range->firstNode())
+FloatRect findInPageRectFromRange(const EphemeralRange& range) {
+ if (range.isNull() || !range.startPosition().nodeAsRangeFirstNode())
+ return FloatRect();
+
+ const LayoutObject* baseLayoutObject =
+ range.startPosition().nodeAsRangeFirstNode()->layoutObject();
+ if (!baseLayoutObject)
return FloatRect();
return findInPageRectFromAbsoluteRect(
- LayoutObject::absoluteBoundingBoxRectForRange(range),
- range->firstNode()->layoutObject());
+ LayoutObject::absoluteBoundingBoxRectForRange(range), baseLayoutObject);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698