| 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 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 ASSERT(endContainer); | 1360 ASSERT(endContainer); |
| 1361 | 1361 |
| 1362 bool allFixed = true; | 1362 bool allFixed = true; |
| 1363 bool someFixed = false; | 1363 bool someFixed = false; |
| 1364 | 1364 |
| 1365 Node* stopNode = pastLastNode(); | 1365 Node* stopNode = pastLastNode(); |
| 1366 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(
*node)) { | 1366 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(
*node)) { |
| 1367 LayoutObject* r = node->layoutObject(); | 1367 LayoutObject* r = node->layoutObject(); |
| 1368 if (!r || !r->isText()) | 1368 if (!r || !r->isText()) |
| 1369 continue; | 1369 continue; |
| 1370 LayoutText* renderText = toLayoutText(r); | 1370 LayoutText* layoutText = toLayoutText(r); |
| 1371 int startOffset = node == startContainer ? m_start.offset() : 0; | 1371 int startOffset = node == startContainer ? m_start.offset() : 0; |
| 1372 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim
its<int>::max(); | 1372 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim
its<int>::max(); |
| 1373 bool isFixed = false; | 1373 bool isFixed = false; |
| 1374 renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSele
ctionHeight, &isFixed); | 1374 layoutText->absoluteRectsForRange(rects, startOffset, endOffset, useSele
ctionHeight, &isFixed); |
| 1375 allFixed &= isFixed; | 1375 allFixed &= isFixed; |
| 1376 someFixed |= isFixed; | 1376 someFixed |= isFixed; |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 if (inFixed) | 1379 if (inFixed) |
| 1380 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe
dPosition : NotFixedPosition); | 1380 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe
dPosition : NotFixedPosition); |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn
FixedPosition* inFixed) const | 1383 void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn
FixedPosition* inFixed) const |
| 1384 { | 1384 { |
| 1385 Node* startContainer = m_start.container(); | 1385 Node* startContainer = m_start.container(); |
| 1386 ASSERT(startContainer); | 1386 ASSERT(startContainer); |
| 1387 Node* endContainer = m_end.container(); | 1387 Node* endContainer = m_end.container(); |
| 1388 ASSERT(endContainer); | 1388 ASSERT(endContainer); |
| 1389 | 1389 |
| 1390 bool allFixed = true; | 1390 bool allFixed = true; |
| 1391 bool someFixed = false; | 1391 bool someFixed = false; |
| 1392 | 1392 |
| 1393 Node* stopNode = pastLastNode(); | 1393 Node* stopNode = pastLastNode(); |
| 1394 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(
*node)) { | 1394 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(
*node)) { |
| 1395 LayoutObject* r = node->layoutObject(); | 1395 LayoutObject* r = node->layoutObject(); |
| 1396 if (!r || !r->isText()) | 1396 if (!r || !r->isText()) |
| 1397 continue; | 1397 continue; |
| 1398 LayoutText* renderText = toLayoutText(r); | 1398 LayoutText* layoutText = toLayoutText(r); |
| 1399 int startOffset = node == startContainer ? m_start.offset() : 0; | 1399 int startOffset = node == startContainer ? m_start.offset() : 0; |
| 1400 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim
its<int>::max(); | 1400 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim
its<int>::max(); |
| 1401 bool isFixed = false; | 1401 bool isFixed = false; |
| 1402 renderText->absoluteQuadsForRange(quads, startOffset, endOffset, useSele
ctionHeight, &isFixed); | 1402 layoutText->absoluteQuadsForRange(quads, startOffset, endOffset, useSele
ctionHeight, &isFixed); |
| 1403 allFixed &= isFixed; | 1403 allFixed &= isFixed; |
| 1404 someFixed |= isFixed; | 1404 someFixed |= isFixed; |
| 1405 } | 1405 } |
| 1406 | 1406 |
| 1407 if (inFixed) | 1407 if (inFixed) |
| 1408 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe
dPosition : NotFixedPosition); | 1408 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe
dPosition : NotFixedPosition); |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 #ifndef NDEBUG | 1411 #ifndef NDEBUG |
| 1412 void Range::formatForDebugger(char* buffer, unsigned length) const | 1412 void Range::formatForDebugger(char* buffer, unsigned length) const |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 if (!nodeSet.contains(node->parentNode())) { | 1662 if (!nodeSet.contains(node->parentNode())) { |
| 1663 if (LayoutBoxModelObject* layoutBoxModelObject = toElement(node)
->layoutBoxModelObject()) { | 1663 if (LayoutBoxModelObject* layoutBoxModelObject = toElement(node)
->layoutBoxModelObject()) { |
| 1664 Vector<FloatQuad> elementQuads; | 1664 Vector<FloatQuad> elementQuads; |
| 1665 layoutBoxModelObject->absoluteQuads(elementQuads); | 1665 layoutBoxModelObject->absoluteQuads(elementQuads); |
| 1666 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(el
ementQuads, *layoutBoxModelObject); | 1666 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(el
ementQuads, *layoutBoxModelObject); |
| 1667 | 1667 |
| 1668 quads.appendVector(elementQuads); | 1668 quads.appendVector(elementQuads); |
| 1669 } | 1669 } |
| 1670 } | 1670 } |
| 1671 } else if (node->isTextNode()) { | 1671 } else if (node->isTextNode()) { |
| 1672 if (LayoutText* renderText = toText(node)->layoutObject()) { | 1672 if (LayoutText* layoutText = toText(node)->layoutObject()) { |
| 1673 int startOffset = (node == startContainer) ? m_start.offset() :
0; | 1673 int startOffset = (node == startContainer) ? m_start.offset() :
0; |
| 1674 int endOffset = (node == endContainer) ? m_end.offset() : INT_MA
X; | 1674 int endOffset = (node == endContainer) ? m_end.offset() : INT_MA
X; |
| 1675 | 1675 |
| 1676 Vector<FloatQuad> textQuads; | 1676 Vector<FloatQuad> textQuads; |
| 1677 renderText->absoluteQuadsForRange(textQuads, startOffset, endOff
set); | 1677 layoutText->absoluteQuadsForRange(textQuads, startOffset, endOff
set); |
| 1678 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu
ads, *renderText); | 1678 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu
ads, *layoutText); |
| 1679 | 1679 |
| 1680 quads.appendVector(textQuads); | 1680 quads.appendVector(textQuads); |
| 1681 } | 1681 } |
| 1682 } | 1682 } |
| 1683 } | 1683 } |
| 1684 } | 1684 } |
| 1685 | 1685 |
| 1686 FloatRect Range::boundingRect() const | 1686 FloatRect Range::boundingRect() const |
| 1687 { | 1687 { |
| 1688 m_ownerDocument->updateLayoutIgnorePendingStylesheets(); | 1688 m_ownerDocument->updateLayoutIgnorePendingStylesheets(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1710 | 1710 |
| 1711 void showTree(const blink::Range* range) | 1711 void showTree(const blink::Range* range) |
| 1712 { | 1712 { |
| 1713 if (range && range->boundaryPointsValid()) { | 1713 if (range && range->boundaryPointsValid()) { |
| 1714 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1714 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
| 1715 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1715 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
| 1716 } | 1716 } |
| 1717 } | 1717 } |
| 1718 | 1718 |
| 1719 #endif | 1719 #endif |
| OLD | NEW |