Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: Source/core/dom/Range.cpp

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase to master Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 Node* startContainer = m_start.container(); 1423 Node* startContainer = m_start.container();
1424 ASSERT(startContainer); 1424 ASSERT(startContainer);
1425 Node* endContainer = m_end.container(); 1425 Node* endContainer = m_end.container();
1426 ASSERT(endContainer); 1426 ASSERT(endContainer);
1427 1427
1428 bool allFixed = true; 1428 bool allFixed = true;
1429 bool someFixed = false; 1429 bool someFixed = false;
1430 1430
1431 Node* stopNode = pastLastNode(); 1431 Node* stopNode = pastLastNode();
1432 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) { 1432 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) {
1433 LayoutObject* r = node->renderer(); 1433 LayoutObject* r = node->layoutObject();
1434 if (!r || !r->isText()) 1434 if (!r || !r->isText())
1435 continue; 1435 continue;
1436 LayoutText* renderText = toLayoutText(r); 1436 LayoutText* renderText = toLayoutText(r);
1437 int startOffset = node == startContainer ? m_start.offset() : 0; 1437 int startOffset = node == startContainer ? m_start.offset() : 0;
1438 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max(); 1438 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max();
1439 bool isFixed = false; 1439 bool isFixed = false;
1440 renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSele ctionHeight, &isFixed); 1440 renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSele ctionHeight, &isFixed);
1441 allFixed &= isFixed; 1441 allFixed &= isFixed;
1442 someFixed |= isFixed; 1442 someFixed |= isFixed;
1443 } 1443 }
1444 1444
1445 if (inFixed) 1445 if (inFixed)
1446 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe dPosition : NotFixedPosition); 1446 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe dPosition : NotFixedPosition);
1447 } 1447 }
1448 1448
1449 void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn FixedPosition* inFixed) const 1449 void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn FixedPosition* inFixed) const
1450 { 1450 {
1451 Node* startContainer = m_start.container(); 1451 Node* startContainer = m_start.container();
1452 ASSERT(startContainer); 1452 ASSERT(startContainer);
1453 Node* endContainer = m_end.container(); 1453 Node* endContainer = m_end.container();
1454 ASSERT(endContainer); 1454 ASSERT(endContainer);
1455 1455
1456 bool allFixed = true; 1456 bool allFixed = true;
1457 bool someFixed = false; 1457 bool someFixed = false;
1458 1458
1459 Node* stopNode = pastLastNode(); 1459 Node* stopNode = pastLastNode();
1460 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) { 1460 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) {
1461 LayoutObject* r = node->renderer(); 1461 LayoutObject* r = node->layoutObject();
1462 if (!r || !r->isText()) 1462 if (!r || !r->isText())
1463 continue; 1463 continue;
1464 LayoutText* renderText = toLayoutText(r); 1464 LayoutText* renderText = toLayoutText(r);
1465 int startOffset = node == startContainer ? m_start.offset() : 0; 1465 int startOffset = node == startContainer ? m_start.offset() : 0;
1466 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max(); 1466 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max();
1467 bool isFixed = false; 1467 bool isFixed = false;
1468 renderText->absoluteQuadsForRange(quads, startOffset, endOffset, useSele ctionHeight, &isFixed); 1468 renderText->absoluteQuadsForRange(quads, startOffset, endOffset, useSele ctionHeight, &isFixed);
1469 allFixed &= isFixed; 1469 allFixed &= isFixed;
1470 someFixed |= isFixed; 1470 someFixed |= isFixed;
1471 } 1471 }
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 if (!nodeSet.contains(node->parentNode())) { 1728 if (!nodeSet.contains(node->parentNode())) {
1729 if (LayoutBoxModelObject* layoutBoxModelObject = toElement(node) ->layoutBoxModelObject()) { 1729 if (LayoutBoxModelObject* layoutBoxModelObject = toElement(node) ->layoutBoxModelObject()) {
1730 Vector<FloatQuad> elementQuads; 1730 Vector<FloatQuad> elementQuads;
1731 layoutBoxModelObject->absoluteQuads(elementQuads); 1731 layoutBoxModelObject->absoluteQuads(elementQuads);
1732 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(el ementQuads, *layoutBoxModelObject); 1732 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(el ementQuads, *layoutBoxModelObject);
1733 1733
1734 quads.appendVector(elementQuads); 1734 quads.appendVector(elementQuads);
1735 } 1735 }
1736 } 1736 }
1737 } else if (node->isTextNode()) { 1737 } else if (node->isTextNode()) {
1738 if (LayoutText* renderText = toText(node)->renderer()) { 1738 if (LayoutText* renderText = toText(node)->layoutObject()) {
1739 int startOffset = (node == startContainer) ? m_start.offset() : 0; 1739 int startOffset = (node == startContainer) ? m_start.offset() : 0;
1740 int endOffset = (node == endContainer) ? m_end.offset() : INT_MA X; 1740 int endOffset = (node == endContainer) ? m_end.offset() : INT_MA X;
1741 1741
1742 Vector<FloatQuad> textQuads; 1742 Vector<FloatQuad> textQuads;
1743 renderText->absoluteQuadsForRange(textQuads, startOffset, endOff set); 1743 renderText->absoluteQuadsForRange(textQuads, startOffset, endOff set);
1744 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu ads, *renderText); 1744 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu ads, *renderText);
1745 1745
1746 quads.appendVector(textQuads); 1746 quads.appendVector(textQuads);
1747 } 1747 }
1748 } 1748 }
(...skipping 27 matching lines...) Expand all
1776 1776
1777 void showTree(const blink::Range* range) 1777 void showTree(const blink::Range* range)
1778 { 1778 {
1779 if (range && range->boundaryPointsValid()) { 1779 if (range && range->boundaryPointsValid()) {
1780 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1780 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1781 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1781 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1782 } 1782 }
1783 } 1783 }
1784 1784
1785 #endif 1785 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698