| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Docum
entStyleSheetCollector& collector) | 63 void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Docum
entStyleSheetCollector& collector) |
| 64 { | 64 { |
| 65 ASSERT(document().styleEngine() == engine); | 65 ASSERT(document().styleEngine() == engine); |
| 66 collector.appendActiveStyleSheets(engine->documentAuthorStyleSheets()); | 66 collector.appendActiveStyleSheets(engine->documentAuthorStyleSheets()); |
| 67 collectStyleSheetsFromCandidates(engine, collector); | 67 collectStyleSheetsFromCandidates(engine, collector); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine,
StyleResolverUpdateMode updateMode) | 70 void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine) |
| 71 { | 71 { |
| 72 StyleSheetCollection collection; | 72 StyleSheetCollection collection; |
| 73 ActiveDocumentStyleSheetCollector collector(collection); | 73 ActiveDocumentStyleSheetCollector collector(collection); |
| 74 collectStyleSheets(engine, collector); | 74 collectStyleSheets(engine, collector); |
| 75 | 75 |
| 76 StyleSheetChange change; | 76 engine->clearMasterResolver(); |
| 77 analyzeStyleSheetChange(updateMode, collection, change); | 77 // FIMXE: The following depends on whether StyleRuleFontFace was modified or
not. |
| 78 // No need to always-clear font cache. |
| 79 engine->clearFontCache(); |
| 78 | 80 |
| 79 if (change.styleResolverUpdateType == Reconstruct) { | 81 // TODO(esprehn): This is terrible and not needed in Sky, we should mark |
| 80 engine->clearMasterResolver(); | 82 // specific tree scopes dirty instead. |
| 81 // FIMXE: The following depends on whether StyleRuleFontFace was modifie
d or not. | 83 document().setNeedsStyleRecalc(SubtreeStyleChange); |
| 82 // No need to always-clear font cache. | |
| 83 engine->clearFontCache(); | |
| 84 } else if (StyleResolver* styleResolver = engine->resolver()) { | |
| 85 if (change.styleResolverUpdateType != Additive) { | |
| 86 ASSERT(change.styleResolverUpdateType == Reset); | |
| 87 styleResolver->resetAuthorStyle(treeScope()); | |
| 88 engine->removeFontFaceRules(change.fontFaceRulesToRemove); | |
| 89 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleShe
ets); | |
| 90 styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAutho
rStyleSheets()); | |
| 91 } else { | |
| 92 styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets
.size(), collection.activeAuthorStyleSheets()); | |
| 93 } | |
| 94 } | |
| 95 if (change.requiresFullStyleRecalc) | |
| 96 document().setNeedsStyleRecalc(SubtreeStyleChange); | |
| 97 | 84 |
| 98 collection.swap(*this); | 85 collection.swap(*this); |
| 99 | 86 |
| 100 updateUsesRemUnits(); | 87 updateUsesRemUnits(); |
| 101 } | 88 } |
| 102 | 89 |
| 103 } | 90 } |
| OLD | NEW |