Chromium Code Reviews| 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()); |