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; |
51 | 52 |
52 class TreeScopeStyleSheetCollection : public StyleSheetCollection { | 53 class TreeScopeStyleSheetCollection : public StyleSheetCollection { |
53 public: | 54 public: |
54 void addStyleSheetCandidateNode(Node*, bool createdByParser); | 55 void addStyleSheetCandidateNode(Node*, bool createdByParser); |
55 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode); | 56 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode); |
56 bool hasStyleSheetCandidateNodes() const { return !m_styleSheetCandidateNode
s.isEmpty(); } | 57 bool hasStyleSheetCandidateNodes() const { return !m_styleSheetCandidateNode
s.isEmpty(); } |
57 | 58 |
58 | 59 |
59 bool usesRemUnits() const { return m_usesRemUnits; } | 60 bool usesRemUnits() const { return m_usesRemUnits; } |
60 | 61 |
61 DocumentOrderedList& styleSheetCandidateNodes() { return m_styleSheetCandida
teNodes; } | 62 DocumentOrderedList& styleSheetCandidateNodes() { return m_styleSheetCandida
teNodes; } |
62 DocumentOrderedList* scopingNodesForStyleScoped() { return m_scopingNodesFor
StyleScoped.scopingNodes(); } | 63 DocumentOrderedList* scopingNodesForStyleScoped() { return m_scopingNodesFor
StyleScoped.scopingNodes(); } |
63 ListHashSet<Node*, 4>* scopingNodesRemoved() { return m_scopingNodesForStyle
Scoped.scopingNodesRemoved(); } | 64 ListHashSet<Node*, 4>* scopingNodesRemoved() { return m_scopingNodesForStyle
Scoped.scopingNodesRemoved(); } |
64 | 65 |
65 void clearMediaQueryRuleSetStyleSheets(); | 66 void clearMediaQueryRuleSetStyleSheets(); |
66 | 67 |
67 protected: | 68 protected: |
68 explicit TreeScopeStyleSheetCollection(TreeScope&); | 69 explicit TreeScopeStyleSheetCollection(TreeScope&); |
69 | 70 |
70 Document& document() const { return m_treeScope.document(); } | 71 Document& document() const { return m_treeScope.document(); } |
71 | 72 |
72 enum StyleResolverUpdateType { | 73 enum StyleResolverUpdateType { |
73 Reconstruct, | 74 Reconstruct, |
74 Reset, | 75 Reset, |
75 Additive, | 76 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; |
82 | 83 |
83 StyleSheetChange() | 84 StyleSheetChange() |
84 : styleResolverUpdateType(Reconstruct) | 85 : styleResolverUpdateType(Reconstruct) |
85 , requiresFullStyleRecalc(true) { } | 86 , requiresFullStyleRecalc(true) { } |
86 }; | 87 }; |
87 | 88 |
88 void analyzeStyleSheetChange(StyleResolverUpdateMode, const StyleSheetCollec
tion&, StyleSheetChange&); | 89 void analyzeStyleSheetChange(StyleResolverUpdateMode, const StyleSheetCollec
tion&, StyleSheetChange&); |
89 void resetAllRuleSetsInTreeScope(StyleResolver*); | 90 void resetAllRuleSetsInTreeScope(StyleResolver*); |
90 void updateUsesRemUnits(); | 91 void updateUsesRemUnits(); |
91 | 92 |
92 private: | 93 private: |
93 static StyleResolverUpdateType compareStyleSheets(const Vector<RefPtr<CSSSty
leSheet> >& oldStyleSheets, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets
, Vector<StyleSheetContents*>& addedSheets); | 94 static StyleResolverUpdateType compareStyleSheets(const Vector<RefPtr<CSSSty
leSheet> >& oldStyleSheets, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets
, Vector<StyleSheetContents*>& addedSheets); |
94 bool activeLoadingStyleSheetLoaded(const Vector<RefPtr<CSSStyleSheet> >& new
StyleSheets); | 95 bool activeLoadingStyleSheetLoaded(const Vector<RefPtr<CSSStyleSheet> >& new
StyleSheets); |
95 | 96 |
96 protected: | 97 protected: |
97 TreeScope& m_treeScope; | 98 TreeScope& m_treeScope; |
98 bool m_hadActiveLoadingStylesheet; | 99 bool m_hadActiveLoadingStylesheet; |
99 bool m_usesRemUnits; | 100 bool m_usesRemUnits; |
100 | 101 |
101 DocumentOrderedList m_styleSheetCandidateNodes; | 102 DocumentOrderedList m_styleSheetCandidateNodes; |
102 StyleSheetScopingNodeList m_scopingNodesForStyleScoped; | 103 StyleSheetScopingNodeList m_scopingNodesForStyleScoped; |
103 }; | 104 }; |
104 | 105 |
105 } | 106 } |
106 | 107 |
107 #endif | 108 #endif |
108 | 109 |
OLD | NEW |