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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 ~StyleEngine(); | 55 ~StyleEngine(); |
56 | 56 |
57 void detachFromDocument(); | 57 void detachFromDocument(); |
58 | 58 |
59 void addTreeScope(TreeScope&); | 59 void addTreeScope(TreeScope&); |
60 void removeTreeScope(TreeScope&); | 60 void removeTreeScope(TreeScope&); |
61 | 61 |
62 // FIXME(sky): Remove this and ::first-line. | 62 // FIXME(sky): Remove this and ::first-line. |
63 bool usesFirstLineRules() const { return false; } | 63 bool usesFirstLineRules() const { return false; } |
64 | 64 |
65 void appendActiveAuthorStyleSheets(); | 65 StyleResolver& resolver() { return *m_resolver; } |
66 | |
67 StyleResolver* resolver() const | |
68 { | |
69 return m_resolver.get(); | |
70 } | |
71 | |
72 StyleResolver& ensureResolver() | |
73 { | |
74 if (!m_resolver) { | |
75 createResolver(); | |
76 } else if (m_resolver->hasPendingAuthorStyleSheets()) { | |
77 m_resolver->appendPendingAuthorStyleSheets(); | |
78 } | |
79 return *m_resolver.get(); | |
80 } | |
81 | |
82 bool hasResolver() const { return m_resolver.get(); } | |
83 void clearResolver(); | |
84 | 66 |
85 CSSFontSelector* fontSelector() { return m_fontSelector.get(); } | 67 CSSFontSelector* fontSelector() { return m_fontSelector.get(); } |
86 void clearFontCache(); | 68 void clearFontCache(); |
87 // updateGenericFontFamilySettings is used from WebSettingsImpl. | 69 // updateGenericFontFamilySettings is used from WebSettingsImpl. |
88 void updateGenericFontFamilySettings(); | 70 void updateGenericFontFamilySettings(); |
89 | 71 |
90 void resolverChanged(); | 72 void resolverChanged(); |
91 unsigned resolverAccessCount() const; | 73 unsigned resolverAccessCount() const; |
92 | 74 |
93 PassRefPtr<CSSStyleSheet> createSheet(Element*, const String& text); | 75 PassRefPtr<CSSStyleSheet> createSheet(Element*, const String& text); |
94 void removeSheet(StyleSheetContents*); | 76 void removeSheet(StyleSheetContents*); |
95 | 77 |
96 private: | 78 private: |
97 // CSSFontSelectorClient implementation. | 79 // CSSFontSelectorClient implementation. |
98 virtual void fontsNeedUpdate(CSSFontSelector*) override; | 80 virtual void fontsNeedUpdate(CSSFontSelector*) override; |
99 | 81 |
100 private: | 82 private: |
101 explicit StyleEngine(Document&); | 83 explicit StyleEngine(Document&); |
102 | 84 |
103 void updateActiveStyleSheets(); | 85 void updateActiveStyleSheets(); |
104 void createResolver(); | |
105 | 86 |
106 RawPtr<Document> m_document; | 87 RawPtr<Document> m_document; |
107 | 88 |
108 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; | 89 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; |
109 TreeScopeSet m_activeTreeScopes; | 90 TreeScopeSet m_activeTreeScopes; |
110 | 91 |
111 OwnPtr<StyleResolver> m_resolver; | 92 OwnPtr<StyleResolver> m_resolver; |
112 | 93 |
113 RefPtr<CSSFontSelector> m_fontSelector; | 94 RefPtr<CSSFontSelector> m_fontSelector; |
114 | 95 |
115 HashMap<AtomicString, StyleSheetContents*> m_textToSheetCache; | 96 HashMap<AtomicString, StyleSheetContents*> m_textToSheetCache; |
116 HashMap<StyleSheetContents*, AtomicString> m_sheetToTextCache; | 97 HashMap<StyleSheetContents*, AtomicString> m_sheetToTextCache; |
117 }; | 98 }; |
118 | 99 |
119 } | 100 } |
120 | 101 |
121 #endif // SKY_ENGINE_CORE_DOM_STYLEENGINE_H_ | 102 #endif // SKY_ENGINE_CORE_DOM_STYLEENGINE_H_ |
OLD | NEW |