| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 #include "core/css/CSSDefaultStyleSheets.h" | 30 #include "core/css/CSSDefaultStyleSheets.h" |
| 31 | 31 |
| 32 #include "UserAgentStyleSheets.h" | 32 #include "UserAgentStyleSheets.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/FullscreenController.h" | 36 #include "core/dom/FullscreenController.h" |
| 37 #include "core/html/HTMLAnchorElement.h" | 37 #include "core/html/HTMLAnchorElement.h" |
| 38 #include "core/html/HTMLVideoElement.h" |
| 38 #include "core/rendering/RenderTheme.h" | 39 #include "core/rendering/RenderTheme.h" |
| 39 | 40 |
| 40 namespace WebCore { | 41 namespace WebCore { |
| 41 | 42 |
| 42 using namespace HTMLNames; | 43 using namespace HTMLNames; |
| 43 | 44 |
| 44 RuleSet* CSSDefaultStyleSheets::defaultStyle; | 45 RuleSet* CSSDefaultStyleSheets::defaultStyle; |
| 45 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; | 46 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; |
| 46 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; | 47 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; |
| 47 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; | 48 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 160 } |
| 160 | 161 |
| 161 if (element->isSVGElement() && !svgStyleSheet) { | 162 if (element->isSVGElement() && !svgStyleSheet) { |
| 162 // SVG rules. | 163 // SVG rules. |
| 163 svgStyleSheet = parseUASheet(svgUserAgentStyleSheet, sizeof(svgUserAgent
StyleSheet)); | 164 svgStyleSheet = parseUASheet(svgUserAgentStyleSheet, sizeof(svgUserAgent
StyleSheet)); |
| 164 defaultStyle->addRulesFromSheet(svgStyleSheet, screenEval()); | 165 defaultStyle->addRulesFromSheet(svgStyleSheet, screenEval()); |
| 165 defaultPrintStyle->addRulesFromSheet(svgStyleSheet, printEval()); | 166 defaultPrintStyle->addRulesFromSheet(svgStyleSheet, printEval()); |
| 166 changedDefaultStyle = true; | 167 changedDefaultStyle = true; |
| 167 } | 168 } |
| 168 | 169 |
| 169 if (!mediaControlsStyleSheet && (element->hasTagName(videoTag) || element->h
asTagName(audioTag))) { | 170 if (!mediaControlsStyleSheet && (isHTMLVideoElement(element) || element->has
TagName(audioTag))) { |
| 170 String mediaRules = String(mediaControlsUserAgentStyleSheet, sizeof(medi
aControlsUserAgentStyleSheet)) + RenderTheme::themeForPage(element->document()->
page())->extraMediaControlsStyleSheet(); | 171 String mediaRules = String(mediaControlsUserAgentStyleSheet, sizeof(medi
aControlsUserAgentStyleSheet)) + RenderTheme::themeForPage(element->document()->
page())->extraMediaControlsStyleSheet(); |
| 171 mediaControlsStyleSheet = parseUASheet(mediaRules); | 172 mediaControlsStyleSheet = parseUASheet(mediaRules); |
| 172 defaultStyle->addRulesFromSheet(mediaControlsStyleSheet, screenEval()); | 173 defaultStyle->addRulesFromSheet(mediaControlsStyleSheet, screenEval()); |
| 173 defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet, printEval(
)); | 174 defaultPrintStyle->addRulesFromSheet(mediaControlsStyleSheet, printEval(
)); |
| 174 changedDefaultStyle = true; | 175 changedDefaultStyle = true; |
| 175 } | 176 } |
| 176 | 177 |
| 177 if (!fullscreenStyleSheet && FullscreenController::isFullScreen(element->doc
ument())) { | 178 if (!fullscreenStyleSheet && FullscreenController::isFullScreen(element->doc
ument())) { |
| 178 String fullscreenRules = String(fullscreenUserAgentStyleSheet, sizeof(fu
llscreenUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraFullScreenStyl
eSheet(); | 179 String fullscreenRules = String(fullscreenUserAgentStyleSheet, sizeof(fu
llscreenUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraFullScreenStyl
eSheet(); |
| 179 fullscreenStyleSheet = parseUASheet(fullscreenRules); | 180 fullscreenStyleSheet = parseUASheet(fullscreenRules); |
| 180 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); | 181 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); |
| 181 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()
); | 182 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()
); |
| 182 changedDefaultStyle = true; | 183 changedDefaultStyle = true; |
| 183 } | 184 } |
| 184 | 185 |
| 185 ASSERT(defaultStyle->features().idsInRules.isEmpty()); | 186 ASSERT(defaultStyle->features().idsInRules.isEmpty()); |
| 186 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); | 187 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); |
| 187 } | 188 } |
| 188 | 189 |
| 189 } // namespace WebCore | 190 } // namespace WebCore |
| OLD | NEW |