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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 } | 374 } |
375 | 375 |
376 void StyleEngine::didRemoveShadowRoot(ShadowRoot* shadowRoot) { | 376 void StyleEngine::didRemoveShadowRoot(ShadowRoot* shadowRoot) { |
377 m_styleSheetCollectionMap.remove(shadowRoot); | 377 m_styleSheetCollectionMap.remove(shadowRoot); |
378 m_activeTreeScopes.remove(shadowRoot); | 378 m_activeTreeScopes.remove(shadowRoot); |
379 m_dirtyTreeScopes.remove(shadowRoot); | 379 m_dirtyTreeScopes.remove(shadowRoot); |
380 } | 380 } |
381 | 381 |
382 void StyleEngine::shadowRootRemovedFromDocument(ShadowRoot* shadowRoot) { | 382 void StyleEngine::shadowRootRemovedFromDocument(ShadowRoot* shadowRoot) { |
383 if (StyleResolver* styleResolver = resolver()) { | 383 if (StyleResolver* styleResolver = resolver()) { |
384 styleResolver->resetRuleFeatures(); | |
385 | |
386 if (TreeScopeStyleSheetCollection* collection = | 384 if (TreeScopeStyleSheetCollection* collection = |
387 styleSheetCollectionFor(*shadowRoot)) | 385 styleSheetCollectionFor(*shadowRoot)) |
388 styleResolver->removePendingAuthorStyleSheets( | 386 styleResolver->removePendingAuthorStyleSheets( |
389 collection->activeAuthorStyleSheets()); | 387 collection->activeAuthorStyleSheets()); |
390 } | 388 } |
391 shadowRoot->clearScopedStyleResolver(); | |
392 m_styleSheetCollectionMap.remove(shadowRoot); | 389 m_styleSheetCollectionMap.remove(shadowRoot); |
393 m_activeTreeScopes.remove(shadowRoot); | 390 m_activeTreeScopes.remove(shadowRoot); |
394 m_dirtyTreeScopes.remove(shadowRoot); | 391 m_dirtyTreeScopes.remove(shadowRoot); |
395 m_treeBoundaryCrossingScopes.remove(&shadowRoot->rootNode()); | 392 resetAuthorStyle(*shadowRoot); |
396 } | 393 } |
397 | 394 |
398 void StyleEngine::addTreeBoundaryCrossingScope(const TreeScope& treeScope) { | 395 void StyleEngine::addTreeBoundaryCrossingScope(const TreeScope& treeScope) { |
399 m_treeBoundaryCrossingScopes.add(&treeScope.rootNode()); | 396 m_treeBoundaryCrossingScopes.add(&treeScope.rootNode()); |
400 } | 397 } |
401 | 398 |
402 void StyleEngine::resetAuthorStyle(TreeScope& treeScope) { | 399 void StyleEngine::resetAuthorStyle(TreeScope& treeScope) { |
403 m_treeBoundaryCrossingScopes.remove(&treeScope.rootNode()); | 400 m_treeBoundaryCrossingScopes.remove(&treeScope.rootNode()); |
404 | 401 |
405 ScopedStyleResolver* scopedResolver = treeScope.scopedStyleResolver(); | 402 ScopedStyleResolver* scopedResolver = treeScope.scopedStyleResolver(); |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 } | 1015 } |
1019 | 1016 |
1020 DEFINE_TRACE_WRAPPERS(StyleEngine) { | 1017 DEFINE_TRACE_WRAPPERS(StyleEngine) { |
1021 for (auto sheet : m_injectedAuthorStyleSheets) { | 1018 for (auto sheet : m_injectedAuthorStyleSheets) { |
1022 visitor->traceWrappers(sheet); | 1019 visitor->traceWrappers(sheet); |
1023 } | 1020 } |
1024 visitor->traceWrappers(m_documentStyleSheetCollection); | 1021 visitor->traceWrappers(m_documentStyleSheetCollection); |
1025 } | 1022 } |
1026 | 1023 |
1027 } // namespace blink | 1024 } // namespace blink |
OLD | NEW |