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 | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 #include "core/css/CSSDefaultStyleSheets.h" | 31 #include "core/css/CSSDefaultStyleSheets.h" |
32 | 32 |
33 #include "core/MathMLNames.h" | 33 #include "core/MathMLNames.h" |
34 #include "core/css/MediaQueryEvaluator.h" | 34 #include "core/css/MediaQueryEvaluator.h" |
35 #include "core/css/RuleSet.h" | 35 #include "core/css/RuleSet.h" |
36 #include "core/css/StyleSheetContents.h" | 36 #include "core/css/StyleSheetContents.h" |
37 #include "core/dom/Fullscreen.h" | 37 #include "core/dom/Fullscreen.h" |
38 #include "core/html/HTMLAnchorElement.h" | 38 #include "core/html/HTMLAnchorElement.h" |
39 #include "core/html/HTMLHtmlElement.h" | 39 #include "core/html/HTMLHtmlElement.h" |
40 #include "core/html/HTMLSlotElement.h" | |
40 #include "core/layout/LayoutTheme.h" | 41 #include "core/layout/LayoutTheme.h" |
41 #include "platform/PlatformResourceLoader.h" | 42 #include "platform/PlatformResourceLoader.h" |
42 #include "wtf/LeakAnnotations.h" | 43 #include "wtf/LeakAnnotations.h" |
43 | 44 |
44 namespace blink { | 45 namespace blink { |
45 | 46 |
46 using namespace HTMLNames; | 47 using namespace HTMLNames; |
47 | 48 |
48 CSSDefaultStyleSheets& CSSDefaultStyleSheets::instance() { | 49 CSSDefaultStyleSheets& CSSDefaultStyleSheets::instance() { |
49 DEFINE_STATIC_LOCAL(CSSDefaultStyleSheets, cssDefaultStyleSheets, | 50 DEFINE_STATIC_LOCAL(CSSDefaultStyleSheets, cssDefaultStyleSheets, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 (isHTMLVideoElement(element) || isHTMLAudioElement(element))) { | 153 (isHTMLVideoElement(element) || isHTMLAudioElement(element))) { |
153 String mediaRules = loadResourceAsASCIIString("mediaControls.css") + | 154 String mediaRules = loadResourceAsASCIIString("mediaControls.css") + |
154 LayoutTheme::theme().extraMediaControlsStyleSheet(); | 155 LayoutTheme::theme().extraMediaControlsStyleSheet(); |
155 m_mediaControlsStyleSheet = parseUASheet(mediaRules); | 156 m_mediaControlsStyleSheet = parseUASheet(mediaRules); |
156 m_defaultStyle->addRulesFromSheet(mediaControlsStyleSheet(), screenEval()); | 157 m_defaultStyle->addRulesFromSheet(mediaControlsStyleSheet(), screenEval()); |
157 m_defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet(), | 158 m_defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet(), |
158 printEval()); | 159 printEval()); |
159 changedDefaultStyle = true; | 160 changedDefaultStyle = true; |
160 } | 161 } |
161 | 162 |
163 if (isHTMLSlotElement(element) && | |
164 RuntimeEnabledFeatures::cssDisplayContentsEnabled() && | |
165 !m_slotStyleSheet) { | |
kochi
2016/11/01 06:43:13
If the reason for having a separate UA stylesheet
rune
2016/11/01 07:38:17
I think we might as well add it to html.css. When
| |
166 m_slotStyleSheet = parseUASheet(loadResourceAsASCIIString("slot.css")); | |
167 m_defaultStyle->addRulesFromSheet(slotStyleSheet(), screenEval()); | |
168 m_defaultPrintStyle->addRulesFromSheet(slotStyleSheet(), printEval()); | |
169 changedDefaultStyle = true; | |
170 } | |
171 | |
162 ASSERT(!m_defaultStyle->features().hasIdsInSelectors()); | 172 ASSERT(!m_defaultStyle->features().hasIdsInSelectors()); |
163 ASSERT(m_defaultStyle->features().siblingRules.isEmpty()); | 173 ASSERT(m_defaultStyle->features().siblingRules.isEmpty()); |
164 return changedDefaultStyle; | 174 return changedDefaultStyle; |
165 } | 175 } |
166 | 176 |
167 void CSSDefaultStyleSheets::ensureDefaultStyleSheetForFullscreen() { | 177 void CSSDefaultStyleSheets::ensureDefaultStyleSheetForFullscreen() { |
168 if (m_fullscreenStyleSheet) | 178 if (m_fullscreenStyleSheet) |
169 return; | 179 return; |
170 | 180 |
171 String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + | 181 String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + |
(...skipping 10 matching lines...) Expand all Loading... | |
182 visitor->trace(m_defaultViewSourceStyle); | 192 visitor->trace(m_defaultViewSourceStyle); |
183 visitor->trace(m_defaultStyleSheet); | 193 visitor->trace(m_defaultStyleSheet); |
184 visitor->trace(m_mobileViewportStyleSheet); | 194 visitor->trace(m_mobileViewportStyleSheet); |
185 visitor->trace(m_televisionViewportStyleSheet); | 195 visitor->trace(m_televisionViewportStyleSheet); |
186 visitor->trace(m_xhtmlMobileProfileStyleSheet); | 196 visitor->trace(m_xhtmlMobileProfileStyleSheet); |
187 visitor->trace(m_quirksStyleSheet); | 197 visitor->trace(m_quirksStyleSheet); |
188 visitor->trace(m_svgStyleSheet); | 198 visitor->trace(m_svgStyleSheet); |
189 visitor->trace(m_mathmlStyleSheet); | 199 visitor->trace(m_mathmlStyleSheet); |
190 visitor->trace(m_mediaControlsStyleSheet); | 200 visitor->trace(m_mediaControlsStyleSheet); |
191 visitor->trace(m_fullscreenStyleSheet); | 201 visitor->trace(m_fullscreenStyleSheet); |
202 visitor->trace(m_slotStyleSheet); | |
192 } | 203 } |
193 | 204 |
194 } // namespace blink | 205 } // namespace blink |
OLD | NEW |