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

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

Issue 2775663008: LayoutObject::absoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)
Patch Set: Y 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..c6fdda2c51e15f489912c02992b7775b3b56765c 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(EphemeralRange& range) {
+ if (range.isNull())
+ return FloatRect();
+
+ const LayoutObject* baseLayoutObject =
+ range.startPosition().nodeAsRangeFirstNode()->layoutObject();
Xiaocheng 2017/03/28 21:29:34 Should have null ptr check for range.startPosition
tanvir 2017/03/30 19:11:06 Done.
+ 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