Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: Source/core/css/CSSDefaultStyleSheets.cpp

Issue 18888002: Introduce isHTMLAnchorElement and toHTMLAnchorElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 */ 27 */
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/rendering/RenderTheme.h" 38 #include "core/rendering/RenderTheme.h"
38 39
39 namespace WebCore { 40 namespace WebCore {
40 41
41 using namespace HTMLNames; 42 using namespace HTMLNames;
42 43
43 RuleSet* CSSDefaultStyleSheets::defaultStyle; 44 RuleSet* CSSDefaultStyleSheets::defaultStyle;
44 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; 45 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle;
45 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; 46 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle;
46 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; 47 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle;
47 48
48 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet; 49 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet;
49 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet; 50 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet;
50 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet; 51 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet;
51 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet; 52 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet;
52 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet; 53 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet;
53 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet; 54 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet;
54 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet; 55 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet;
55 56
56 // FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet. 57 // FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet.
57 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}"; 58 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}";
58 59
59 static inline bool elementCanUseSimpleDefaultStyle(Element* e) 60 static inline bool elementCanUseSimpleDefaultStyle(Element* e)
60 { 61 {
61 return e->hasTagName(htmlTag) || e->hasTagName(headTag) || e->hasTagName(bod yTag) || e->hasTagName(divTag) || e->hasTagName(spanTag) || e->hasTagName(brTag) || e->hasTagName(aTag); 62 return e->hasTagName(htmlTag) || e->hasTagName(headTag) || e->hasTagName(bod yTag) || e->hasTagName(divTag) || e->hasTagName(spanTag) || e->hasTagName(brTag) || isHTMLAnchorElement(e);
62 } 63 }
63 64
64 static const MediaQueryEvaluator& screenEval() 65 static const MediaQueryEvaluator& screenEval()
65 { 66 {
66 DEFINE_STATIC_LOCAL(const MediaQueryEvaluator, staticScreenEval, ("screen")) ; 67 DEFINE_STATIC_LOCAL(const MediaQueryEvaluator, staticScreenEval, ("screen")) ;
67 return staticScreenEval; 68 return staticScreenEval;
68 } 69 }
69 70
70 static const MediaQueryEvaluator& printEval() 71 static const MediaQueryEvaluator& printEval()
71 { 72 {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); 180 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval());
180 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval() ); 181 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval() );
181 changedDefaultStyle = true; 182 changedDefaultStyle = true;
182 } 183 }
183 184
184 ASSERT(defaultStyle->features().idsInRules.isEmpty()); 185 ASSERT(defaultStyle->features().idsInRules.isEmpty());
185 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); 186 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty());
186 } 187 }
187 188
188 } // namespace WebCore 189 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/accessibility/AccessibilityRenderObject.cpp ('k') | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698