| 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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 start = startOfDocument(start); | 1434 start = startOfDocument(start); |
| 1435 end = endOfDocument(end); | 1435 end = endOfDocument(end); |
| 1436 } else | 1436 } else |
| 1437 return; | 1437 return; |
| 1438 setStart(start.deepEquivalent().containerNode(), start.deepEquivalent().comp
uteOffsetInContainerNode(), exceptionState); | 1438 setStart(start.deepEquivalent().containerNode(), start.deepEquivalent().comp
uteOffsetInContainerNode(), exceptionState); |
| 1439 setEnd(end.deepEquivalent().containerNode(), end.deepEquivalent().computeOff
setInContainerNode(), exceptionState); | 1439 setEnd(end.deepEquivalent().containerNode(), end.deepEquivalent().computeOff
setInContainerNode(), exceptionState); |
| 1440 } | 1440 } |
| 1441 | 1441 |
| 1442 PassRefPtr<ClientRectList> Range::getClientRects() const | 1442 PassRefPtr<ClientRectList> Range::getClientRects() const |
| 1443 { | 1443 { |
| 1444 m_ownerDocument->updateLayoutIgnorePendingStylesheets(); | 1444 m_ownerDocument->updateLayout(); |
| 1445 | 1445 |
| 1446 Vector<FloatQuad> quads; | 1446 Vector<FloatQuad> quads; |
| 1447 getBorderAndTextQuads(quads); | 1447 getBorderAndTextQuads(quads); |
| 1448 | 1448 |
| 1449 return ClientRectList::create(quads); | 1449 return ClientRectList::create(quads); |
| 1450 } | 1450 } |
| 1451 | 1451 |
| 1452 PassRefPtr<ClientRect> Range::getBoundingClientRect() const | 1452 PassRefPtr<ClientRect> Range::getBoundingClientRect() const |
| 1453 { | 1453 { |
| 1454 return ClientRect::create(boundingRect()); | 1454 return ClientRect::create(boundingRect()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 m_ownerDocument->adjustFloatQuadsForScroll(textQuads); | 1487 m_ownerDocument->adjustFloatQuadsForScroll(textQuads); |
| 1488 | 1488 |
| 1489 quads.appendVector(textQuads); | 1489 quads.appendVector(textQuads); |
| 1490 } | 1490 } |
| 1491 } | 1491 } |
| 1492 } | 1492 } |
| 1493 } | 1493 } |
| 1494 | 1494 |
| 1495 FloatRect Range::boundingRect() const | 1495 FloatRect Range::boundingRect() const |
| 1496 { | 1496 { |
| 1497 m_ownerDocument->updateLayoutIgnorePendingStylesheets(); | 1497 m_ownerDocument->updateLayout(); |
| 1498 | 1498 |
| 1499 Vector<FloatQuad> quads; | 1499 Vector<FloatQuad> quads; |
| 1500 getBorderAndTextQuads(quads); | 1500 getBorderAndTextQuads(quads); |
| 1501 if (quads.isEmpty()) | 1501 if (quads.isEmpty()) |
| 1502 return FloatRect(); | 1502 return FloatRect(); |
| 1503 | 1503 |
| 1504 FloatRect result; | 1504 FloatRect result; |
| 1505 for (size_t i = 0; i < quads.size(); ++i) | 1505 for (size_t i = 0; i < quads.size(); ++i) |
| 1506 result.unite(quads[i].boundingBox()); | 1506 result.unite(quads[i].boundingBox()); |
| 1507 | 1507 |
| 1508 return result; | 1508 return result; |
| 1509 } | 1509 } |
| 1510 | 1510 |
| 1511 } // namespace blink | 1511 } // namespace blink |
| 1512 | 1512 |
| 1513 #ifndef NDEBUG | 1513 #ifndef NDEBUG |
| 1514 | 1514 |
| 1515 void showTree(const blink::Range* range) | 1515 void showTree(const blink::Range* range) |
| 1516 { | 1516 { |
| 1517 if (range && range->boundaryPointsValid()) { | 1517 if (range && range->boundaryPointsValid()) { |
| 1518 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1518 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
| 1519 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1519 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
| 1520 } | 1520 } |
| 1521 } | 1521 } |
| 1522 | 1522 |
| 1523 #endif | 1523 #endif |
| OLD | NEW |