OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2011 Google Inc. All rights reserved. | 10 * Copyright (C) 2011 Google Inc. All rights reserved. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 #if DCHECK_IS_ON() | 108 #if DCHECK_IS_ON() |
109 static bool didMoveToNewDocumentWasCalled = false; | 109 static bool didMoveToNewDocumentWasCalled = false; |
110 static Document* oldDocumentDidMoveToNewDocumentWasCalledWith = 0; | 110 static Document* oldDocumentDidMoveToNewDocumentWasCalledWith = 0; |
111 | 111 |
112 void TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled( | 112 void TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled( |
113 Document& oldDocument) { | 113 Document& oldDocument) { |
114 DCHECK(!didMoveToNewDocumentWasCalled); | 114 DCHECK(!didMoveToNewDocumentWasCalled); |
115 ASSERT_UNUSED(oldDocument, | 115 DCHECK_EQ(oldDocument, oldDocumentDidMoveToNewDocumentWasCalledWith); |
116 oldDocument == oldDocumentDidMoveToNewDocumentWasCalledWith); | |
117 didMoveToNewDocumentWasCalled = true; | 116 didMoveToNewDocumentWasCalled = true; |
118 } | 117 } |
119 #endif | 118 #endif |
120 | 119 |
121 inline void TreeScopeAdopter::updateTreeScope(Node& node) const { | 120 inline void TreeScopeAdopter::updateTreeScope(Node& node) const { |
122 DCHECK(!node.isTreeScope()); | 121 DCHECK(!node.isTreeScope()); |
123 DCHECK(node.treeScope() == oldScope()); | 122 DCHECK(node.treeScope() == oldScope()); |
124 node.setTreeScope(m_newScope); | 123 node.setTreeScope(m_newScope); |
125 } | 124 } |
126 | 125 |
(...skipping 24 matching lines...) Expand all Loading... |
151 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; | 150 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; |
152 #endif | 151 #endif |
153 | 152 |
154 node.didMoveToNewDocument(oldDocument); | 153 node.didMoveToNewDocument(oldDocument); |
155 #if DCHECK_IS_ON() | 154 #if DCHECK_IS_ON() |
156 DCHECK(didMoveToNewDocumentWasCalled); | 155 DCHECK(didMoveToNewDocumentWasCalled); |
157 #endif | 156 #endif |
158 } | 157 } |
159 | 158 |
160 } // namespace blink | 159 } // namespace blink |
OLD | NEW |