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 7800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7811 } | 7811 } |
7812 default: | 7812 default: |
7813 // If you crash here, it's because you added a css property and are not
handling it | 7813 // If you crash here, it's because you added a css property and are not
handling it |
7814 // in either this switch statement or the one in CSSPropertyParser::pars
eValue | 7814 // in either this switch statement or the one in CSSPropertyParser::pars
eValue |
7815 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId); | 7815 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId); |
7816 return false; | 7816 return false; |
7817 } | 7817 } |
7818 | 7818 |
7819 if (validPrimitive) { | 7819 if (validPrimitive) { |
7820 if (id) | 7820 if (id) |
7821 parsedValue = CSSPrimitiveValue::createIdentifier(id); | 7821 parsedValue = CSSPrimitiveValue::create(id); |
7822 else if (value->unit == CSSPrimitiveValue::CSS_STRING) | 7822 else if (value->unit == CSSPrimitiveValue::CSS_STRING) |
7823 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive
Value::UnitType) value->unit); | 7823 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitive
Value::UnitType) value->unit); |
7824 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) | 7824 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) |
7825 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType) value->unit); | 7825 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType) value->unit); |
7826 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS
SPrimitiveValue::CSS_CHS) | 7826 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS
SPrimitiveValue::CSS_CHS) |
7827 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType)value->unit); | 7827 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitive
Value::UnitType)value->unit); |
7828 else if (value->unit == CSSPrimitiveValue::CSS_QEM) | 7828 else if (value->unit == CSSPrimitiveValue::CSS_QEM) |
7829 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV
alue, CSSPrimitiveValue::CSS_EMS); | 7829 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fV
alue, CSSPrimitiveValue::CSS_EMS); |
7830 if (isCalculation(value)) { | 7830 if (isCalculation(value)) { |
7831 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri
mitiveValue here, ie | 7831 // FIXME calc() http://webkit.org/b/16662 : actually create a CSSPri
mitiveValue here, ie |
(...skipping 13 matching lines...) Expand all Loading... |
7845 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGStrokeDasharray() | 7845 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGStrokeDasharray() |
7846 { | 7846 { |
7847 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); | 7847 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); |
7848 CSSParserValue* value = m_valueList->current(); | 7848 CSSParserValue* value = m_valueList->current(); |
7849 bool validPrimitive = true; | 7849 bool validPrimitive = true; |
7850 while (value) { | 7850 while (value) { |
7851 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri
buteMode); | 7851 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri
buteMode); |
7852 if (!validPrimitive) | 7852 if (!validPrimitive) |
7853 break; | 7853 break; |
7854 if (value->id) | 7854 if (value->id) |
7855 ret->append(CSSPrimitiveValue::createIdentifier(value->id)); | 7855 ret->append(CSSPrimitiveValue::create(value->id)); |
7856 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) | 7856 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <=
CSSPrimitiveValue::CSS_KHZ) |
7857 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType) value->unit)); | 7857 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType) value->unit)); |
7858 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS
SPrimitiveValue::CSS_CHS) | 7858 else if (value->unit == CSSPrimitiveValue::CSS_REMS || value->unit == CS
SPrimitiveValue::CSS_CHS) |
7859 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType)value->unit)); | 7859 ret->append(CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveVa
lue::UnitType)value->unit)); |
7860 value = m_valueList->next(); | 7860 value = m_valueList->next(); |
7861 bool commaConsumed = consumeComma(m_valueList); | 7861 bool commaConsumed = consumeComma(m_valueList); |
7862 value = m_valueList->current(); | 7862 value = m_valueList->current(); |
7863 if (commaConsumed && !value) | 7863 if (commaConsumed && !value) |
7864 return nullptr; | 7864 return nullptr; |
7865 } | 7865 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7902 case CSSValueMarkers: | 7902 case CSSValueMarkers: |
7903 if (seenMarkers) | 7903 if (seenMarkers) |
7904 return nullptr; | 7904 return nullptr; |
7905 | 7905 |
7906 seenMarkers = true; | 7906 seenMarkers = true; |
7907 break; | 7907 break; |
7908 default: | 7908 default: |
7909 return nullptr; | 7909 return nullptr; |
7910 } | 7910 } |
7911 | 7911 |
7912 parsedValues->append(CSSPrimitiveValue::createIdentifier(value->id)); | 7912 parsedValues->append(CSSPrimitiveValue::create(value->id)); |
7913 } | 7913 } |
7914 | 7914 |
7915 // fill out the rest of the paint order | 7915 // fill out the rest of the paint order |
7916 if (!seenFill) | 7916 if (!seenFill) |
7917 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); | 7917 parsedValues->append(CSSPrimitiveValue::create(CSSValueFill)); |
7918 if (!seenStroke) | 7918 if (!seenStroke) |
7919 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); | 7919 parsedValues->append(CSSPrimitiveValue::create(CSSValueStroke)); |
7920 if (!seenMarkers) | 7920 if (!seenMarkers) |
7921 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); | 7921 parsedValues->append(CSSPrimitiveValue::create(CSSValueMarkers)); |
7922 | 7922 |
7923 return parsedValues.release(); | 7923 return parsedValues.release(); |
7924 } | 7924 } |
7925 | 7925 |
7926 class TransformOperationInfo { | 7926 class TransformOperationInfo { |
7927 public: | 7927 public: |
7928 TransformOperationInfo(CSSValueID id) | 7928 TransformOperationInfo(CSSValueID id) |
7929 : m_validID(true) | 7929 : m_validID(true) |
7930 , m_allowSingleArgument(false) | 7930 , m_allowSingleArgument(false) |
7931 , m_argCount(1) | 7931 , m_argCount(1) |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8158 } | 8158 } |
8159 } | 8159 } |
8160 | 8160 |
8161 if (!list->length()) | 8161 if (!list->length()) |
8162 return nullptr; | 8162 return nullptr; |
8163 | 8163 |
8164 return list.release(); | 8164 return list.release(); |
8165 } | 8165 } |
8166 | 8166 |
8167 } // namespace blink | 8167 } // namespace blink |
OLD | NEW |