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

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: 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
« no previous file with comments | « Source/core/dom/PseudoElement.cpp ('k') | Source/core/dom/Text.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1452 Node* startContainer = m_start.container(); 1452 Node* startContainer = m_start.container();
1453 ASSERT(startContainer); 1453 ASSERT(startContainer);
1454 Node* endContainer = m_end.container(); 1454 Node* endContainer = m_end.container();
1455 ASSERT(endContainer); 1455 ASSERT(endContainer);
1456 1456
1457 bool allFixed = true; 1457 bool allFixed = true;
1458 bool someFixed = false; 1458 bool someFixed = false;
1459 1459
1460 Node* stopNode = pastLastNode(); 1460 Node* stopNode = pastLastNode();
1461 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) { 1461 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) {
1462 LayoutObject* r = node->renderer(); 1462 LayoutObject* r = node->layoutObject();
1463 if (!r || !r->isText()) 1463 if (!r || !r->isText())
1464 continue; 1464 continue;
1465 LayoutText* renderText = toLayoutText(r); 1465 LayoutText* renderText = toLayoutText(r);
1466 int startOffset = node == startContainer ? m_start.offset() : 0; 1466 int startOffset = node == startContainer ? m_start.offset() : 0;
1467 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max(); 1467 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max();
1468 bool isFixed = false; 1468 bool isFixed = false;
1469 renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSele ctionHeight, &isFixed); 1469 renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSele ctionHeight, &isFixed);
1470 allFixed &= isFixed; 1470 allFixed &= isFixed;
1471 someFixed |= isFixed; 1471 someFixed |= isFixed;
1472 } 1472 }
1473 1473
1474 if (inFixed) 1474 if (inFixed)
1475 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe dPosition : NotFixedPosition); 1475 *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixe dPosition : NotFixedPosition);
1476 } 1476 }
1477 1477
1478 void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn FixedPosition* inFixed) const 1478 void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn FixedPosition* inFixed) const
1479 { 1479 {
1480 Node* startContainer = m_start.container(); 1480 Node* startContainer = m_start.container();
1481 ASSERT(startContainer); 1481 ASSERT(startContainer);
1482 Node* endContainer = m_end.container(); 1482 Node* endContainer = m_end.container();
1483 ASSERT(endContainer); 1483 ASSERT(endContainer);
1484 1484
1485 bool allFixed = true; 1485 bool allFixed = true;
1486 bool someFixed = false; 1486 bool someFixed = false;
1487 1487
1488 Node* stopNode = pastLastNode(); 1488 Node* stopNode = pastLastNode();
1489 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) { 1489 for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next( *node)) {
1490 LayoutObject* r = node->renderer(); 1490 LayoutObject* r = node->layoutObject();
1491 if (!r || !r->isText()) 1491 if (!r || !r->isText())
1492 continue; 1492 continue;
1493 LayoutText* renderText = toLayoutText(r); 1493 LayoutText* renderText = toLayoutText(r);
1494 int startOffset = node == startContainer ? m_start.offset() : 0; 1494 int startOffset = node == startContainer ? m_start.offset() : 0;
1495 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max(); 1495 int endOffset = node == endContainer ? m_end.offset() : std::numeric_lim its<int>::max();
1496 bool isFixed = false; 1496 bool isFixed = false;
1497 renderText->absoluteQuadsForRange(quads, startOffset, endOffset, useSele ctionHeight, &isFixed); 1497 renderText->absoluteQuadsForRange(quads, startOffset, endOffset, useSele ctionHeight, &isFixed);
1498 allFixed &= isFixed; 1498 allFixed &= isFixed;
1499 someFixed |= isFixed; 1499 someFixed |= isFixed;
1500 } 1500 }
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 if (!nodeSet.contains(node->parentNode())) { 1757 if (!nodeSet.contains(node->parentNode())) {
1758 if (LayoutBoxModelObject* layoutBoxModelObject = toElement(node) ->layoutBoxModelObject()) { 1758 if (LayoutBoxModelObject* layoutBoxModelObject = toElement(node) ->layoutBoxModelObject()) {
1759 Vector<FloatQuad> elementQuads; 1759 Vector<FloatQuad> elementQuads;
1760 layoutBoxModelObject->absoluteQuads(elementQuads); 1760 layoutBoxModelObject->absoluteQuads(elementQuads);
1761 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(el ementQuads, *layoutBoxModelObject); 1761 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(el ementQuads, *layoutBoxModelObject);
1762 1762
1763 quads.appendVector(elementQuads); 1763 quads.appendVector(elementQuads);
1764 } 1764 }
1765 } 1765 }
1766 } else if (node->isTextNode()) { 1766 } else if (node->isTextNode()) {
1767 if (LayoutText* renderText = toText(node)->renderer()) { 1767 if (LayoutText* renderText = toText(node)->layoutObject()) {
1768 int startOffset = (node == startContainer) ? m_start.offset() : 0; 1768 int startOffset = (node == startContainer) ? m_start.offset() : 0;
1769 int endOffset = (node == endContainer) ? m_end.offset() : INT_MA X; 1769 int endOffset = (node == endContainer) ? m_end.offset() : INT_MA X;
1770 1770
1771 Vector<FloatQuad> textQuads; 1771 Vector<FloatQuad> textQuads;
1772 renderText->absoluteQuadsForRange(textQuads, startOffset, endOff set); 1772 renderText->absoluteQuadsForRange(textQuads, startOffset, endOff set);
1773 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu ads, *renderText); 1773 m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(textQu ads, *renderText);
1774 1774
1775 quads.appendVector(textQuads); 1775 quads.appendVector(textQuads);
1776 } 1776 }
1777 } 1777 }
(...skipping 27 matching lines...) Expand all
1805 1805
1806 void showTree(const blink::Range* range) 1806 void showTree(const blink::Range* range)
1807 { 1807 {
1808 if (range && range->boundaryPointsValid()) { 1808 if (range && range->boundaryPointsValid()) {
1809 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1809 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1810 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1810 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1811 } 1811 }
1812 } 1812 }
1813 1813
1814 #endif 1814 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/PseudoElement.cpp ('k') | Source/core/dom/Text.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698