OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "core/rendering/RenderTheme.h" | 40 #include "core/rendering/RenderTheme.h" |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 using namespace HTMLNames; | 44 using namespace HTMLNames; |
45 | 45 |
46 RuleSet* CSSDefaultStyleSheets::defaultStyle; | 46 RuleSet* CSSDefaultStyleSheets::defaultStyle; |
47 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; | 47 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; |
48 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; | 48 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; |
49 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; | 49 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; |
| 50 RuleSet* CSSDefaultStyleSheets::defaultXHTMLMobileProfileStyle; |
50 | 51 |
51 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet; | 52 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet; |
52 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet; | 53 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet; |
53 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet; | 54 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet; |
54 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet; | 55 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet; |
55 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet; | 56 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet; |
56 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet; | 57 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet; |
57 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet; | 58 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet; |
58 | 59 |
59 // FIXME: It would be nice to use some mechanism that guarantees this is in sync
with the real UA stylesheet. | 60 // FIXME: It would be nice to use some mechanism that guarantees this is in sync
with the real UA stylesheet. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 146 |
146 RuleSet* CSSDefaultStyleSheets::viewSourceStyle() | 147 RuleSet* CSSDefaultStyleSheets::viewSourceStyle() |
147 { | 148 { |
148 if (!defaultViewSourceStyle) { | 149 if (!defaultViewSourceStyle) { |
149 defaultViewSourceStyle = RuleSet::create().leakPtr(); | 150 defaultViewSourceStyle = RuleSet::create().leakPtr(); |
150 defaultViewSourceStyle->addRulesFromSheet(parseUASheet(sourceUserAgentSt
yleSheet, sizeof(sourceUserAgentStyleSheet)), screenEval()); | 151 defaultViewSourceStyle->addRulesFromSheet(parseUASheet(sourceUserAgentSt
yleSheet, sizeof(sourceUserAgentStyleSheet)), screenEval()); |
151 } | 152 } |
152 return defaultViewSourceStyle; | 153 return defaultViewSourceStyle; |
153 } | 154 } |
154 | 155 |
| 156 RuleSet* CSSDefaultStyleSheets::xhtmlMobileProfileStyle() |
| 157 { |
| 158 if (!defaultXHTMLMobileProfileStyle) { |
| 159 defaultXHTMLMobileProfileStyle = RuleSet::create().leakPtr(); |
| 160 defaultXHTMLMobileProfileStyle->addRulesFromSheet(parseUASheet(xhtmlmpUs
erAgentStyleSheet, sizeof(xhtmlmpUserAgentStyleSheet)), screenEval()); |
| 161 } |
| 162 return defaultXHTMLMobileProfileStyle; |
| 163 } |
155 | 164 |
156 void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
bool& changedDefaultStyle) | 165 void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
bool& changedDefaultStyle) |
157 { | 166 { |
158 if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(element)) { | 167 if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(element)) { |
159 loadFullDefaultStyle(); | 168 loadFullDefaultStyle(); |
160 changedDefaultStyle = true; | 169 changedDefaultStyle = true; |
161 } | 170 } |
162 | 171 |
163 if (element->isSVGElement() && !svgStyleSheet) { | 172 if (element->isSVGElement() && !svgStyleSheet) { |
164 // SVG rules. | 173 // SVG rules. |
(...skipping 17 matching lines...) Expand all Loading... |
182 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); | 191 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); |
183 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()
); | 192 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()
); |
184 changedDefaultStyle = true; | 193 changedDefaultStyle = true; |
185 } | 194 } |
186 | 195 |
187 ASSERT(defaultStyle->features().idsInRules.isEmpty()); | 196 ASSERT(defaultStyle->features().idsInRules.isEmpty()); |
188 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); | 197 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); |
189 } | 198 } |
190 | 199 |
191 } // namespace WebCore | 200 } // namespace WebCore |
OLD | NEW |