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 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 // Always detach (even if we've already detached) to fix https://bugs.webkit .org/show_bug.cgi?id=26044 | 128 // Always detach (even if we've already detached) to fix https://bugs.webkit .org/show_bug.cgi?id=26044 |
129 m_ownerDocument->detachRange(this); | 129 m_ownerDocument->detachRange(this); |
130 #endif | 130 #endif |
131 | 131 |
132 #ifndef NDEBUG | 132 #ifndef NDEBUG |
133 rangeCounter.decrement(); | 133 rangeCounter.decrement(); |
134 #endif | 134 #endif |
135 } | 135 } |
136 #endif | 136 #endif |
137 | 137 |
138 void Range::dispose() | |
139 { | |
140 #if ENABLE(OILPAN) | |
haraken
2015/09/09 23:48:11
Add a comment about why we want to call detachRang
| |
141 m_ownerDocument->detachRange(this); | |
142 #endif | |
143 } | |
144 | |
138 void Range::setDocument(Document& document) | 145 void Range::setDocument(Document& document) |
139 { | 146 { |
140 ASSERT(m_ownerDocument != document); | 147 ASSERT(m_ownerDocument != document); |
141 ASSERT(m_ownerDocument); | 148 ASSERT(m_ownerDocument); |
142 m_ownerDocument->detachRange(this); | 149 m_ownerDocument->detachRange(this); |
143 m_ownerDocument = &document; | 150 m_ownerDocument = &document; |
144 m_start.setToStartOfNode(document); | 151 m_start.setToStartOfNode(document); |
145 m_end.setToStartOfNode(document); | 152 m_end.setToStartOfNode(document); |
146 m_ownerDocument->attachRange(this); | 153 m_ownerDocument->attachRange(this); |
147 } | 154 } |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1682 { | 1689 { |
1683 if (range && range->boundaryPointsValid()) { | 1690 if (range && range->boundaryPointsValid()) { |
1684 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); | 1691 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); |
1685 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); | 1692 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); |
1686 } else { | 1693 } else { |
1687 fprintf(stderr, "Cannot show tree if range is null, or if boundary point s are invalid.\n"); | 1694 fprintf(stderr, "Cannot show tree if range is null, or if boundary point s are invalid.\n"); |
1688 } | 1695 } |
1689 } | 1696 } |
1690 | 1697 |
1691 #endif | 1698 #endif |
OLD | NEW |