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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.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/core/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 2ad2dafd5ad4efee4139334035aa2744f7f2ee39..2d388e55769129f23eda0e062ed1c3d9ff65ffa2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1005,15 +1005,14 @@ IntRect LayoutObject::absoluteElementBoundingBoxRect() const {
.enclosingBoundingBox();
}
-FloatRect LayoutObject::absoluteBoundingBoxRectForRange(const Range* range) {
- if (!range || !range->startContainer())
+FloatRect LayoutObject::absoluteBoundingBoxRectForRange(
+ const EphemeralRange& range) {
+ if (range.isNull() || !range.startPosition().computeContainerNode())
return FloatRect();
- range->ownerDocument().updateStyleAndLayout();
-
- Vector<FloatQuad> quads;
- range->textQuads(quads);
+ range.document().updateStyleAndLayout();
+ Vector<FloatQuad> quads = textQuad(range);
Xiaocheng 2017/03/30 18:46:19 Sorry, my mistake. I did an experiment and found
FloatRect result;
for (size_t i = 0; i < quads.size(); ++i)
result.unite(quads[i].boundingBox());

Powered by Google App Engine
This is Rietveld 408576698