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 r ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 StyleSheetCollectionBase::~StyleSheetCollectionBase() | 46 StyleSheetCollectionBase::~StyleSheetCollectionBase() |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 void StyleSheetCollectionBase::swap(StyleSheetCollectionBase& other) | 50 void StyleSheetCollectionBase::swap(StyleSheetCollectionBase& other) |
51 { | 51 { |
52 m_styleSheetsForStyleSheetList.swap(other.m_styleSheetsForStyleSheetList); | 52 m_styleSheetsForStyleSheetList.swap(other.m_styleSheetsForStyleSheetList); |
53 m_activeAuthorStyleSheets.swap(other.m_activeAuthorStyleSheets); | 53 m_activeAuthorStyleSheets.swap(other.m_activeAuthorStyleSheets); |
54 } | 54 } |
55 | 55 |
56 void StyleSheetCollectionBase::swapSheetsForSheetList(Vector<RefPtr<StyleSheet> >& sheets) | |
esprehn
2014/01/24 09:30:10
We should rename this something like StyleSheetCol
| |
57 { | |
58 // Only called for collection of HTML Imports that never has active sheets. | |
59 ASSERT(m_activeAuthorStyleSheets.isEmpty()); | |
60 m_styleSheetsForStyleSheetList.swap(sheets); | |
61 } | |
62 | |
56 void StyleSheetCollectionBase::appendActiveStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& sheets) | 63 void StyleSheetCollectionBase::appendActiveStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& sheets) |
57 { | 64 { |
58 m_activeAuthorStyleSheets.append(sheets); | 65 m_activeAuthorStyleSheets.append(sheets); |
59 } | 66 } |
60 | 67 |
61 void StyleSheetCollectionBase::appendActiveStyleSheet(CSSStyleSheet* sheet) | 68 void StyleSheetCollectionBase::appendActiveStyleSheet(CSSStyleSheet* sheet) |
62 { | 69 { |
63 m_activeAuthorStyleSheets.append(sheet); | 70 m_activeAuthorStyleSheets.append(sheet); |
64 } | 71 } |
65 | 72 |
66 void StyleSheetCollectionBase::appendSheetForList(StyleSheet* sheet) | 73 void StyleSheetCollectionBase::appendSheetForList(StyleSheet* sheet) |
67 { | 74 { |
68 m_styleSheetsForStyleSheetList.append(sheet); | 75 m_styleSheetsForStyleSheetList.append(sheet); |
69 } | 76 } |
70 | 77 |
78 DocumentStyleSheetCollector StyleSheetCollectionBase::collector() | |
esprehn
2014/01/24 09:30:10
More copying, why not just create the DocumentStyl
| |
79 { | |
80 return DocumentStyleSheetCollector(m_styleSheetsForStyleSheetList, m_activeA uthorStyleSheets); | |
81 } | |
82 | |
83 | |
71 | 84 |
72 StyleSheetCollection::StyleSheetCollection(TreeScope& treeScope) | 85 StyleSheetCollection::StyleSheetCollection(TreeScope& treeScope) |
73 : m_treeScope(treeScope) | 86 : m_treeScope(treeScope) |
74 , m_hadActiveLoadingStylesheet(false) | 87 , m_hadActiveLoadingStylesheet(false) |
75 , m_usesRemUnits(false) | 88 , m_usesRemUnits(false) |
76 { | 89 { |
77 } | 90 } |
78 | 91 |
79 void StyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdBy Parser) | 92 void StyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdBy Parser) |
80 { | 93 { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 } | 269 } |
257 return false; | 270 return false; |
258 } | 271 } |
259 | 272 |
260 void StyleSheetCollection::updateUsesRemUnits() | 273 void StyleSheetCollection::updateUsesRemUnits() |
261 { | 274 { |
262 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); | 275 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); |
263 } | 276 } |
264 | 277 |
265 } | 278 } |
OLD | NEW |