| 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 29 matching lines...) Expand all Loading... |
| 40 #include "sky/engine/core/html/imports/HTMLImportsController.h" | 40 #include "sky/engine/core/html/imports/HTMLImportsController.h" |
| 41 #include "sky/engine/core/page/Page.h" | 41 #include "sky/engine/core/page/Page.h" |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 StyleEngine::StyleEngine(Document& document) | 45 StyleEngine::StyleEngine(Document& document) |
| 46 : m_document(&document) | 46 : m_document(&document) |
| 47 , m_isMaster(!document.importsController() || document.importsController()->
master() == &document) | 47 , m_isMaster(!document.importsController() || document.importsController()->
master() == &document) |
| 48 , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(docume
nt)) | 48 , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(docume
nt)) |
| 49 , m_documentScopeDirty(true) | 49 , m_documentScopeDirty(true) |
| 50 , m_usesRemUnits(false) | |
| 51 , m_ignorePendingStylesheets(false) | 50 , m_ignorePendingStylesheets(false) |
| 52 // We don't need to create CSSFontSelector for imported document or | 51 // We don't need to create CSSFontSelector for imported document or |
| 53 // HTMLTemplateElement's document, because those documents have no frame. | 52 // HTMLTemplateElement's document, because those documents have no frame. |
| 54 , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nul
lptr) | 53 , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nul
lptr) |
| 55 { | 54 { |
| 56 if (m_fontSelector) | 55 if (m_fontSelector) |
| 57 m_fontSelector->registerForInvalidationCallbacks(this); | 56 m_fontSelector->registerForInvalidationCallbacks(this); |
| 58 } | 57 } |
| 59 | 58 |
| 60 StyleEngine::~StyleEngine() | 59 StyleEngine::~StyleEngine() |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 TreeScope* treeScope = *it; | 228 TreeScope* treeScope = *it; |
| 230 ASSERT(treeScope != m_document); | 229 ASSERT(treeScope != m_document); |
| 231 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeStyle
SheetCollection*>(styleSheetCollectionFor(*treeScope)); | 230 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeStyle
SheetCollection*>(styleSheetCollectionFor(*treeScope)); |
| 232 ASSERT(collection); | 231 ASSERT(collection); |
| 233 collection->updateActiveStyleSheets(this); | 232 collection->updateActiveStyleSheets(this); |
| 234 if (!collection->hasStyleSheetCandidateNodes()) | 233 if (!collection->hasStyleSheetCandidateNodes()) |
| 235 treeScopesRemoved.add(treeScope); | 234 treeScopesRemoved.add(treeScope); |
| 236 } | 235 } |
| 237 m_activeTreeScopes.removeAll(treeScopesRemoved); | 236 m_activeTreeScopes.removeAll(treeScopesRemoved); |
| 238 | 237 |
| 239 m_usesRemUnits = documentStyleSheetCollection()->usesRemUnits(); | |
| 240 | |
| 241 m_dirtyTreeScopes.clear(); | 238 m_dirtyTreeScopes.clear(); |
| 242 m_documentScopeDirty = false; | 239 m_documentScopeDirty = false; |
| 243 } | 240 } |
| 244 | 241 |
| 245 void StyleEngine::didRemoveShadowRoot(ShadowRoot* shadowRoot) | 242 void StyleEngine::didRemoveShadowRoot(ShadowRoot* shadowRoot) |
| 246 { | 243 { |
| 247 if (shadowRoot->scopedStyleResolver()) | 244 if (shadowRoot->scopedStyleResolver()) |
| 248 removeScopedStyleResolver(shadowRoot->scopedStyleResolver()); | 245 removeScopedStyleResolver(shadowRoot->scopedStyleResolver()); |
| 249 m_styleSheetCollectionMap.remove(shadowRoot); | 246 m_styleSheetCollectionMap.remove(shadowRoot); |
| 250 } | 247 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 { | 415 { |
| 419 if (!document().isActive()) | 416 if (!document().isActive()) |
| 420 return; | 417 return; |
| 421 | 418 |
| 422 if (m_resolver) | 419 if (m_resolver) |
| 423 m_resolver->invalidateMatchedPropertiesCache(); | 420 m_resolver->invalidateMatchedPropertiesCache(); |
| 424 document().setNeedsStyleRecalc(SubtreeStyleChange); | 421 document().setNeedsStyleRecalc(SubtreeStyleChange); |
| 425 } | 422 } |
| 426 | 423 |
| 427 } | 424 } |
| OLD | NEW |