| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 if (tokenList.size() == 0 && featureWithoutValue(lowerMediaFeature)) { | 215 if (tokenList.size() == 0 && featureWithoutValue(lowerMediaFeature)) { |
| 216 // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue | 216 // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue |
| 217 } else if (tokenList.size() == 1) { | 217 } else if (tokenList.size() == 1) { |
| 218 CSSParserToken token = tokenList.first(); | 218 CSSParserToken token = tokenList.first(); |
| 219 | 219 |
| 220 if (token.type() == IdentToken) { | 220 if (token.type() == IdentToken) { |
| 221 CSSValueID ident = token.id(); | 221 CSSValueID ident = token.id(); |
| 222 if (!featureWithValidIdent(lowerMediaFeature, ident)) | 222 if (!featureWithValidIdent(lowerMediaFeature, ident)) |
| 223 return nullptr; | 223 return nullptr; |
| 224 expValue.id = ident; | 224 expValue.id = ident; |
| 225 expValue.unit = CSSPrimitiveValue::UnitType::ValueID; | |
| 226 expValue.isID = true; | 225 expValue.isID = true; |
| 227 } else if (token.type() == NumberToken || token.type() == PercentageToken || | 226 } else if (token.type() == NumberToken || token.type() == PercentageToken || |
| 228 token.type() == DimensionToken) { | 227 token.type() == DimensionToken) { |
| 229 // Check for numeric token types since it is only safe for these types to
call numericValue. | 228 // Check for numeric token types since it is only safe for these types to
call numericValue. |
| 230 if (featureWithValidDensity(lowerMediaFeature, token) || | 229 if (featureWithValidDensity(lowerMediaFeature, token) || |
| 231 featureWithValidPositiveLength(lowerMediaFeature, token)) { | 230 featureWithValidPositiveLength(lowerMediaFeature, token)) { |
| 232 // Media features that must have non-negative <density>, ie. dppx, dpi o
r dpcm, | 231 // Media features that must have non-negative <density>, ie. dppx, dpi o
r dpcm, |
| 233 // or Media features that must have non-negative <length> or number valu
e. | 232 // or Media features that must have non-negative <length> or number valu
e. |
| 234 expValue.value = token.numericValue(); | 233 expValue.value = token.numericValue(); |
| 235 expValue.unit = token.unitType(); | 234 expValue.unit = token.unitType(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 output.append('/'); | 310 output.append('/'); |
| 312 output.append(printNumber(denominator)); | 311 output.append(printNumber(denominator)); |
| 313 } else if (isID) { | 312 } else if (isID) { |
| 314 output.append(getValueName(id)); | 313 output.append(getValueName(id)); |
| 315 } | 314 } |
| 316 | 315 |
| 317 return output.toString(); | 316 return output.toString(); |
| 318 } | 317 } |
| 319 | 318 |
| 320 } // namespace blink | 319 } // namespace blink |
| OLD | NEW |