| 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 |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 11 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 12 * |
| 11 * This library is free software; you can redistribute it and/or | 13 * This library is free software; you can redistribute it and/or |
| 12 * modify it under the terms of the GNU Library General Public | 14 * modify it under the terms of the GNU Library General Public |
| 13 * License as published by the Free Software Foundation; either | 15 * License as published by the Free Software Foundation; either |
| 14 * version 2 of the License, or (at your option) any later version. | 16 * version 2 of the License, or (at your option) any later version. |
| 15 * | 17 * |
| 16 * This library is distributed in the hope that it will be useful, | 18 * This library is distributed in the hope that it will be useful, |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 StyleSheetCollection* collection = StyleSheetCollection::create(); | 92 StyleSheetCollection* collection = StyleSheetCollection::create(); |
| 91 ActiveDocumentStyleSheetCollector collector(*collection); | 93 ActiveDocumentStyleSheetCollector collector(*collection); |
| 92 collectStyleSheets(engine, collector); | 94 collectStyleSheets(engine, collector); |
| 93 | 95 |
| 94 StyleSheetChange change; | 96 StyleSheetChange change; |
| 95 analyzeStyleSheetChange(updateMode, collection->activeAuthorStyleSheets(), | 97 analyzeStyleSheetChange(updateMode, collection->activeAuthorStyleSheets(), |
| 96 change); | 98 change); |
| 97 | 99 |
| 98 if (change.styleResolverUpdateType == Reconstruct) { | 100 if (change.styleResolverUpdateType == Reconstruct) { |
| 99 engine.clearMasterResolver(); | 101 engine.clearMasterResolver(); |
| 100 // TODO(rune@opera.com): The following depends on whether StyleRuleFontFace
was modified or not. | 102 // TODO(rune@opera.com): The following depends on whether StyleRuleFontFace |
| 101 // We should only remove modified/removed @font-face rules, or @font-face ru
les from removed | 103 // was modified or not. We should only remove modified/removed @font-face |
| 102 // stylesheets. We currently avoid clearing the font cache when we have had
an analyzed update | 104 // rules, or @font-face rules from removed stylesheets. We currently avoid |
| 103 // and no @font-face rules were removed, in which case requiresFullStyleReca
lc will be false. | 105 // clearing the font cache when we have had an analyzed update and no |
| 106 // @font-face rules were removed, in which case requiresFullStyleRecalc will |
| 107 // be false. |
| 104 if (change.requiresFullStyleRecalc) | 108 if (change.requiresFullStyleRecalc) |
| 105 engine.clearFontCache(); | 109 engine.clearFontCache(); |
| 106 } else if (StyleResolver* styleResolver = engine.resolver()) { | 110 } else if (StyleResolver* styleResolver = engine.resolver()) { |
| 107 if (change.styleResolverUpdateType != Additive) { | 111 if (change.styleResolverUpdateType != Additive) { |
| 108 DCHECK_EQ(change.styleResolverUpdateType, Reset); | 112 DCHECK_EQ(change.styleResolverUpdateType, Reset); |
| 109 styleResolver->resetAuthorStyle(treeScope()); | 113 styleResolver->resetAuthorStyle(treeScope()); |
| 110 engine.removeFontFaceRules(change.fontFaceRulesToRemove); | 114 engine.removeFontFaceRules(change.fontFaceRulesToRemove); |
| 111 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets); | 115 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets); |
| 112 styleResolver->lazyAppendAuthorStyleSheets( | 116 styleResolver->lazyAppendAuthorStyleSheets( |
| 113 0, collection->activeAuthorStyleSheets()); | 117 0, collection->activeAuthorStyleSheets()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 125 collection->swap(*this); | 129 collection->swap(*this); |
| 126 collection->dispose(); | 130 collection->dispose(); |
| 127 } | 131 } |
| 128 | 132 |
| 129 DEFINE_TRACE_WRAPPERS(DocumentStyleSheetCollection) { | 133 DEFINE_TRACE_WRAPPERS(DocumentStyleSheetCollection) { |
| 130 for (auto sheet : m_styleSheetsForStyleSheetList) { | 134 for (auto sheet : m_styleSheetsForStyleSheetList) { |
| 131 visitor->traceWrappers(sheet); | 135 visitor->traceWrappers(sheet); |
| 132 } | 136 } |
| 133 } | 137 } |
| 134 } // namespace blink | 138 } // namespace blink |
| OLD | NEW |