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

Side by Side Diff: Source/core/dom/shadow/ShadowRoot.cpp

Issue 26900006: Rename Node::willBeDeletedFrom() to willBeDeletedFromDocument() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take comments into consideration Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 ShadowRoot::~ShadowRoot() 80 ShadowRoot::~ShadowRoot()
81 { 81 {
82 ASSERT(!m_prev); 82 ASSERT(!m_prev);
83 ASSERT(!m_next); 83 ASSERT(!m_next);
84 84
85 if (m_shadowRootRareData && m_shadowRootRareData->styleSheets()) 85 if (m_shadowRootRareData && m_shadowRootRareData->styleSheets())
86 m_shadowRootRareData->styleSheets()->detachFromDocument(); 86 m_shadowRootRareData->styleSheets()->detachFromDocument();
87 87
88 documentInternal()->styleEngine()->didRemoveShadowRoot(this); 88 documentInternal()->styleEngine()->didRemoveShadowRoot(this);
89 89
90 // We cannot let ContainerNode destructor call willBeDeletedFrom() 90 // We cannot let ContainerNode destructor call willBeDeletedFromDocument()
91 // for this ShadowRoot instance because TreeScope destructor 91 // for this ShadowRoot instance because TreeScope destructor
92 // clears Node::m_treeScope thus ContainerNode is no longer able 92 // clears Node::m_treeScope thus ContainerNode is no longer able
93 // to access it Document reference after that. 93 // to access it Document reference after that.
94 willBeDeletedFrom(documentInternal()); 94 willBeDeletedFromDocument();
95 95
96 // We must remove all of our children first before the TreeScope destructor 96 // We must remove all of our children first before the TreeScope destructor
97 // runs so we don't go through TreeScopeAdopter for each child with a 97 // runs so we don't go through TreeScopeAdopter for each child with a
98 // destructed tree scope in each descendant. 98 // destructed tree scope in each descendant.
99 removeDetachedChildren(); 99 removeDetachedChildren();
100 100
101 // We must call clearRareData() here since a ShadowRoot class inherits TreeS cope 101 // We must call clearRareData() here since a ShadowRoot class inherits TreeS cope
102 // as well as Node. See a comment on TreeScope.h for the reason. 102 // as well as Node. See a comment on TreeScope.h for the reason.
103 if (hasRareData()) 103 if (hasRareData())
104 clearRareData(); 104 clearRareData();
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 StyleSheetList* ShadowRoot::styleSheets() 415 StyleSheetList* ShadowRoot::styleSheets()
416 { 416 {
417 if (!ensureShadowRootRareData()->styleSheets()) 417 if (!ensureShadowRootRareData()->styleSheets())
418 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); 418 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this));
419 419
420 return m_shadowRootRareData->styleSheets(); 420 return m_shadowRootRareData->styleSheets();
421 } 421 }
422 422
423 } 423 }
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698