OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 | 1434 |
1435 Node* Range::FirstNode() const { | 1435 Node* Range::FirstNode() const { |
1436 return StartPosition().NodeAsRangeFirstNode(); | 1436 return StartPosition().NodeAsRangeFirstNode(); |
1437 } | 1437 } |
1438 | 1438 |
1439 Node* Range::PastLastNode() const { | 1439 Node* Range::PastLastNode() const { |
1440 return EndPosition().NodeAsRangePastLastNode(); | 1440 return EndPosition().NodeAsRangePastLastNode(); |
1441 } | 1441 } |
1442 | 1442 |
1443 IntRect Range::BoundingBox() const { | 1443 IntRect Range::BoundingBox() const { |
1444 IntRect result; | 1444 return ComputeTextRect(EphemeralRange(this)); |
1445 const Vector<IntRect>& rects = ComputeTextRects(EphemeralRange(this)); | |
1446 for (const IntRect& rect : rects) | |
1447 result.Unite(rect); | |
1448 return result; | |
1449 } | 1445 } |
1450 | 1446 |
1451 // TODO(tanvir.rizvi): We will replace Range::TextQuads with | 1447 // TODO(tanvir.rizvi): We will replace Range::TextQuads with |
1452 // ComputeTextQuads(in VisibleUnits) and get rid of Range::TextQuads. | 1448 // ComputeTextQuads(in VisibleUnits) and get rid of Range::TextQuads. |
1453 void Range::TextQuads(Vector<FloatQuad>& quads) const { | 1449 void Range::TextQuads(Vector<FloatQuad>& quads) const { |
1454 quads.AppendVector(ComputeTextQuads(EphemeralRange(this))); | 1450 quads.AppendVector(ComputeTextQuads(EphemeralRange(this))); |
1455 } | 1451 } |
1456 | 1452 |
1457 bool AreRangesEqual(const Range* a, const Range* b) { | 1453 bool AreRangesEqual(const Range* a, const Range* b) { |
1458 if (a == b) | 1454 if (a == b) |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 .data() | 1776 .data() |
1781 << "start offset: " << range->startOffset() | 1777 << "start offset: " << range->startOffset() |
1782 << ", end offset: " << range->endOffset(); | 1778 << ", end offset: " << range->endOffset(); |
1783 } else { | 1779 } else { |
1784 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " | 1780 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " |
1785 "invalid."; | 1781 "invalid."; |
1786 } | 1782 } |
1787 } | 1783 } |
1788 | 1784 |
1789 #endif | 1785 #endif |
OLD | NEW |