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

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

Issue 240063003: Revert "A sizes attribute parser" (https://codereview.chromium.org/224733011) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/css/MediaQueryEvaluatorTest.cpp ('k') | Source/core/css/MediaQuerySetTest.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 * CSS Media Query 2 * CSS Media Query
3 * 3 *
4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * Copyright (C) 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2013 Apple Inc. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 MediaQueryExp::MediaQueryExp(const String& mediaFeature, PassRefPtrWillBeRawPtr< CSSValue> value) 208 MediaQueryExp::MediaQueryExp(const String& mediaFeature, PassRefPtrWillBeRawPtr< CSSValue> value)
209 : m_mediaFeature(mediaFeature) 209 : m_mediaFeature(mediaFeature)
210 , m_value(value) 210 , m_value(value)
211 { 211 {
212 } 212 }
213 213
214 PassOwnPtrWillBeRawPtr<MediaQueryExp> MediaQueryExp::createIfValid(const String& mediaFeature, CSSParserValueList* valueList) 214 PassOwnPtrWillBeRawPtr<MediaQueryExp> MediaQueryExp::createIfValid(const String& mediaFeature, CSSParserValueList* valueList)
215 { 215 {
216 ASSERT(!mediaFeature.isNull()); 216 ASSERT(!mediaFeature.isNull());
217 217
218 // FIXME - Creation of CSSValue here may not be thread safe.
219 // It should be replaced by a different way to pass the values to MediaQuery Evaluator.
220 RefPtrWillBeRawPtr<CSSValue> cssValue = nullptr; 218 RefPtrWillBeRawPtr<CSSValue> cssValue = nullptr;
221 bool isValid = false; 219 bool isValid = false;
222 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower()) ; 220 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower()) ;
223 221
224 // Create value for media query expression that must have 1 or more values. 222 // Create value for media query expression that must have 1 or more values.
225 if (valueList && valueList->size() > 0) { 223 if (valueList && valueList->size() > 0) {
226 if (valueList->size() == 1) { 224 if (valueList->size() == 1) {
227 CSSParserValue* value = valueList->current(); 225 CSSParserValue* value = valueList->current();
228 ASSERT(value); 226 ASSERT(value);
229 227
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if (m_value) { 297 if (m_value) {
300 result.append(": "); 298 result.append(": ");
301 result.append(m_value->cssText()); 299 result.append(m_value->cssText());
302 } 300 }
303 result.append(")"); 301 result.append(")");
304 302
305 return result.toString(); 303 return result.toString();
306 } 304 }
307 305
308 } // namespace 306 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluatorTest.cpp ('k') | Source/core/css/MediaQuerySetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698