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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class CSSStyleSheet; | 43 class CSSStyleSheet; |
44 class Document; | 44 class Document; |
45 class Node; | 45 class Node; |
46 class RuleFeatureSet; | 46 class RuleFeatureSet; |
47 class StyleRuleFontFace; | 47 class StyleRuleFontFace; |
48 class StyleSheetContents; | 48 class StyleSheetContents; |
49 | 49 |
50 class StyleEngine final : public CSSFontSelectorClient { | 50 class StyleEngine final : public CSSFontSelectorClient { |
51 WTF_MAKE_FAST_ALLOCATED; | 51 WTF_MAKE_FAST_ALLOCATED; |
52 public: | 52 public: |
53 | |
54 class IgnoringPendingStylesheet : public TemporaryChange<bool> { | |
55 public: | |
56 IgnoringPendingStylesheet(StyleEngine* engine) | |
57 : TemporaryChange<bool>(engine->m_ignorePendingStylesheets, true) | |
58 { | |
59 } | |
60 }; | |
61 | |
62 friend class IgnoringPendingStylesheet; | |
63 | |
64 static PassOwnPtr<StyleEngine> create(Document& document) { return adoptPtr(
new StyleEngine(document)); } | 53 static PassOwnPtr<StyleEngine> create(Document& document) { return adoptPtr(
new StyleEngine(document)); } |
65 | 54 |
66 ~StyleEngine(); | 55 ~StyleEngine(); |
67 | 56 |
68 void detachFromDocument(); | 57 void detachFromDocument(); |
69 | 58 |
70 void addStyleSheetCandidateNode(Node*, bool createdByParser); | 59 void addStyleSheetCandidateNode(Node*, bool createdByParser); |
71 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode, TreeSc
ope&); | 60 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode, TreeSc
ope&); |
72 | 61 |
73 void updateActiveStyleSheets(); | 62 void updateActiveStyleSheets(); |
74 | 63 |
75 bool ignoringPendingStylesheets() const { return m_ignorePendingStylesheets;
} | |
76 | |
77 // FIXME(sky): Remove this and ::first-line. | 64 // FIXME(sky): Remove this and ::first-line. |
78 bool usesFirstLineRules() const { return false; } | 65 bool usesFirstLineRules() const { return false; } |
79 | 66 |
80 void appendActiveAuthorStyleSheets(); | 67 void appendActiveAuthorStyleSheets(); |
81 | 68 |
82 StyleResolver* resolver() const | 69 StyleResolver* resolver() const |
83 { | 70 { |
84 return m_resolver.get(); | 71 return m_resolver.get(); |
85 } | 72 } |
86 | 73 |
(...skipping 30 matching lines...) Expand all Loading... |
117 private: | 104 private: |
118 explicit StyleEngine(Document&); | 105 explicit StyleEngine(Document&); |
119 | 106 |
120 void createResolver(); | 107 void createResolver(); |
121 | 108 |
122 RawPtr<Document> m_document; | 109 RawPtr<Document> m_document; |
123 | 110 |
124 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; | 111 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; |
125 TreeScopeSet m_activeTreeScopes; | 112 TreeScopeSet m_activeTreeScopes; |
126 | 113 |
127 bool m_ignorePendingStylesheets; | |
128 OwnPtr<StyleResolver> m_resolver; | 114 OwnPtr<StyleResolver> m_resolver; |
129 | 115 |
130 RefPtr<CSSFontSelector> m_fontSelector; | 116 RefPtr<CSSFontSelector> m_fontSelector; |
131 | 117 |
132 HashMap<AtomicString, StyleSheetContents*> m_textToSheetCache; | 118 HashMap<AtomicString, StyleSheetContents*> m_textToSheetCache; |
133 HashMap<StyleSheetContents*, AtomicString> m_sheetToTextCache; | 119 HashMap<StyleSheetContents*, AtomicString> m_sheetToTextCache; |
134 }; | 120 }; |
135 | 121 |
136 } | 122 } |
137 | 123 |
138 #endif // SKY_ENGINE_CORE_DOM_STYLEENGINE_H_ | 124 #endif // SKY_ENGINE_CORE_DOM_STYLEENGINE_H_ |
OLD | NEW |