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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 return m_documentScopeDirty || updateMode == FullStyleUpdate; | 340 return m_documentScopeDirty || updateMode == FullStyleUpdate; |
341 } | 341 } |
342 | 342 |
343 bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdate
Mode updateMode) const | 343 bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdate
Mode updateMode) const |
344 { | 344 { |
345 return !m_dirtyTreeScopes.isEmpty() || updateMode == FullStyleUpdate; | 345 return !m_dirtyTreeScopes.isEmpty() || updateMode == FullStyleUpdate; |
346 } | 346 } |
347 | 347 |
348 void StyleEngine::clearMediaQueryRuleSetOnTreeScopeStyleSheets(TreeScopeSet tree
Scopes) | 348 void StyleEngine::clearMediaQueryRuleSetOnTreeScopeStyleSheets(TreeScopeSet tree
Scopes) |
349 { | 349 { |
350 for (TreeScopeSet::iterator it = treeScopes.begin(); it != treeScopes.end();
++it) { | 350 for (TreeScope* scope : treeScopes) { |
351 TreeScope& treeScope = **it; | 351 TreeScope& treeScope = *scope; |
352 ASSERT(treeScope != m_document); | 352 ASSERT(treeScope != m_document); |
353 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeStyle
SheetCollection*>(styleSheetCollectionFor(treeScope)); | 353 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeStyle
SheetCollection*>(styleSheetCollectionFor(treeScope)); |
354 ASSERT(collection); | 354 ASSERT(collection); |
355 collection->clearMediaQueryRuleSetStyleSheets(); | 355 collection->clearMediaQueryRuleSetStyleSheets(); |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 void StyleEngine::clearMediaQueryRuleSetStyleSheets() | 359 void StyleEngine::clearMediaQueryRuleSetStyleSheets() |
360 { | 360 { |
361 documentStyleSheetCollection()->clearMediaQueryRuleSetStyleSheets(); | 361 documentStyleSheetCollection()->clearMediaQueryRuleSetStyleSheets(); |
(...skipping 18 matching lines...) Expand all Loading... |
380 if (!document().isActive()) | 380 if (!document().isActive()) |
381 return; | 381 return; |
382 | 382 |
383 if (shouldUpdateDocumentStyleSheetCollection(updateMode)) | 383 if (shouldUpdateDocumentStyleSheetCollection(updateMode)) |
384 documentStyleSheetCollection()->updateActiveStyleSheets(this, updateMode
); | 384 documentStyleSheetCollection()->updateActiveStyleSheets(this, updateMode
); |
385 | 385 |
386 if (shouldUpdateShadowTreeStyleSheetCollection(updateMode)) { | 386 if (shouldUpdateShadowTreeStyleSheetCollection(updateMode)) { |
387 TreeScopeSet treeScopes = updateMode == FullStyleUpdate ? m_activeTreeSc
opes : m_dirtyTreeScopes; | 387 TreeScopeSet treeScopes = updateMode == FullStyleUpdate ? m_activeTreeSc
opes : m_dirtyTreeScopes; |
388 HashSet<TreeScope*> treeScopesRemoved; | 388 HashSet<TreeScope*> treeScopesRemoved; |
389 | 389 |
390 for (TreeScopeSet::iterator it = treeScopes.begin(); it != treeScopes.en
d(); ++it) { | 390 for (TreeScope* treeScope : treeScopes) { |
391 TreeScope* treeScope = *it; | |
392 ASSERT(treeScope != m_document); | 391 ASSERT(treeScope != m_document); |
393 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeS
tyleSheetCollection*>(styleSheetCollectionFor(*treeScope)); | 392 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeS
tyleSheetCollection*>(styleSheetCollectionFor(*treeScope)); |
394 ASSERT(collection); | 393 ASSERT(collection); |
395 collection->updateActiveStyleSheets(this, updateMode); | 394 collection->updateActiveStyleSheets(this, updateMode); |
396 if (!collection->hasStyleSheetCandidateNodes()) { | 395 if (!collection->hasStyleSheetCandidateNodes()) { |
397 treeScopesRemoved.add(treeScope); | 396 treeScopesRemoved.add(treeScope); |
398 // When removing TreeScope from ActiveTreeScopes, | 397 // When removing TreeScope from ActiveTreeScopes, |
399 // its resolver should be destroyed by invoking resetAuthorStyle
. | 398 // its resolver should be destroyed by invoking resetAuthorStyle
. |
400 ASSERT(!treeScope->scopedStyleResolver()); | 399 ASSERT(!treeScope->scopedStyleResolver()); |
401 } | 400 } |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 visitor->trace(m_styleSheetCollectionMap); | 690 visitor->trace(m_styleSheetCollectionMap); |
692 visitor->trace(m_resolver); | 691 visitor->trace(m_resolver); |
693 visitor->trace(m_fontSelector); | 692 visitor->trace(m_fontSelector); |
694 visitor->trace(m_textToSheetCache); | 693 visitor->trace(m_textToSheetCache); |
695 visitor->trace(m_sheetToTextCache); | 694 visitor->trace(m_sheetToTextCache); |
696 #endif | 695 #endif |
697 CSSFontSelectorClient::trace(visitor); | 696 CSSFontSelectorClient::trace(visitor); |
698 } | 697 } |
699 | 698 |
700 } | 699 } |
OLD | NEW |