| 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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 Range* Range::CreateAdjustedToTreeScope(const TreeScope& tree_scope, | 165 Range* Range::CreateAdjustedToTreeScope(const TreeScope& tree_scope, |
| 166 const Position& position) { | 166 const Position& position) { |
| 167 DCHECK(position.IsNotNull()); | 167 DCHECK(position.IsNotNull()); |
| 168 // Note: Since |Position::computeContanerNode()| returns |nullptr| if | 168 // Note: Since |Position::computeContanerNode()| returns |nullptr| if |
| 169 // |position| is |BeforeAnchor| or |AfterAnchor|. | 169 // |position| is |BeforeAnchor| or |AfterAnchor|. |
| 170 Node* const anchor_node = position.AnchorNode(); | 170 Node* const anchor_node = position.AnchorNode(); |
| 171 if (anchor_node->GetTreeScope() == tree_scope) | 171 if (anchor_node->GetTreeScope() == tree_scope) |
| 172 return Create(tree_scope.GetDocument(), position, position); | 172 return Create(tree_scope.GetDocument(), position, position); |
| 173 Node* const shadow_host = tree_scope.AncestorInThisScope(anchor_node); | 173 Node* const shadow_host = tree_scope.AncestorInThisScope(anchor_node); |
| 174 return Range::Create(tree_scope.GetDocument(), | 174 return Range::Create(tree_scope.GetDocument(), |
| 175 Position::BeforeNode(shadow_host), | 175 Position::BeforeNode(*shadow_host), |
| 176 Position::BeforeNode(shadow_host)); | 176 Position::BeforeNode(*shadow_host)); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void Range::Dispose() { | 179 void Range::Dispose() { |
| 180 // A prompt detach from the owning Document helps avoid GC overhead. | 180 // A prompt detach from the owning Document helps avoid GC overhead. |
| 181 owner_document_->DetachRange(this); | 181 owner_document_->DetachRange(this); |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool Range::IsConnected() const { | 184 bool Range::IsConnected() const { |
| 185 DCHECK_EQ(start_.IsConnected(), end_.IsConnected()); | 185 DCHECK_EQ(start_.IsConnected(), end_.IsConnected()); |
| 186 return start_.IsConnected(); | 186 return start_.IsConnected(); |
| (...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1729 .data() | 1729 .data() |
| 1730 << "start offset: " << range->startOffset() | 1730 << "start offset: " << range->startOffset() |
| 1731 << ", end offset: " << range->endOffset(); | 1731 << ", end offset: " << range->endOffset(); |
| 1732 } else { | 1732 } else { |
| 1733 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " | 1733 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " |
| 1734 "invalid."; | 1734 "invalid."; |
| 1735 } | 1735 } |
| 1736 } | 1736 } |
| 1737 | 1737 |
| 1738 #endif | 1738 #endif |
| OLD | NEW |