| 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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 bool TreeScopeStyleSheetCollection::HasStyleSheets() const { | 73 bool TreeScopeStyleSheetCollection::HasStyleSheets() const { |
| 74 for (Node* node : style_sheet_candidate_nodes_) { | 74 for (Node* node : style_sheet_candidate_nodes_) { |
| 75 StyleSheetCandidate candidate(*node); | 75 StyleSheetCandidate candidate(*node); |
| 76 if (candidate.Sheet() || candidate.IsEnabledAndLoading()) | 76 if (candidate.Sheet() || candidate.IsEnabledAndLoading()) |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 return false; | 79 return false; |
| 80 } | 80 } |
| 81 | 81 |
| 82 void TreeScopeStyleSheetCollection::CollectStyleSheetsForList() { | 82 void TreeScopeStyleSheetCollection::UpdateStyleSheetList() { |
| 83 if (!sheet_list_dirty_) |
| 84 return; |
| 85 |
| 83 HeapVector<Member<StyleSheet>> new_list; | 86 HeapVector<Member<StyleSheet>> new_list; |
| 84 for (Node* node : style_sheet_candidate_nodes_) { | 87 for (Node* node : style_sheet_candidate_nodes_) { |
| 85 StyleSheetCandidate candidate(*node); | 88 StyleSheetCandidate candidate(*node); |
| 86 DCHECK(!candidate.IsXSL()); | 89 DCHECK(!candidate.IsXSL()); |
| 87 if (candidate.IsImport()) | 90 if (candidate.IsImport()) |
| 88 continue; | 91 continue; |
| 89 if (candidate.IsEnabledAndLoading()) | 92 if (candidate.IsEnabledAndLoading()) |
| 90 continue; | 93 continue; |
| 91 if (StyleSheet* sheet = candidate.Sheet()) | 94 if (StyleSheet* sheet = candidate.Sheet()) |
| 92 new_list.push_back(sheet); | 95 new_list.push_back(sheet); |
| 93 } | 96 } |
| 94 SwapSheetsForSheetList(new_list); | 97 SwapSheetsForSheetList(new_list); |
| 95 } | 98 } |
| 96 | 99 |
| 97 DEFINE_TRACE(TreeScopeStyleSheetCollection) { | 100 DEFINE_TRACE(TreeScopeStyleSheetCollection) { |
| 98 visitor->Trace(tree_scope_); | 101 visitor->Trace(tree_scope_); |
| 99 visitor->Trace(style_sheet_candidate_nodes_); | 102 visitor->Trace(style_sheet_candidate_nodes_); |
| 100 StyleSheetCollection::Trace(visitor); | 103 StyleSheetCollection::Trace(visitor); |
| 101 } | 104 } |
| 102 | 105 |
| 103 } // namespace blink | 106 } // namespace blink |
| OLD | NEW |