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

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

Issue 16325005: Remove the Media Query "forward compatibly syntax" support in alignment with HTML5 spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DOMImplementation.cpp ('k') | Source/core/html/HTMLLinkElement.cpp » ('j') | 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Document* document = e->document(); 153 Document* document = e->document();
154 if (m_sheet) { 154 if (m_sheet) {
155 if (m_sheet->isLoading()) 155 if (m_sheet->isLoading())
156 document->styleSheetCollection()->removePendingSheet(); 156 document->styleSheetCollection()->removePendingSheet();
157 clearSheet(); 157 clearSheet();
158 } 158 }
159 159
160 // If type is empty or CSS, this is a CSS style sheet. 160 // If type is empty or CSS, this is a CSS style sheet.
161 const AtomicString& type = this->type(); 161 const AtomicString& type = this->type();
162 if (document->contentSecurityPolicy()->allowInlineStyle(e->document()->url() , m_startPosition.m_line) && isCSS(e, type)) { 162 if (document->contentSecurityPolicy()->allowInlineStyle(e->document()->url() , m_startPosition.m_line) && isCSS(e, type)) {
163 RefPtr<MediaQuerySet> mediaQueries; 163 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media());
164 if (e->isHTMLElement())
165 mediaQueries = MediaQuerySet::createAllowingDescriptionSyntax(media( ));
166 else
167 mediaQueries = MediaQuerySet::create(media());
168 164
169 MediaQueryEvaluator screenEval("screen", true); 165 MediaQueryEvaluator screenEval("screen", true);
170 MediaQueryEvaluator printEval("print", true); 166 MediaQueryEvaluator printEval("print", true);
171 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g et())) { 167 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g et())) {
172 document->styleSheetCollection()->addPendingSheet(); 168 document->styleSheetCollection()->addPendingSheet();
173 m_loading = true; 169 m_loading = true;
174 170
175 TextPosition startPosition = m_startPosition == TextPosition::belowR angePosition() ? TextPosition::minimumPosition() : m_startPosition; 171 TextPosition startPosition = m_startPosition == TextPosition::belowR angePosition() ? TextPosition::minimumPosition() : m_startPosition;
176 m_sheet = CSSStyleSheet::createInline(e, KURL(), startPosition, docu ment->inputEncoding()); 172 m_sheet = CSSStyleSheet::createInline(e, KURL(), startPosition, docu ment->inputEncoding());
177 m_sheet->setMediaQueries(mediaQueries.release()); 173 m_sheet->setMediaQueries(mediaQueries.release());
(...skipping 25 matching lines...) Expand all
203 return true; 199 return true;
204 } 200 }
205 201
206 void StyleElement::startLoadingDynamicSheet(Document* document) 202 void StyleElement::startLoadingDynamicSheet(Document* document)
207 { 203 {
208 ASSERT(document); 204 ASSERT(document);
209 document->styleSheetCollection()->addPendingSheet(); 205 document->styleSheetCollection()->addPendingSheet();
210 } 206 }
211 207
212 } 208 }
OLDNEW
« no previous file with comments | « Source/core/dom/DOMImplementation.cpp ('k') | Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698