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