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 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 end = endOfDocument(end); | 1516 end = endOfDocument(end); |
1517 } else { | 1517 } else { |
1518 return; | 1518 return; |
1519 } | 1519 } |
1520 setStart(start.deepEquivalent().computeContainerNode(), start.deepEquivalent
().computeOffsetInContainerNode(), exceptionState); | 1520 setStart(start.deepEquivalent().computeContainerNode(), start.deepEquivalent
().computeOffsetInContainerNode(), exceptionState); |
1521 setEnd(end.deepEquivalent().computeContainerNode(), end.deepEquivalent().com
puteOffsetInContainerNode(), exceptionState); | 1521 setEnd(end.deepEquivalent().computeContainerNode(), end.deepEquivalent().com
puteOffsetInContainerNode(), exceptionState); |
1522 } | 1522 } |
1523 | 1523 |
1524 ClientRectList* Range::getClientRects() const | 1524 ClientRectList* Range::getClientRects() const |
1525 { | 1525 { |
1526 m_ownerDocument->updateLayoutIgnorePendingStylesheets(); | 1526 m_ownerDocument->updateStyleAndLayoutIgnorePendingStylesheets(); |
1527 | 1527 |
1528 Vector<FloatQuad> quads; | 1528 Vector<FloatQuad> quads; |
1529 getBorderAndTextQuads(quads); | 1529 getBorderAndTextQuads(quads); |
1530 | 1530 |
1531 return ClientRectList::create(quads); | 1531 return ClientRectList::create(quads); |
1532 } | 1532 } |
1533 | 1533 |
1534 ClientRect* Range::getBoundingClientRect() const | 1534 ClientRect* Range::getBoundingClientRect() const |
1535 { | 1535 { |
1536 return ClientRect::create(boundingRect()); | 1536 return ClientRect::create(boundingRect()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu
ads, *layoutText); | 1569 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu
ads, *layoutText); |
1570 | 1570 |
1571 quads.appendVector(textQuads); | 1571 quads.appendVector(textQuads); |
1572 } | 1572 } |
1573 } | 1573 } |
1574 } | 1574 } |
1575 } | 1575 } |
1576 | 1576 |
1577 FloatRect Range::boundingRect() const | 1577 FloatRect Range::boundingRect() const |
1578 { | 1578 { |
1579 m_ownerDocument->updateLayoutIgnorePendingStylesheets(); | 1579 m_ownerDocument->updateStyleAndLayoutIgnorePendingStylesheets(); |
1580 | 1580 |
1581 Vector<FloatQuad> quads; | 1581 Vector<FloatQuad> quads; |
1582 getBorderAndTextQuads(quads); | 1582 getBorderAndTextQuads(quads); |
1583 | 1583 |
1584 FloatRect result; | 1584 FloatRect result; |
1585 for (const FloatQuad& quad : quads) | 1585 for (const FloatQuad& quad : quads) |
1586 result.unite(quad.boundingBox()); // Skips empty rects. | 1586 result.unite(quad.boundingBox()); // Skips empty rects. |
1587 | 1587 |
1588 // If all rects are empty, return the first rect. | 1588 // If all rects are empty, return the first rect. |
1589 if (result.isEmpty() && !quads.isEmpty()) | 1589 if (result.isEmpty() && !quads.isEmpty()) |
(...skipping 17 matching lines...) Expand all Loading... |
1607 { | 1607 { |
1608 if (range && range->boundaryPointsValid()) { | 1608 if (range && range->boundaryPointsValid()) { |
1609 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1609 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
1610 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1610 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
1611 } else { | 1611 } else { |
1612 fprintf(stderr, "Cannot show tree if range is null, or if boundary point
s are invalid.\n"); | 1612 fprintf(stderr, "Cannot show tree if range is null, or if boundary point
s are invalid.\n"); |
1613 } | 1613 } |
1614 } | 1614 } |
1615 | 1615 |
1616 #endif | 1616 #endif |
OLD | NEW |