Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. |
| 7 * All rights reserved. | 7 * All rights reserved. |
| 8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 998 | 998 |
| 999 IntRect LayoutObject::absoluteElementBoundingBoxRect() const { | 999 IntRect LayoutObject::absoluteElementBoundingBoxRect() const { |
| 1000 Vector<LayoutRect> rects; | 1000 Vector<LayoutRect> rects; |
| 1001 const LayoutBoxModelObject& container = enclosingLayer()->layoutObject(); | 1001 const LayoutBoxModelObject& container = enclosingLayer()->layoutObject(); |
| 1002 addElementVisualOverflowRects( | 1002 addElementVisualOverflowRects( |
| 1003 rects, LayoutPoint(localToAncestorPoint(FloatPoint(), &container))); | 1003 rects, LayoutPoint(localToAncestorPoint(FloatPoint(), &container))); |
| 1004 return container.localToAbsoluteQuad(FloatQuad(FloatRect(unionRect(rects)))) | 1004 return container.localToAbsoluteQuad(FloatQuad(FloatRect(unionRect(rects)))) |
| 1005 .enclosingBoundingBox(); | 1005 .enclosingBoundingBox(); |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 FloatRect LayoutObject::absoluteBoundingBoxRectForRange(const Range* range) { | 1008 FloatRect LayoutObject::absoluteBoundingBoxRectForRange( |
| 1009 if (!range || !range->startContainer()) | 1009 const EphemeralRange& range) { |
| 1010 if (range.isNull() || !range.startPosition().computeContainerNode()) | |
| 1010 return FloatRect(); | 1011 return FloatRect(); |
| 1011 | 1012 |
| 1012 range->ownerDocument().updateStyleAndLayout(); | 1013 range.document().updateStyleAndLayout(); |
| 1013 | 1014 |
| 1014 Vector<FloatQuad> quads; | 1015 Vector<FloatQuad> quads = textQuad(range); |
|
Xiaocheng
2017/03/30 18:46:19
Sorry, my mistake.
I did an experiment and found
| |
| 1015 range->textQuads(quads); | |
| 1016 | |
| 1017 FloatRect result; | 1016 FloatRect result; |
| 1018 for (size_t i = 0; i < quads.size(); ++i) | 1017 for (size_t i = 0; i < quads.size(); ++i) |
| 1019 result.unite(quads[i].boundingBox()); | 1018 result.unite(quads[i].boundingBox()); |
| 1020 | 1019 |
| 1021 return result; | 1020 return result; |
| 1022 } | 1021 } |
| 1023 | 1022 |
| 1024 void LayoutObject::addAbsoluteRectForLayer(IntRect& result) { | 1023 void LayoutObject::addAbsoluteRectForLayer(IntRect& result) { |
| 1025 if (hasLayer()) | 1024 if (hasLayer()) |
| 1026 result.unite(absoluteBoundingBoxRect()); | 1025 result.unite(absoluteBoundingBoxRect()); |
| (...skipping 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3626 const blink::LayoutObject* root = object1; | 3625 const blink::LayoutObject* root = object1; |
| 3627 while (root->parent()) | 3626 while (root->parent()) |
| 3628 root = root->parent(); | 3627 root = root->parent(); |
| 3629 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3628 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3630 } else { | 3629 } else { |
| 3631 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3630 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3632 } | 3631 } |
| 3633 } | 3632 } |
| 3634 | 3633 |
| 3635 #endif | 3634 #endif |
| OLD | NEW |