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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 String mediaRules = loadResourceAsASCIIString( | 158 String mediaRules = loadResourceAsASCIIString( |
159 RuntimeEnabledFeatures::newMediaPlaybackUiEnabled() ? | 159 RuntimeEnabledFeatures::newMediaPlaybackUiEnabled() ? |
160 "mediaControlsNew.css" : "mediaControls.css") + | 160 "mediaControlsNew.css" : "mediaControls.css") + |
161 LayoutTheme::theme().extraMediaControlsStyleSheet(); | 161 LayoutTheme::theme().extraMediaControlsStyleSheet(); |
162 m_mediaControlsStyleSheet = parseUASheet(mediaRules); | 162 m_mediaControlsStyleSheet = parseUASheet(mediaRules); |
163 m_defaultStyle->addRulesFromSheet(mediaControlsStyleSheet(), screenEval(
)); | 163 m_defaultStyle->addRulesFromSheet(mediaControlsStyleSheet(), screenEval(
)); |
164 m_defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet(), printE
val()); | 164 m_defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet(), printE
val()); |
165 changedDefaultStyle = true; | 165 changedDefaultStyle = true; |
166 } | 166 } |
167 | 167 |
168 // FIXME: This only works because we Force recalc the entire document so the
new sheet | |
169 // is loaded for <html> and the correct styles apply to everyone. | |
170 if (!m_fullscreenStyleSheet && Fullscreen::isFullScreen(element.document()))
{ | |
171 String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + L
ayoutTheme::theme().extraFullScreenStyleSheet(); | |
172 m_fullscreenStyleSheet = parseUASheet(fullscreenRules); | |
173 m_defaultStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval()); | |
174 m_defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEv
al()); | |
175 changedDefaultStyle = true; | |
176 } | |
177 | |
178 ASSERT(!m_defaultStyle->features().hasIdsInSelectors()); | 168 ASSERT(!m_defaultStyle->features().hasIdsInSelectors()); |
179 ASSERT(m_defaultStyle->features().siblingRules.isEmpty()); | 169 ASSERT(m_defaultStyle->features().siblingRules.isEmpty()); |
180 } | 170 } |
181 | 171 |
| 172 void CSSDefaultStyleSheets::ensureDefaultStyleSheetForFullscreen() |
| 173 { |
| 174 if (m_fullscreenStyleSheet) |
| 175 return; |
| 176 |
| 177 String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + Layou
tTheme::theme().extraFullScreenStyleSheet(); |
| 178 m_fullscreenStyleSheet = parseUASheet(fullscreenRules); |
| 179 m_defaultStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval()); |
| 180 m_defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval()
); |
| 181 } |
| 182 |
182 DEFINE_TRACE(CSSDefaultStyleSheets) | 183 DEFINE_TRACE(CSSDefaultStyleSheets) |
183 { | 184 { |
184 visitor->trace(m_defaultStyle); | 185 visitor->trace(m_defaultStyle); |
185 visitor->trace(m_defaultMobileViewportStyle); | 186 visitor->trace(m_defaultMobileViewportStyle); |
186 visitor->trace(m_defaultQuirksStyle); | 187 visitor->trace(m_defaultQuirksStyle); |
187 visitor->trace(m_defaultPrintStyle); | 188 visitor->trace(m_defaultPrintStyle); |
188 visitor->trace(m_defaultViewSourceStyle); | 189 visitor->trace(m_defaultViewSourceStyle); |
189 visitor->trace(m_defaultXHTMLMobileProfileStyle); | 190 visitor->trace(m_defaultXHTMLMobileProfileStyle); |
190 visitor->trace(m_defaultStyleSheet); | 191 visitor->trace(m_defaultStyleSheet); |
191 visitor->trace(m_mobileViewportStyleSheet); | 192 visitor->trace(m_mobileViewportStyleSheet); |
192 visitor->trace(m_quirksStyleSheet); | 193 visitor->trace(m_quirksStyleSheet); |
193 visitor->trace(m_svgStyleSheet); | 194 visitor->trace(m_svgStyleSheet); |
194 visitor->trace(m_mathmlStyleSheet); | 195 visitor->trace(m_mathmlStyleSheet); |
195 visitor->trace(m_mediaControlsStyleSheet); | 196 visitor->trace(m_mediaControlsStyleSheet); |
196 visitor->trace(m_fullscreenStyleSheet); | 197 visitor->trace(m_fullscreenStyleSheet); |
197 } | 198 } |
198 | 199 |
199 } // namespace blink | 200 } // namespace blink |
OLD | NEW |