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

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

Issue 23742003: Use css-device-adapt constraining for legacy viewport tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issues. Created 7 years, 3 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 29 matching lines...) Expand all
40 #include "core/rendering/RenderTheme.h" 40 #include "core/rendering/RenderTheme.h"
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 using namespace HTMLNames; 44 using namespace HTMLNames;
45 45
46 RuleSet* CSSDefaultStyleSheets::defaultStyle; 46 RuleSet* CSSDefaultStyleSheets::defaultStyle;
47 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle; 47 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle;
48 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle; 48 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle;
49 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle; 49 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle;
50 RuleSet* CSSDefaultStyleSheets::defaultXHtmlMobileProfileStyle;
kenneth.r.christiansen 2013/09/02 11:55:28 Same
rune 2013/09/03 08:27:10 Done.
50 51
51 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet; 52 StyleSheetContents* CSSDefaultStyleSheets::simpleDefaultStyleSheet;
52 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet; 53 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet;
53 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet; 54 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet;
54 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet; 55 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet;
55 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet; 56 StyleSheetContents* CSSDefaultStyleSheets::mathMLStyleSheet;
56 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet; 57 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet;
57 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet; 58 StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet;
58 59
59 // FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet. 60 // FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 146
146 RuleSet* CSSDefaultStyleSheets::viewSourceStyle() 147 RuleSet* CSSDefaultStyleSheets::viewSourceStyle()
147 { 148 {
148 if (!defaultViewSourceStyle) { 149 if (!defaultViewSourceStyle) {
149 defaultViewSourceStyle = RuleSet::create().leakPtr(); 150 defaultViewSourceStyle = RuleSet::create().leakPtr();
150 defaultViewSourceStyle->addRulesFromSheet(parseUASheet(sourceUserAgentSt yleSheet, sizeof(sourceUserAgentStyleSheet)), screenEval()); 151 defaultViewSourceStyle->addRulesFromSheet(parseUASheet(sourceUserAgentSt yleSheet, sizeof(sourceUserAgentStyleSheet)), screenEval());
151 } 152 }
152 return defaultViewSourceStyle; 153 return defaultViewSourceStyle;
153 } 154 }
154 155
156 RuleSet* CSSDefaultStyleSheets::xhtmlMobileProfileStyle()
157 {
158 if (!defaultXHtmlMobileProfileStyle) {
159 defaultXHtmlMobileProfileStyle = RuleSet::create().leakPtr();
160 defaultXHtmlMobileProfileStyle->addRulesFromSheet(parseUASheet(xhtmlmpUs erAgentStyleSheet, sizeof(xhtmlmpUserAgentStyleSheet)), screenEval());
161 }
162 return defaultXHtmlMobileProfileStyle;
163 }
155 164
156 void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element, bool& changedDefaultStyle) 165 void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element, bool& changedDefaultStyle)
157 { 166 {
158 if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(element)) { 167 if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(element)) {
159 loadFullDefaultStyle(); 168 loadFullDefaultStyle();
160 changedDefaultStyle = true; 169 changedDefaultStyle = true;
161 } 170 }
162 171
163 if (element->isSVGElement() && !svgStyleSheet) { 172 if (element->isSVGElement() && !svgStyleSheet) {
164 // SVG rules. 173 // SVG rules.
(...skipping 17 matching lines...) Expand all
182 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval()); 191 defaultStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval());
183 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval() ); 192 defaultQuirksStyle->addRulesFromSheet(fullscreenStyleSheet, screenEval() );
184 changedDefaultStyle = true; 193 changedDefaultStyle = true;
185 } 194 }
186 195
187 ASSERT(defaultStyle->features().idsInRules.isEmpty()); 196 ASSERT(defaultStyle->features().idsInRules.isEmpty());
188 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty()); 197 ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty());
189 } 198 }
190 199
191 } // namespace WebCore 200 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698