| 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, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 void StyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine) | 79 void StyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine) |
| 80 { | 80 { |
| 81 Vector<RefPtr<CSSStyleSheet>> candidateSheets; | 81 Vector<RefPtr<CSSStyleSheet>> candidateSheets; |
| 82 collectStyleSheets(candidateSheets); | 82 collectStyleSheets(candidateSheets); |
| 83 | 83 |
| 84 Node& root = m_treeScope.rootNode(); | 84 Node& root = m_treeScope.rootNode(); |
| 85 | 85 |
| 86 // TODO(esprehn): Remove special casing for Document. | 86 // TODO(esprehn): Remove special casing for Document. |
| 87 if (root.isDocumentNode()) { | 87 if (root.isDocumentNode()) { |
| 88 engine->clearMasterResolver(); | 88 engine->clearResolver(); |
| 89 // FIMXE: The following depends on whether StyleRuleFontFace was modifie
d or not. | 89 // FIMXE: The following depends on whether StyleRuleFontFace was modifie
d or not. |
| 90 // No need to always-clear font cache. | 90 // No need to always-clear font cache. |
| 91 engine->clearFontCache(); | 91 engine->clearFontCache(); |
| 92 } else if (StyleResolver* styleResolver = engine->resolver()) { | 92 } else if (StyleResolver* styleResolver = engine->resolver()) { |
| 93 // We should not destroy StyleResolver when we find any stylesheet updat
e in a shadow tree. | 93 // We should not destroy StyleResolver when we find any stylesheet updat
e in a shadow tree. |
| 94 // In this case, we will reset rulesets created from style elements in t
he shadow tree. | 94 // In this case, we will reset rulesets created from style elements in t
he shadow tree. |
| 95 styleResolver->resetAuthorStyle(m_treeScope); | 95 styleResolver->resetAuthorStyle(m_treeScope); |
| 96 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets)
; | 96 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets)
; |
| 97 styleResolver->lazyAppendAuthorStyleSheets(0, candidateSheets); | 97 styleResolver->lazyAppendAuthorStyleSheets(0, candidateSheets); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // TODO(esprehn): We should avoid subtree recalcs in sky when rules change | 100 // TODO(esprehn): We should avoid subtree recalcs in sky when rules change |
| 101 // and only recalc specific tree scopes. | 101 // and only recalc specific tree scopes. |
| 102 root.setNeedsStyleRecalc(SubtreeStyleChange); | 102 root.setNeedsStyleRecalc(SubtreeStyleChange); |
| 103 | 103 |
| 104 // TODO(esprehn): We should use LocalStyleChange, :host rule changes | 104 // TODO(esprehn): We should use LocalStyleChange, :host rule changes |
| 105 // can only impact the host directly as Sky has no descendant selectors. | 105 // can only impact the host directly as Sky has no descendant selectors. |
| 106 if (root.isShadowRoot()) | 106 if (root.isShadowRoot()) |
| 107 toShadowRoot(root).host()->setNeedsStyleRecalc(SubtreeStyleChange); | 107 toShadowRoot(root).host()->setNeedsStyleRecalc(SubtreeStyleChange); |
| 108 | 108 |
| 109 m_activeAuthorStyleSheets.swap(candidateSheets); | 109 m_activeAuthorStyleSheets.swap(candidateSheets); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } | 112 } |
| OLD | NEW |