OLD | NEW |
---|---|
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 , m_descendantInsertionPointsIsValid(false) | 61 , m_descendantInsertionPointsIsValid(false) |
62 { | 62 { |
63 ScriptWrappable::init(this); | 63 ScriptWrappable::init(this); |
64 } | 64 } |
65 | 65 |
66 ShadowRoot::~ShadowRoot() | 66 ShadowRoot::~ShadowRoot() |
67 { | 67 { |
68 ASSERT(!m_prev); | 68 ASSERT(!m_prev); |
69 ASSERT(!m_next); | 69 ASSERT(!m_next); |
70 | 70 |
71 #if !ENABLE(OILPAN) | |
71 if (m_shadowRootRareData && m_shadowRootRareData->styleSheets()) | 72 if (m_shadowRootRareData && m_shadowRootRareData->styleSheets()) |
72 m_shadowRootRareData->styleSheets()->detachFromDocument(); | 73 m_shadowRootRareData->styleSheets()->detachFromDocument(); |
73 | 74 |
74 document().styleEngine()->didRemoveShadowRoot(this); | 75 document().styleEngine()->didRemoveShadowRoot(this); |
haraken
2014/04/25 14:30:32
I wonder why these lines are not written in Shadow
Mads Ager (chromium)
2014/04/28 09:45:21
No, we shouldn't have this in removedFrom. We shou
| |
76 #endif | |
75 | 77 |
76 // We cannot let ContainerNode destructor call willBeDeletedFromDocument() | 78 // We cannot let ContainerNode destructor call willBeDeletedFromDocument() |
77 // for this ShadowRoot instance because TreeScope destructor | 79 // for this ShadowRoot instance because TreeScope destructor |
78 // clears Node::m_treeScope thus ContainerNode is no longer able | 80 // clears Node::m_treeScope thus ContainerNode is no longer able |
79 // to access it Document reference after that. | 81 // to access it Document reference after that. |
80 willBeDeletedFromDocument(); | 82 willBeDeletedFromDocument(); |
81 | 83 |
82 // We must remove all of our children first before the TreeScope destructor | 84 // We must remove all of our children first before the TreeScope destructor |
83 // runs so we don't go through TreeScopeAdopter for each child with a | 85 // runs so we don't go through TreeScopeAdopter for each child with a |
84 // destructed tree scope in each descendant. | 86 // destructed tree scope in each descendant. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 ASSERT(hasScopedHTMLStyleChild() && m_numberOfStyles > 0); | 225 ASSERT(hasScopedHTMLStyleChild() && m_numberOfStyles > 0); |
224 --m_numberOfStyles; | 226 --m_numberOfStyles; |
225 setHasScopedHTMLStyleChild(m_numberOfStyles > 0); | 227 setHasScopedHTMLStyleChild(m_numberOfStyles > 0); |
226 } | 228 } |
227 | 229 |
228 ShadowRootRareData* ShadowRoot::ensureShadowRootRareData() | 230 ShadowRootRareData* ShadowRoot::ensureShadowRootRareData() |
229 { | 231 { |
230 if (m_shadowRootRareData) | 232 if (m_shadowRootRareData) |
231 return m_shadowRootRareData.get(); | 233 return m_shadowRootRareData.get(); |
232 | 234 |
233 m_shadowRootRareData = adoptPtr(new ShadowRootRareData); | 235 m_shadowRootRareData = adoptPtrWillBeNoop(new ShadowRootRareData); |
234 return m_shadowRootRareData.get(); | 236 return m_shadowRootRareData.get(); |
235 } | 237 } |
236 | 238 |
237 bool ShadowRoot::containsShadowElements() const | 239 bool ShadowRoot::containsShadowElements() const |
238 { | 240 { |
239 return m_shadowRootRareData ? m_shadowRootRareData->containsShadowElements() : 0; | 241 return m_shadowRootRareData ? m_shadowRootRareData->containsShadowElements() : 0; |
240 } | 242 } |
241 | 243 |
242 bool ShadowRoot::containsContentElements() const | 244 bool ShadowRoot::containsContentElements() const |
243 { | 245 { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
326 } | 328 } |
327 | 329 |
328 StyleSheetList* ShadowRoot::styleSheets() | 330 StyleSheetList* ShadowRoot::styleSheets() |
329 { | 331 { |
330 if (!ensureShadowRootRareData()->styleSheets()) | 332 if (!ensureShadowRootRareData()->styleSheets()) |
331 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); | 333 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); |
332 | 334 |
333 return m_shadowRootRareData->styleSheets(); | 335 return m_shadowRootRareData->styleSheets(); |
334 } | 336 } |
335 | 337 |
338 void ShadowRoot::trace(Visitor* visitor) | |
339 { | |
340 visitor->trace(m_shadowRootRareData); | |
341 TreeScope::trace(visitor); | |
342 DocumentFragment::trace(visitor); | |
336 } | 343 } |
344 | |
345 } | |
OLD | NEW |