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() { |
| 83 HeapVector<Member<StyleSheet>> new_list; |
| 84 for (Node* node : style_sheet_candidate_nodes_) { |
| 85 StyleSheetCandidate candidate(*node); |
| 86 DCHECK(!candidate.IsXSL()); |
| 87 if (candidate.IsImport()) |
| 88 continue; |
| 89 if (candidate.IsEnabledAndLoading()) |
| 90 continue; |
| 91 if (StyleSheet* sheet = candidate.Sheet()) |
| 92 new_list.push_back(sheet); |
| 93 } |
| 94 SwapSheetsForSheetList(new_list); |
| 95 } |
| 96 |
82 DEFINE_TRACE(TreeScopeStyleSheetCollection) { | 97 DEFINE_TRACE(TreeScopeStyleSheetCollection) { |
83 visitor->Trace(tree_scope_); | 98 visitor->Trace(tree_scope_); |
84 visitor->Trace(style_sheet_candidate_nodes_); | 99 visitor->Trace(style_sheet_candidate_nodes_); |
85 StyleSheetCollection::Trace(visitor); | 100 StyleSheetCollection::Trace(visitor); |
86 } | 101 } |
87 | 102 |
88 } // namespace blink | 103 } // namespace blink |
OLD | NEW |