| 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/HTMLHtmlElement.h" |
| 38 #include "core/html/HTMLVideoElement.h" | 39 #include "core/html/HTMLVideoElement.h" |
| 39 #include "core/rendering/RenderTheme.h" | 40 #include "core/rendering/RenderTheme.h" |
| 40 | 41 |
| 41 namespace WebCore { | 42 namespace WebCore { |
| 42 | 43 |
| 43 using namespace HTMLNames; | 44 using namespace HTMLNames; |
| 44 | 45 |
| 45 RuleSet* CSSDefaultStyleSheets::defaultStyle; | 46 RuleSet* CSSDefaultStyleSheets::defaultStyle; |
| 46 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; | 47 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; |
| 47 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; | 48 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; |
| 48 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; | 49 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; |
| 49 | 50 |
| 50 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet; | 51 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet; |
| 51 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet; | 52 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet; |
| 52 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet; | 53 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet; |
| 53 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet; | 54 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet; |
| 54 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet; | 55 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet; |
| 55 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet; | 56 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet; |
| 56 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet; | 57 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet; |
| 57 | 58 |
| 58 // FIXME: It would be nice to use some mechanism that guarantees this is in sync
with the real UA stylesheet. | 59 // FIXME: It would be nice to use some mechanism that guarantees this is in sync
with the real UA stylesheet. |
| 59 static const char* simpleUserAgentStyleSheet = "html,body,div{display:block}head
{display:none}body{margin:8px}div:focus,span:focus{outline:auto 5px -webkit-focu
s-ring-color}a:-webkit-any-link{color:-webkit-link;text-decoration:underline}a:-
webkit-any-link:active{color:-webkit-activelink}"; | 60 static const char* simpleUserAgentStyleSheet = "html,body,div{display:block}head
{display:none}body{margin:8px}div:focus,span:focus{outline:auto 5px -webkit-focu
s-ring-color}a:-webkit-any-link{color:-webkit-link;text-decoration:underline}a:-
webkit-any-link:active{color:-webkit-activelink}"; |
| 60 | 61 |
| 61 static inline bool elementCanUseSimpleDefaultStyle(Element* e) | 62 static inline bool elementCanUseSimpleDefaultStyle(Element* e) |
| 62 { | 63 { |
| 63 return e->hasTagName(htmlTag) || e->hasTagName(headTag) || e->hasTagName(bod
yTag) || e->hasTagName(divTag) || e->hasTagName(spanTag) || e->hasTagName(brTag)
|| isHTMLAnchorElement(e); | 64 return isHTMLHtmlElement(e) || e->hasTagName(headTag) || e->hasTagName(bodyT
ag) || e->hasTagName(divTag) || e->hasTagName(spanTag) || e->hasTagName(brTag) |
| isHTMLAnchorElement(e); |
| 64 } | 65 } |
| 65 | 66 |
| 66 static const MediaQueryEvaluator& screenEval() | 67 static const MediaQueryEvaluator& screenEval() |
| 67 { | 68 { |
| 68 DEFINE_STATIC_LOCAL(const MediaQueryEvaluator, staticScreenEval, ("screen"))
; | 69 DEFINE_STATIC_LOCAL(const MediaQueryEvaluator, staticScreenEval, ("screen"))
; |
| 69 return staticScreenEval; | 70 return staticScreenEval; |
| 70 } | 71 } |
| 71 | 72 |
| 72 static const MediaQueryEvaluator& printEval() | 73 static const MediaQueryEvaluator& printEval() |
| 73 { | 74 { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); | 182 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); |
| 182 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()
); | 183 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()
); |
| 183 changedDefaultStyle = true; | 184 changedDefaultStyle = true; |
| 184 } | 185 } |
| 185 | 186 |
| 186 ASSERT(defaultStyle->features().idsInRules.isEmpty()); | 187 ASSERT(defaultStyle->features().idsInRules.isEmpty()); |
| 187 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); | 188 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); |
| 188 } | 189 } |
| 189 | 190 |
| 190 } // namespace WebCore | 191 } // namespace WebCore |
| OLD | NEW |