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

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

Issue 69543007: Have NodeTraversal::nextSkippingChildren() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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
« no previous file with comments | « Source/core/dom/NodeTraversal.cpp ('k') | Source/core/dom/SelectorQuery.cpp » ('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 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 Node* Range::firstNode() const 1489 Node* Range::firstNode() const
1490 { 1490 {
1491 if (!m_start.container()) 1491 if (!m_start.container())
1492 return 0; 1492 return 0;
1493 if (m_start.container()->offsetInCharacters()) 1493 if (m_start.container()->offsetInCharacters())
1494 return m_start.container(); 1494 return m_start.container();
1495 if (Node* child = m_start.container()->childNode(m_start.offset())) 1495 if (Node* child = m_start.container()->childNode(m_start.offset()))
1496 return child; 1496 return child;
1497 if (!m_start.offset()) 1497 if (!m_start.offset())
1498 return m_start.container(); 1498 return m_start.container();
1499 return NodeTraversal::nextSkippingChildren(m_start.container()); 1499 return NodeTraversal::nextSkippingChildren(*m_start.container());
1500 } 1500 }
1501 1501
1502 ShadowRoot* Range::shadowRoot() const 1502 ShadowRoot* Range::shadowRoot() const
1503 { 1503 {
1504 return startContainer() ? startContainer()->containingShadowRoot() : 0; 1504 return startContainer() ? startContainer()->containingShadowRoot() : 0;
1505 } 1505 }
1506 1506
1507 Node* Range::pastLastNode() const 1507 Node* Range::pastLastNode() const
1508 { 1508 {
1509 if (!m_start.container() || !m_end.container()) 1509 if (!m_start.container() || !m_end.container())
1510 return 0; 1510 return 0;
1511 if (m_end.container()->offsetInCharacters()) 1511 if (m_end.container()->offsetInCharacters())
1512 return NodeTraversal::nextSkippingChildren(m_end.container()); 1512 return NodeTraversal::nextSkippingChildren(*m_end.container());
1513 if (Node* child = m_end.container()->childNode(m_end.offset())) 1513 if (Node* child = m_end.container()->childNode(m_end.offset()))
1514 return child; 1514 return child;
1515 return NodeTraversal::nextSkippingChildren(m_end.container()); 1515 return NodeTraversal::nextSkippingChildren(*m_end.container());
1516 } 1516 }
1517 1517
1518 IntRect Range::boundingBox() const 1518 IntRect Range::boundingBox() const
1519 { 1519 {
1520 IntRect result; 1520 IntRect result;
1521 Vector<IntRect> rects; 1521 Vector<IntRect> rects;
1522 textRects(rects); 1522 textRects(rects);
1523 const size_t n = rects.size(); 1523 const size_t n = rects.size();
1524 for (size_t i = 0; i < n; ++i) 1524 for (size_t i = 0; i < n; ++i)
1525 result.unite(rects[i]); 1525 result.unite(rects[i]);
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 1907
1908 void showTree(const WebCore::Range* range) 1908 void showTree(const WebCore::Range* range)
1909 { 1909 {
1910 if (range && range->boundaryPointsValid()) { 1910 if (range && range->boundaryPointsValid()) {
1911 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1911 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1912 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1912 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1913 } 1913 }
1914 } 1914 }
1915 1915
1916 #endif 1916 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/NodeTraversal.cpp ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698