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

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

Issue 171383002: A thread-safe Media Query Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moar rebase Created 6 years, 9 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 * 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 , m_value(other.value()) 204 , m_value(other.value())
205 { 205 {
206 } 206 }
207 207
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 // FIXME - create should not return a null.
214 PassOwnPtrWillBeRawPtr<MediaQueryExp> MediaQueryExp::create(const String& mediaF eature, CSSParserValueList* valueList) 215 PassOwnPtrWillBeRawPtr<MediaQueryExp> MediaQueryExp::create(const String& mediaF eature, CSSParserValueList* valueList)
215 { 216 {
216 RefPtrWillBeRawPtr<CSSValue> cssValue; 217 RefPtrWillBeRawPtr<CSSValue> cssValue;
217 bool isValid = false; 218 bool isValid = false;
218 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower()) ; 219 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower()) ;
219 220
220 // Create value for media query expression that must have 1 or more values. 221 // Create value for media query expression that must have 1 or more values.
221 if (valueList && valueList->size() > 0) { 222 if (valueList && valueList->size() > 0) {
222 if (valueList->size() == 1) { 223 if (valueList->size() == 1) {
223 CSSParserValue* value = valueList->current(); 224 CSSParserValue* value = valueList->current();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (m_value) { 295 if (m_value) {
295 result.append(": "); 296 result.append(": ");
296 result.append(m_value->cssText()); 297 result.append(m_value->cssText());
297 } 298 }
298 result.append(")"); 299 result.append(")");
299 300
300 return result.toString(); 301 return result.toString();
301 } 302 }
302 303
303 } // namespace 304 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698