| 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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "sky/engine/config.h" | 28 #include "sky/engine/config.h" |
| 29 #include "sky/engine/core/dom/StyleEngine.h" | 29 #include "sky/engine/core/dom/StyleEngine.h" |
| 30 | 30 |
| 31 #include "sky/engine/core/css/CSSFontSelector.h" | 31 #include "sky/engine/core/css/CSSFontSelector.h" |
| 32 #include "sky/engine/core/css/CSSStyleSheet.h" | 32 #include "sky/engine/core/css/CSSStyleSheet.h" |
| 33 #include "sky/engine/core/css/FontFaceCache.h" | 33 #include "sky/engine/core/css/FontFaceCache.h" |
| 34 #include "sky/engine/core/css/StyleSheetContents.h" | 34 #include "sky/engine/core/css/StyleSheetContents.h" |
| 35 #include "sky/engine/core/dom/Document.h" | 35 #include "sky/engine/core/dom/Document.h" |
| 36 #include "sky/engine/core/dom/Element.h" | 36 #include "sky/engine/core/dom/Element.h" |
| 37 #include "sky/engine/core/dom/ElementTraversal.h" | 37 #include "sky/engine/core/dom/ElementTraversal.h" |
| 38 #include "sky/engine/core/dom/StyleSheetCollection.h" | |
| 39 #include "sky/engine/core/dom/shadow/ShadowRoot.h" | 38 #include "sky/engine/core/dom/shadow/ShadowRoot.h" |
| 40 #include "sky/engine/core/frame/Settings.h" | 39 #include "sky/engine/core/frame/Settings.h" |
| 41 #include "sky/engine/core/html/HTMLStyleElement.h" | 40 #include "sky/engine/core/html/HTMLStyleElement.h" |
| 42 #include "sky/engine/core/html/imports/HTMLImportsController.h" | 41 #include "sky/engine/core/html/imports/HTMLImportsController.h" |
| 43 #include "sky/engine/core/page/Page.h" | 42 #include "sky/engine/core/page/Page.h" |
| 44 #include "sky/engine/core/rendering/RenderView.h" | 43 #include "sky/engine/core/rendering/RenderView.h" |
| 45 | 44 |
| 46 namespace blink { | 45 namespace blink { |
| 47 | 46 |
| 48 StyleEngine::StyleEngine(Document& document) | 47 StyleEngine::StyleEngine(Document& document) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 68 void StyleEngine::removeTreeScope(TreeScope& scope) | 67 void StyleEngine::removeTreeScope(TreeScope& scope) |
| 69 { | 68 { |
| 70 m_activeTreeScopes.remove(&scope); | 69 m_activeTreeScopes.remove(&scope); |
| 71 } | 70 } |
| 72 | 71 |
| 73 void StyleEngine::updateActiveStyleSheets() | 72 void StyleEngine::updateActiveStyleSheets() |
| 74 { | 73 { |
| 75 ASSERT(!m_document->inStyleRecalc()); | 74 ASSERT(!m_document->inStyleRecalc()); |
| 76 ASSERT(m_resolver); | 75 ASSERT(m_resolver); |
| 77 | 76 |
| 77 StyleResolver& resolver = m_document->ensureStyleResolver(); |
| 78 |
| 79 resolver.resetMediaQueryAffectedByViewportChange(); |
| 80 |
| 78 for (TreeScope* treeScope : m_activeTreeScopes) | 81 for (TreeScope* treeScope : m_activeTreeScopes) |
| 79 treeScope->styleSheets().updateActiveStyleSheets(*m_resolver); | 82 treeScope->scopedStyleResolver().updateActiveStyleSheets(); |
| 80 | 83 |
| 81 m_document->renderView()->style()->font().update(fontSelector()); | 84 m_document->renderView()->style()->font().update(fontSelector()); |
| 82 } | 85 } |
| 83 | 86 |
| 84 void StyleEngine::resolverChanged() | 87 void StyleEngine::resolverChanged() |
| 85 { | 88 { |
| 86 if (!m_document->isActive()) | 89 if (!m_document->isActive()) |
| 87 return; | 90 return; |
| 88 updateActiveStyleSheets(); | 91 updateActiveStyleSheets(); |
| 89 } | 92 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 m_sheetToTextCache.remove(contents); | 140 m_sheetToTextCache.remove(contents); |
| 138 } | 141 } |
| 139 | 142 |
| 140 void StyleEngine::fontsNeedUpdate(CSSFontSelector*) | 143 void StyleEngine::fontsNeedUpdate(CSSFontSelector*) |
| 141 { | 144 { |
| 142 m_resolver->invalidateMatchedPropertiesCache(); | 145 m_resolver->invalidateMatchedPropertiesCache(); |
| 143 m_document->setNeedsStyleRecalc(SubtreeStyleChange); | 146 m_document->setNeedsStyleRecalc(SubtreeStyleChange); |
| 144 } | 147 } |
| 145 | 148 |
| 146 } | 149 } |
| OLD | NEW |