| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 MediaQueryExp::MediaQueryExp(const MediaQueryExp& other) | 211 MediaQueryExp::MediaQueryExp(const MediaQueryExp& other) |
| 212 : m_mediaFeature(other.mediaFeature()), m_expValue(other.expValue()) {} | 212 : m_mediaFeature(other.mediaFeature()), m_expValue(other.expValue()) {} |
| 213 | 213 |
| 214 MediaQueryExp::MediaQueryExp(const String& mediaFeature, | 214 MediaQueryExp::MediaQueryExp(const String& mediaFeature, |
| 215 const MediaQueryExpValue& expValue) | 215 const MediaQueryExpValue& expValue) |
| 216 : m_mediaFeature(mediaFeature), m_expValue(expValue) {} | 216 : m_mediaFeature(mediaFeature), m_expValue(expValue) {} |
| 217 | 217 |
| 218 MediaQueryExp* MediaQueryExp::createIfValid( | 218 MediaQueryExp* MediaQueryExp::createIfValid( |
| 219 const String& mediaFeature, | 219 const String& mediaFeature, |
| 220 const Vector<CSSParserToken, 4>& tokenList) { | 220 const Vector<CSSParserToken, 4>& tokenList) { |
| 221 ASSERT(!mediaFeature.isNull()); | 221 DCHECK(!mediaFeature.isNull()); |
| 222 | 222 |
| 223 MediaQueryExpValue expValue; | 223 MediaQueryExpValue expValue; |
| 224 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower()); | 224 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower()); |
| 225 | 225 |
| 226 // Create value for media query expression that must have 1 or more values. | 226 // Create value for media query expression that must have 1 or more values. |
| 227 if (tokenList.size() == 0 && featureWithoutValue(lowerMediaFeature)) { | 227 if (tokenList.size() == 0 && featureWithoutValue(lowerMediaFeature)) { |
| 228 // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue | 228 // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue |
| 229 } else if (tokenList.size() == 1) { | 229 } else if (tokenList.size() == 1) { |
| 230 CSSParserToken token = tokenList.front(); | 230 CSSParserToken token = tokenList.front(); |
| 231 | 231 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 output.append('/'); | 324 output.append('/'); |
| 325 output.append(printNumber(denominator)); | 325 output.append(printNumber(denominator)); |
| 326 } else if (isID) { | 326 } else if (isID) { |
| 327 output.append(getValueName(id)); | 327 output.append(getValueName(id)); |
| 328 } | 328 } |
| 329 | 329 |
| 330 return output.toString(); | 330 return output.toString(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace blink | 333 } // namespace blink |
| OLD | NEW |