Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 10 * | 10 * |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/css/parser/CSSPropertyParser.h" | 28 #include "core/css/parser/CSSPropertyParser.h" |
| 29 | 29 |
| 30 #include "core/StylePropertyShorthand.h" | 30 #include "core/StylePropertyShorthand.h" |
| 31 #include "core/css/CSSBasicShapes.h" | 31 #include "core/css/CSSBasicShapes.h" |
| 32 #include "core/css/CSSBorderImage.h" | 32 #include "core/css/CSSBorderImage.h" |
| 33 #include "core/css/CSSCanvasValue.h" | 33 #include "core/css/CSSCanvasValue.h" |
| 34 #include "core/css/CSSContentDistributionValue.h" | 34 #include "core/css/CSSContentDistributionValue.h" |
| 35 #include "core/css/CSSCrossfadeValue.h" | 35 #include "core/css/CSSCrossfadeValue.h" |
| 36 #include "core/css/CSSCursorImageValue.h" | 36 #include "core/css/CSSCursorImageValue.h" |
| 37 #include "core/css/CSSCustomVariableValue.h" | |
| 37 #include "core/css/CSSFontFaceSrcValue.h" | 38 #include "core/css/CSSFontFaceSrcValue.h" |
| 38 #include "core/css/CSSFontFeatureValue.h" | 39 #include "core/css/CSSFontFeatureValue.h" |
| 39 #include "core/css/CSSFunctionValue.h" | 40 #include "core/css/CSSFunctionValue.h" |
| 40 #include "core/css/CSSGridLineNamesValue.h" | 41 #include "core/css/CSSGridLineNamesValue.h" |
| 41 #include "core/css/CSSImageSetValue.h" | 42 #include "core/css/CSSImageSetValue.h" |
| 42 #include "core/css/CSSImageValue.h" | 43 #include "core/css/CSSImageValue.h" |
| 43 #include "core/css/CSSLineBoxContainValue.h" | 44 #include "core/css/CSSLineBoxContainValue.h" |
| 44 #include "core/css/CSSPathValue.h" | 45 #include "core/css/CSSPathValue.h" |
| 45 #include "core/css/CSSPrimitiveValueMappings.h" | 46 #include "core/css/CSSPrimitiveValueMappings.h" |
| 46 #include "core/css/CSSProperty.h" | 47 #include "core/css/CSSProperty.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 return false; | 458 return false; |
| 458 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial Value(), important); | 459 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial Value(), important); |
| 459 return true; | 460 return true; |
| 460 } else if (id == CSSValueUnset) { | 461 } else if (id == CSSValueUnset) { |
| 461 if (m_valueList->size() != 1) | 462 if (m_valueList->size() != 1) |
| 462 return false; | 463 return false; |
| 463 addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), i mportant); | 464 addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), i mportant); |
| 464 return true; | 465 return true; |
| 465 } | 466 } |
| 466 | 467 |
| 468 if (RuntimeEnabledFeatures::cssVariablesEnabled() && value->unit() == CSSPri mitiveValue::UnitType::VariableReference) { | |
| 469 // We don't expand the shorthand here because crazypants. | |
|
alancutter (OOO until 2018)
2015/08/25 01:59:08
There are issues with letting shorthands into the
Timothy Loh
2015/08/25 09:21:10
I'm not sure shorthands even fall into a priority
| |
| 470 m_parsedProperties.append(CSSProperty(propId, CSSPrimitiveValue::create( value->variableData), important, false, 0, m_implicitShorthand)); | |
| 471 m_valueList->next(); | |
| 472 return true; | |
| 473 } | |
| 474 | |
| 467 if (CSSParserFastPaths::isKeywordPropertyID(propId)) { | 475 if (CSSParserFastPaths::isKeywordPropertyID(propId)) { |
| 468 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) | 476 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) |
| 469 return false; | 477 return false; |
| 470 if (m_valueList->next() && !inShorthand()) | 478 if (m_valueList->next() && !inShorthand()) |
| 471 return false; | 479 return false; |
| 472 addProperty(propId, cssValuePool().createIdentifierValue(id), important) ; | 480 addProperty(propId, cssValuePool().createIdentifierValue(id), important) ; |
| 473 return true; | 481 return true; |
| 474 } | 482 } |
| 475 | 483 |
| 476 bool validPrimitive = false; | 484 bool validPrimitive = false; |
| (...skipping 7630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8107 } | 8115 } |
| 8108 } | 8116 } |
| 8109 | 8117 |
| 8110 if (!list->length()) | 8118 if (!list->length()) |
| 8111 return nullptr; | 8119 return nullptr; |
| 8112 | 8120 |
| 8113 return list.release(); | 8121 return list.release(); |
| 8114 } | 8122 } |
| 8115 | 8123 |
| 8116 } // namespace blink | 8124 } // namespace blink |
| OLD | NEW |