Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 #include "core/css/CSSDefaultStyleSheets.h" | 30 #include "core/css/CSSDefaultStyleSheets.h" |
| 31 | 31 |
| 32 #include "core/MathMLNames.h" | 32 #include "core/MathMLNames.h" |
| 33 #include "core/css/MediaQueryEvaluator.h" | 33 #include "core/css/MediaQueryEvaluator.h" |
| 34 #include "core/css/RuleSet.h" | 34 #include "core/css/RuleSet.h" |
| 35 #include "core/css/StyleSheetContents.h" | 35 #include "core/css/StyleSheetContents.h" |
| 36 #include "core/dom/Fullscreen.h" | 36 #include "core/dom/Fullscreen.h" |
| 37 #include "core/html/HTMLAnchorElement.h" | 37 #include "core/html/HTMLAnchorElement.h" |
| 38 #include "core/html/HTMLHtmlElement.h" | 38 #include "core/html/HTMLHtmlElement.h" |
| 39 #include "core/layout/LayoutTheme.h" | 39 #include "core/layout/LayoutTheme.h" |
| 40 #include "core/page/Page.h" | |
|
philipj_slow
2015/07/08 10:31:51
Seems to compile without this include.
liberato (no reviews please)
2015/07/09 12:10:56
thanks, removed.
| |
| 40 #include "platform/PlatformResourceLoader.h" | 41 #include "platform/PlatformResourceLoader.h" |
| 41 #include "wtf/LeakAnnotations.h" | 42 #include "wtf/LeakAnnotations.h" |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 using namespace HTMLNames; | 46 using namespace HTMLNames; |
| 46 | 47 |
| 47 CSSDefaultStyleSheets& CSSDefaultStyleSheets::instance() | 48 CSSDefaultStyleSheets& CSSDefaultStyleSheets::instance() |
| 48 { | 49 { |
| 49 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CSSDefaultStyleSheets>, cssDefaul tStyleSheets, (adoptPtrWillBeNoop(new CSSDefaultStyleSheets()))); | 50 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CSSDefaultStyleSheets>, cssDefaul tStyleSheets, (adoptPtrWillBeNoop(new CSSDefaultStyleSheets()))); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 if (element.namespaceURI() == MathMLNames::mathmlNamespaceURI | 150 if (element.namespaceURI() == MathMLNames::mathmlNamespaceURI |
| 150 && !m_mathmlStyleSheet) { | 151 && !m_mathmlStyleSheet) { |
| 151 m_mathmlStyleSheet = parseUASheet(loadResourceAsASCIIString("mathml.css" )); | 152 m_mathmlStyleSheet = parseUASheet(loadResourceAsASCIIString("mathml.css" )); |
| 152 m_defaultStyle->addRulesFromSheet(mathmlStyleSheet(), screenEval()); | 153 m_defaultStyle->addRulesFromSheet(mathmlStyleSheet(), screenEval()); |
| 153 m_defaultPrintStyle->addRulesFromSheet(mathmlStyleSheet(), printEval()); | 154 m_defaultPrintStyle->addRulesFromSheet(mathmlStyleSheet(), printEval()); |
| 154 changedDefaultStyle = true; | 155 changedDefaultStyle = true; |
| 155 } | 156 } |
| 156 | 157 |
| 157 // FIXME: We should assert that this sheet only contains rules for <video> a nd <audio>. | 158 // FIXME: We should assert that this sheet only contains rules for <video> a nd <audio>. |
| 158 if (!m_mediaControlsStyleSheet && (isHTMLVideoElement(element) || isHTMLAudi oElement(element))) { | 159 if (!m_mediaControlsStyleSheet && (isHTMLVideoElement(element) || isHTMLAudi oElement(element))) { |
| 159 String mediaRules = loadResourceAsASCIIString("mediaControls.css") + Lay outTheme::theme().extraMediaControlsStyleSheet(); | 160 String mediaRules = loadResourceAsASCIIString( |
| 161 RuntimeEnabledFeatures::newMediaPlaybackUiEnabled() ? | |
| 162 "mediaControlsNew.css" : "mediaControls.css") + | |
| 163 LayoutTheme::theme().extraMediaControlsStyleSheet(); | |
| 160 m_mediaControlsStyleSheet = parseUASheet(mediaRules); | 164 m_mediaControlsStyleSheet = parseUASheet(mediaRules); |
| 161 m_defaultStyle->addRulesFromSheet(mediaControlsStyleSheet(), screenEval( )); | 165 m_defaultStyle->addRulesFromSheet(mediaControlsStyleSheet(), screenEval( )); |
| 162 m_defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet(), printE val()); | 166 m_defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet(), printE val()); |
| 163 changedDefaultStyle = true; | 167 changedDefaultStyle = true; |
| 164 } | 168 } |
| 165 | 169 |
| 166 // FIXME: This only works because we Force recalc the entire document so the new sheet | 170 // FIXME: This only works because we Force recalc the entire document so the new sheet |
| 167 // is loaded for <html> and the correct styles apply to everyone. | 171 // is loaded for <html> and the correct styles apply to everyone. |
| 168 if (!m_fullscreenStyleSheet && Fullscreen::isFullScreen(element.document())) { | 172 if (!m_fullscreenStyleSheet && Fullscreen::isFullScreen(element.document())) { |
| 169 String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + L ayoutTheme::theme().extraFullScreenStyleSheet(); | 173 String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + L ayoutTheme::theme().extraFullScreenStyleSheet(); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 188 visitor->trace(m_defaultStyleSheet); | 192 visitor->trace(m_defaultStyleSheet); |
| 189 visitor->trace(m_mobileViewportStyleSheet); | 193 visitor->trace(m_mobileViewportStyleSheet); |
| 190 visitor->trace(m_quirksStyleSheet); | 194 visitor->trace(m_quirksStyleSheet); |
| 191 visitor->trace(m_svgStyleSheet); | 195 visitor->trace(m_svgStyleSheet); |
| 192 visitor->trace(m_mathmlStyleSheet); | 196 visitor->trace(m_mathmlStyleSheet); |
| 193 visitor->trace(m_mediaControlsStyleSheet); | 197 visitor->trace(m_mediaControlsStyleSheet); |
| 194 visitor->trace(m_fullscreenStyleSheet); | 198 visitor->trace(m_fullscreenStyleSheet); |
| 195 } | 199 } |
| 196 | 200 |
| 197 } // namespace blink | 201 } // namespace blink |
| OLD | NEW |