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 21 matching lines...) Expand all Loading... |
32 #include "core/css/StyleSheetContents.h" | 32 #include "core/css/StyleSheetContents.h" |
33 #include "core/css/resolver/StyleResolver.h" | 33 #include "core/css/resolver/StyleResolver.h" |
34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
35 #include "core/dom/Element.h" | 35 #include "core/dom/Element.h" |
36 #include "core/dom/StyleSheetCollections.h" | 36 #include "core/dom/StyleSheetCollections.h" |
37 #include "core/html/HTMLStyleElement.h" | 37 #include "core/html/HTMLStyleElement.h" |
38 #include "core/page/Settings.h" | 38 #include "core/page/Settings.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 StyleSheetCollection::StyleSheetCollection(TreeScope* treeScope) | 42 StyleSheetCollection::StyleSheetCollection(TreeScope& treeScope) |
43 : m_treeScope(treeScope) | 43 : m_treeScope(treeScope) |
44 , m_hadActiveLoadingStylesheet(false) | 44 , m_hadActiveLoadingStylesheet(false) |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 void StyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdBy
Parser) | 48 void StyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdBy
Parser) |
49 { | 49 { |
50 if (!node->inDocument()) | 50 if (!node->inDocument()) |
51 return; | 51 return; |
52 | 52 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 { | 153 { |
154 // FIXME: If many web developers use style scoped, implement reset RuleSets
in per-scoping node manner. | 154 // FIXME: If many web developers use style scoped, implement reset RuleSets
in per-scoping node manner. |
155 if (DocumentOrderedList* styleScopedScopingNodes = scopingNodesForStyleScope
d()) { | 155 if (DocumentOrderedList* styleScopedScopingNodes = scopingNodesForStyleScope
d()) { |
156 for (DocumentOrderedList::iterator it = styleScopedScopingNodes->begin()
; it != styleScopedScopingNodes->end(); ++it) | 156 for (DocumentOrderedList::iterator it = styleScopedScopingNodes->begin()
; it != styleScopedScopingNodes->end(); ++it) |
157 styleResolver->resetAuthorStyle(toContainerNode(*it)); | 157 styleResolver->resetAuthorStyle(toContainerNode(*it)); |
158 } | 158 } |
159 if (ListHashSet<Node*, 4>* removedNodes = scopingNodesRemoved()) { | 159 if (ListHashSet<Node*, 4>* removedNodes = scopingNodesRemoved()) { |
160 for (ListHashSet<Node*, 4>::iterator it = removedNodes->begin(); it != r
emovedNodes->end(); ++it) | 160 for (ListHashSet<Node*, 4>::iterator it = removedNodes->begin(); it != r
emovedNodes->end(); ++it) |
161 styleResolver->resetAuthorStyle(toContainerNode(*it)); | 161 styleResolver->resetAuthorStyle(toContainerNode(*it)); |
162 } | 162 } |
163 styleResolver->resetAuthorStyle(toContainerNode(m_treeScope->rootNode())); | 163 styleResolver->resetAuthorStyle(toContainerNode(m_treeScope.rootNode())); |
164 } | 164 } |
165 | 165 |
166 static bool styleSheetsUseRemUnits(const Vector<RefPtr<CSSStyleSheet> >& sheets) | 166 static bool styleSheetsUseRemUnits(const Vector<RefPtr<CSSStyleSheet> >& sheets) |
167 { | 167 { |
168 for (unsigned i = 0; i < sheets.size(); ++i) { | 168 for (unsigned i = 0; i < sheets.size(); ++i) { |
169 if (sheets[i]->contents()->usesRemUnits()) | 169 if (sheets[i]->contents()->usesRemUnits()) |
170 return true; | 170 return true; |
171 } | 171 } |
172 return false; | 172 return false; |
173 } | 173 } |
174 | 174 |
175 void StyleSheetCollection::updateUsesRemUnits() | 175 void StyleSheetCollection::updateUsesRemUnits() |
176 { | 176 { |
177 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); | 177 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); |
178 } | 178 } |
179 | 179 |
180 } | 180 } |
OLD | NEW |