| Index: third_party/WebKit/Source/core/dom/Range.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp
|
| index b662e2bbdc9d43968c99f0126332ed0825b854e1..4ccba20c1e763c9a6378159a32be036b4eb01fe7 100644
|
| --- a/third_party/WebKit/Source/core/dom/Range.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Range.cpp
|
| @@ -1582,16 +1582,12 @@ FloatRect Range::boundingRect() const
|
| getBorderAndTextQuads(quads);
|
|
|
| FloatRect result;
|
| - // As per section 10 in https://www.w3.org/TR/cssom-view/
|
| - // "Return a static DOMRect object describing the smallest rectangle that
|
| - // includes the first rectangle in list and all of the remaining rectangles
|
| - // of which the height or width is not zero."
|
| - for (const FloatQuad& quad : quads) {
|
| - if (result.isEmpty())
|
| - result.uniteIfNonZero(quad.boundingBox());
|
| - else
|
| - result.unite(quad.boundingBox()); // Skips empty rects.
|
| - }
|
| + for (const FloatQuad& quad : quads)
|
| + result.unite(quad.boundingBox()); // Skips empty rects.
|
| +
|
| + // If all rects are empty, return the first rect.
|
| + if (result.isEmpty() && !quads.isEmpty())
|
| + return quads.first().boundingBox();
|
|
|
| return result;
|
| }
|
|
|