| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 { | 74 { |
| 75 ASSERT(rootNode); | 75 ASSERT(rootNode); |
| 76 ASSERT(document); | 76 ASSERT(document); |
| 77 ASSERT(rootNode != document); | 77 ASSERT(rootNode != document); |
| 78 m_rootNode->setTreeScope(Handle<TreeScope>(this)); | 78 m_rootNode->setTreeScope(Handle<TreeScope>(this)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 TreeScope::TreeScope(const Handle<Document>& document) | 81 TreeScope::TreeScope(const Handle<Document>& document) |
| 82 : m_rootNode(document) | 82 : m_rootNode(document) |
| 83 , m_documentScope(document) | 83 , m_documentScope(document) |
| 84 , m_parentTreeScope(0) | |
| 85 , m_idTargetObserverRegistry(IdTargetObserverRegistry::create()) | 84 , m_idTargetObserverRegistry(IdTargetObserverRegistry::create()) |
| 86 { | 85 { |
| 87 ASSERT(document); | 86 ASSERT(document); |
| 88 m_rootNode->setTreeScope(Handle<TreeScope>(this)); | 87 m_rootNode->setTreeScope(Handle<TreeScope>(this)); |
| 89 } | 88 } |
| 90 | 89 |
| 91 TreeScope::TreeScope() | 90 TreeScope::TreeScope() |
| 92 : m_rootNode(0) | |
| 93 , m_documentScope(0) | |
| 94 , m_parentTreeScope(0) | |
| 95 { | 91 { |
| 96 } | 92 } |
| 97 | 93 |
| 98 TreeScope::~TreeScope() | 94 TreeScope::~TreeScope() |
| 99 { | 95 { |
| 100 m_rootNode->setTreeScope(noDocumentInstance()); | 96 m_rootNode->setTreeScope(noDocumentInstance()); |
| 101 | 97 |
| 102 if (m_selection) { | 98 if (m_selection) { |
| 103 m_selection->clearTreeScope(); | 99 m_selection->clearTreeScope(); |
| 104 m_selection = 0; | 100 m_selection = 0; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 return nullptr; | 416 return nullptr; |
| 421 } | 417 } |
| 422 | 418 |
| 423 void TreeScope::visitWith(Visitor* v) const | 419 void TreeScope::visitWith(Visitor* v) const |
| 424 { | 420 { |
| 425 ASSERT(this == noDocumentInstance()); | 421 ASSERT(this == noDocumentInstance()); |
| 426 v->visit(this, &AcceptTrait<TreeScope>::accept); | 422 v->visit(this, &AcceptTrait<TreeScope>::accept); |
| 427 } | 423 } |
| 428 | 424 |
| 429 } // namespace WebCore | 425 } // namespace WebCore |
| OLD | NEW |