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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 unsigned offset = shadowHostInThisScopeOrFirstNode->nodeIndex(); 108 unsigned offset = shadowHostInThisScopeOrFirstNode->nodeIndex();
109 return Range::create(treeScope.document(), container, offset, container, off set); 109 return Range::create(treeScope.document(), container, offset, container, off set);
110 } 110 }
111 111
112 void Range::dispose() 112 void Range::dispose()
113 { 113 {
114 // A prompt detach from the owning Document helps avoid GC overhead. 114 // A prompt detach from the owning Document helps avoid GC overhead.
115 m_ownerDocument->detachRange(this); 115 m_ownerDocument->detachRange(this);
116 } 116 }
117 117
118 bool Range::inShadowIncludingDocument() const 118 bool Range::isConnected() const
119 { 119 {
120 DCHECK_EQ(m_start.inShadowIncludingDocument(), m_end.inShadowIncludingDocume nt()); 120 DCHECK_EQ(m_start.isConnected(), m_end.isConnected());
121 return m_start.inShadowIncludingDocument(); 121 return m_start.isConnected();
122 } 122 }
123 123
124 void Range::setDocument(Document& document) 124 void Range::setDocument(Document& document)
125 { 125 {
126 DCHECK_NE(m_ownerDocument, document); 126 DCHECK_NE(m_ownerDocument, document);
127 DCHECK(m_ownerDocument); 127 DCHECK(m_ownerDocument);
128 m_ownerDocument->detachRange(this); 128 m_ownerDocument->detachRange(this);
129 m_ownerDocument = &document; 129 m_ownerDocument = &document;
130 m_start.setToStartOfNode(document); 130 m_start.setToStartOfNode(document);
131 m_end.setToStartOfNode(document); 131 m_end.setToStartOfNode(document);
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 { 1587 {
1588 if (range && range->boundaryPointsValid()) { 1588 if (range && range->boundaryPointsValid()) {
1589 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1589 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1590 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1590 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1591 } else { 1591 } else {
1592 fprintf(stderr, "Cannot show tree if range is null, or if boundary point s are invalid.\n"); 1592 fprintf(stderr, "Cannot show tree if range is null, or if boundary point s are invalid.\n");
1593 } 1593 }
1594 } 1594 }
1595 1595
1596 #endif 1596 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Range.h ('k') | third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698