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) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 class ContainerNode; | 45 class ContainerNode; |
46 class DocumentStyleSheetCollector; | 46 class DocumentStyleSheetCollector; |
47 class StyleEngine; | 47 class StyleEngine; |
48 class Node; | 48 class Node; |
49 class StyleSheetContents; | 49 class StyleSheetContents; |
50 class StyleSheetList; | 50 class StyleSheetList; |
51 class StyleRuleFontFace; | |
52 | 51 |
53 class TreeScopeStyleSheetCollection : public StyleSheetCollection { | 52 class TreeScopeStyleSheetCollection : public StyleSheetCollection { |
54 public: | 53 public: |
55 void addStyleSheetCandidateNode(Node*, bool createdByParser); | 54 void addStyleSheetCandidateNode(Node*, bool createdByParser); |
56 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode); | 55 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode); |
57 bool hasStyleSheetCandidateNodes() const { return !m_styleSheetCandidateNode
s.isEmpty(); } | 56 bool hasStyleSheetCandidateNodes() const { return !m_styleSheetCandidateNode
s.isEmpty(); } |
58 | 57 |
59 | 58 |
60 bool usesRemUnits() const { return m_usesRemUnits; } | 59 bool usesRemUnits() const { return m_usesRemUnits; } |
61 | 60 |
62 DocumentOrderedList& styleSheetCandidateNodes() { return m_styleSheetCandida
teNodes; } | 61 DocumentOrderedList& styleSheetCandidateNodes() { return m_styleSheetCandida
teNodes; } |
63 DocumentOrderedList* scopingNodesForStyleScoped() { return m_scopingNodesFor
StyleScoped.scopingNodes(); } | 62 DocumentOrderedList* scopingNodesForStyleScoped() { return m_scopingNodesFor
StyleScoped.scopingNodes(); } |
64 ListHashSet<Node*, 4>* scopingNodesRemoved() { return m_scopingNodesForStyle
Scoped.scopingNodesRemoved(); } | 63 ListHashSet<Node*, 4>* scopingNodesRemoved() { return m_scopingNodesForStyle
Scoped.scopingNodesRemoved(); } |
65 | 64 |
66 void clearMediaQueryRuleSetStyleSheets(); | 65 void clearMediaQueryRuleSetStyleSheets(); |
67 | 66 |
68 protected: | 67 protected: |
69 explicit TreeScopeStyleSheetCollection(TreeScope&); | 68 explicit TreeScopeStyleSheetCollection(TreeScope&); |
70 | 69 |
71 Document& document() const { return m_treeScope.document(); } | 70 Document& document() const { return m_treeScope.document(); } |
72 | 71 |
73 enum StyleResolverUpdateType { | 72 enum StyleResolverUpdateType { |
74 Reconstruct, | 73 Reconstruct, |
75 Reset, | 74 Reset, |
76 Additive | 75 Additive, |
| 76 ResetStyleResolverAndFontSelector |
77 }; | 77 }; |
78 | 78 |
79 struct StyleSheetChange { | 79 struct StyleSheetChange { |
80 StyleResolverUpdateType styleResolverUpdateType; | 80 StyleResolverUpdateType styleResolverUpdateType; |
81 bool requiresFullStyleRecalc; | 81 bool requiresFullStyleRecalc; |
82 Vector<const StyleRuleFontFace*> fontFaceRulesToRemove; | |
83 | 82 |
84 StyleSheetChange() | 83 StyleSheetChange() |
85 : styleResolverUpdateType(Reconstruct) | 84 : styleResolverUpdateType(Reconstruct) |
86 , requiresFullStyleRecalc(true) { } | 85 , requiresFullStyleRecalc(true) { } |
87 }; | 86 }; |
88 | 87 |
89 void analyzeStyleSheetChange(StyleResolverUpdateMode, const StyleSheetCollec
tion&, StyleSheetChange&); | 88 void analyzeStyleSheetChange(StyleResolverUpdateMode, const StyleSheetCollec
tion&, StyleSheetChange&); |
90 void resetAllRuleSetsInTreeScope(StyleResolver*); | 89 void resetAllRuleSetsInTreeScope(StyleResolver*); |
91 void updateUsesRemUnits(); | 90 void updateUsesRemUnits(); |
92 | 91 |
93 private: | 92 private: |
94 static StyleResolverUpdateType compareStyleSheets(const Vector<RefPtr<CSSSty
leSheet> >& oldStyleSheets, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets
, Vector<StyleSheetContents*>& addedSheets); | 93 static StyleResolverUpdateType compareStyleSheets(const Vector<RefPtr<CSSSty
leSheet> >& oldStyleSheets, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets
, Vector<StyleSheetContents*>& addedSheets); |
95 bool activeLoadingStyleSheetLoaded(const Vector<RefPtr<CSSStyleSheet> >& new
StyleSheets); | 94 bool activeLoadingStyleSheetLoaded(const Vector<RefPtr<CSSStyleSheet> >& new
StyleSheets); |
96 | 95 |
97 protected: | 96 protected: |
98 TreeScope& m_treeScope; | 97 TreeScope& m_treeScope; |
99 bool m_hadActiveLoadingStylesheet; | 98 bool m_hadActiveLoadingStylesheet; |
100 bool m_usesRemUnits; | 99 bool m_usesRemUnits; |
101 | 100 |
102 DocumentOrderedList m_styleSheetCandidateNodes; | 101 DocumentOrderedList m_styleSheetCandidateNodes; |
103 StyleSheetScopingNodeList m_scopingNodesForStyleScoped; | 102 StyleSheetScopingNodeList m_scopingNodesForStyleScoped; |
104 }; | 103 }; |
105 | 104 |
106 } | 105 } |
107 | 106 |
108 #endif | 107 #endif |
109 | 108 |
OLD | NEW |