| OLD | NEW |
| 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 Loading... |
| 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 RefPtrWillBeRawPtr<CSSValue> cssValue; | 218 RefPtrWillBeRawPtr<CSSValue> cssValue = nullptr; |
| 219 bool isValid = false; | 219 bool isValid = false; |
| 220 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower())
; | 220 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower())
; |
| 221 | 221 |
| 222 // 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. |
| 223 if (valueList && valueList->size() > 0) { | 223 if (valueList && valueList->size() > 0) { |
| 224 if (valueList->size() == 1) { | 224 if (valueList->size() == 1) { |
| 225 CSSParserValue* value = valueList->current(); | 225 CSSParserValue* value = valueList->current(); |
| 226 ASSERT(value); | 226 ASSERT(value); |
| 227 | 227 |
| 228 if (featureWithCSSValueID(lowerMediaFeature, value)) { | 228 if (featureWithCSSValueID(lowerMediaFeature, value)) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 if (m_value) { | 297 if (m_value) { |
| 298 result.append(": "); | 298 result.append(": "); |
| 299 result.append(m_value->cssText()); | 299 result.append(m_value->cssText()); |
| 300 } | 300 } |
| 301 result.append(")"); | 301 result.append(")"); |
| 302 | 302 |
| 303 return result.toString(); | 303 return result.toString(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace | 306 } // namespace |
| OLD | NEW |