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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleElement.cpp

Issue 2432153005: Always evaluate media features to true without MediaValues. (Closed)
Patch Set: DCHECK(view). Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Rob Buis 2 * Copyright (C) 2006, 2007 Rob Buis
3 * Copyright (C) 2008 Apple, Inc. All rights reserved. 3 * Copyright (C) 2008 Apple, Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 // Clearing the current sheet may remove the cache entry so create the new 166 // Clearing the current sheet may remove the cache entry so create the new
167 // sheet first 167 // sheet first
168 CSSStyleSheet* newSheet = nullptr; 168 CSSStyleSheet* newSheet = nullptr;
169 169
170 // If type is empty or CSS, this is a CSS style sheet. 170 // If type is empty or CSS, this is a CSS style sheet.
171 const AtomicString& type = this->type(); 171 const AtomicString& type = this->type();
172 if (isCSS(element, type) && passesContentSecurityPolicyChecks) { 172 if (isCSS(element, type) && passesContentSecurityPolicyChecks) {
173 MediaQuerySet* mediaQueries = MediaQuerySet::create(media()); 173 MediaQuerySet* mediaQueries = MediaQuerySet::create(media());
174 174
175 MediaQueryEvaluator screenEval("screen", true); 175 MediaQueryEvaluator screenEval("screen");
176 MediaQueryEvaluator printEval("print", true); 176 MediaQueryEvaluator printEval("print");
177 if (screenEval.eval(mediaQueries) || printEval.eval(mediaQueries)) { 177 if (screenEval.eval(mediaQueries) || printEval.eval(mediaQueries)) {
178 m_loading = true; 178 m_loading = true;
179 TextPosition startPosition = 179 TextPosition startPosition =
180 m_startPosition == TextPosition::belowRangePosition() 180 m_startPosition == TextPosition::belowRangePosition()
181 ? TextPosition::minimumPosition() 181 ? TextPosition::minimumPosition()
182 : m_startPosition; 182 : m_startPosition;
183 newSheet = document.styleEngine().createSheet( 183 newSheet = document.styleEngine().createSheet(
184 element, text, startPosition, m_styleEngineContext); 184 element, text, startPosition, m_styleEngineContext);
185 newSheet->setMediaQueries(mediaQueries); 185 newSheet->setMediaQueries(mediaQueries);
186 m_loading = false; 186 m_loading = false;
(...skipping 28 matching lines...) Expand all
215 215
216 void StyleElement::startLoadingDynamicSheet(Document& document) { 216 void StyleElement::startLoadingDynamicSheet(Document& document) {
217 document.styleEngine().addPendingSheet(m_styleEngineContext); 217 document.styleEngine().addPendingSheet(m_styleEngineContext);
218 } 218 }
219 219
220 DEFINE_TRACE(StyleElement) { 220 DEFINE_TRACE(StyleElement) {
221 visitor->trace(m_sheet); 221 visitor->trace(m_sheet);
222 } 222 }
223 223
224 } // namespace blink 224 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698