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 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 else | 1886 else |
1887 addProperty(animationProperties.properties()[i], values[i].release()
, important); | 1887 addProperty(animationProperties.properties()[i], values[i].release()
, important); |
1888 } | 1888 } |
1889 | 1889 |
1890 return true; | 1890 return true; |
1891 } | 1891 } |
1892 | 1892 |
1893 bool CSSPropertyParser::parseTransitionShorthand(CSSPropertyID propId, bool impo
rtant) | 1893 bool CSSPropertyParser::parseTransitionShorthand(CSSPropertyID propId, bool impo
rtant) |
1894 { | 1894 { |
1895 const unsigned numProperties = 4; | 1895 const unsigned numProperties = 4; |
1896 const StylePropertyShorthand& shorthand = shorthandForProperty(propId); | 1896 const StylePropertyShorthand& shorthand = parsingShorthandForProperty(propId
); |
1897 ASSERT(numProperties == shorthand.length()); | 1897 ASSERT(numProperties == shorthand.length()); |
1898 | 1898 |
1899 ShorthandScope scope(this, propId); | 1899 ShorthandScope scope(this, propId); |
1900 | 1900 |
1901 bool parsedProperty[numProperties] = { false }; | 1901 bool parsedProperty[numProperties] = { false }; |
1902 RefPtrWillBeRawPtr<CSSValueList> values[numProperties]; | 1902 RefPtrWillBeRawPtr<CSSValueList> values[numProperties]; |
1903 for (size_t i = 0; i < numProperties; ++i) | 1903 for (size_t i = 0; i < numProperties; ++i) |
1904 values[i] = CSSValueList::createCommaSeparated(); | 1904 values[i] = CSSValueList::createCommaSeparated(); |
1905 | 1905 |
1906 while (m_valueList->current()) { | 1906 while (m_valueList->current()) { |
(...skipping 20 matching lines...) Expand all Loading... |
1927 break; | 1927 break; |
1928 } | 1928 } |
1929 } | 1929 } |
1930 | 1930 |
1931 // if we didn't find at least one match, this is an | 1931 // if we didn't find at least one match, this is an |
1932 // invalid shorthand and we have to ignore it | 1932 // invalid shorthand and we have to ignore it |
1933 if (!found) | 1933 if (!found) |
1934 return false; | 1934 return false; |
1935 } | 1935 } |
1936 | 1936 |
1937 ASSERT(shorthand.properties()[0] == CSSPropertyTransitionProperty || shortha
nd.properties()[0] == CSSPropertyWebkitTransitionProperty); | 1937 ASSERT(shorthand.properties()[3] == CSSPropertyTransitionProperty || shortha
nd.properties()[3] == CSSPropertyWebkitTransitionProperty); |
1938 if (!isValidTransitionPropertyList(values[0].get())) | 1938 if (!isValidTransitionPropertyList(values[3].get())) |
1939 return false; | 1939 return false; |
1940 | 1940 |
1941 // Fill in any remaining properties with the initial value and add | 1941 // Fill in any remaining properties with the initial value and add |
1942 for (size_t i = 0; i < numProperties; ++i) { | 1942 for (size_t i = 0; i < numProperties; ++i) { |
1943 if (!parsedProperty[i]) | 1943 if (!parsedProperty[i]) |
1944 values[i]->append(cssValuePool().createImplicitInitialValue()); | 1944 values[i]->append(cssValuePool().createImplicitInitialValue()); |
1945 addPropertyWithPrefixingVariant(shorthand.properties()[i], values[i].rel
ease(), important); | 1945 addPropertyWithPrefixingVariant(shorthand.properties()[i], values[i].rel
ease(), important); |
1946 } | 1946 } |
1947 | 1947 |
1948 return true; | 1948 return true; |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 CSSParserValue* value = m_valueList->current(); | 3073 CSSParserValue* value = m_valueList->current(); |
3074 if (value->unit != CSSPrimitiveValue::CSS_IDENT) | 3074 if (value->unit != CSSPrimitiveValue::CSS_IDENT) |
3075 return nullptr; | 3075 return nullptr; |
3076 CSSPropertyID result = cssPropertyID(value->string); | 3076 CSSPropertyID result = cssPropertyID(value->string); |
3077 if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result)) | 3077 if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result)) |
3078 return cssValuePool().createIdentifierValue(result); | 3078 return cssValuePool().createIdentifierValue(result); |
3079 if (equalIgnoringCase(value, "all")) | 3079 if (equalIgnoringCase(value, "all")) |
3080 return cssValuePool().createIdentifierValue(CSSValueAll); | 3080 return cssValuePool().createIdentifierValue(CSSValueAll); |
3081 if (equalIgnoringCase(value, "none")) | 3081 if (equalIgnoringCase(value, "none")) |
3082 return cssValuePool().createIdentifierValue(CSSValueNone); | 3082 return cssValuePool().createIdentifierValue(CSSValueNone); |
3083 return nullptr; | 3083 if (equalIgnoringCase(value, "inherit") || equalIgnoringCase(value, "initial
")) |
| 3084 return nullptr; |
| 3085 return createPrimitiveStringValue(value); |
3084 } | 3086 } |
3085 | 3087 |
3086 bool CSSPropertyParser::parseWebkitTransformOriginShorthand(RefPtrWillBeRawPtr<C
SSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, RefPtrWillBeRawPtr<CSSVa
lue>& value3) | 3088 bool CSSPropertyParser::parseWebkitTransformOriginShorthand(RefPtrWillBeRawPtr<C
SSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, RefPtrWillBeRawPtr<CSSVa
lue>& value3) |
3087 { | 3089 { |
3088 parse2ValuesFillPosition(m_valueList.get(), value1, value2); | 3090 parse2ValuesFillPosition(m_valueList.get(), value1, value2); |
3089 | 3091 |
3090 // now get z | 3092 // now get z |
3091 if (m_valueList->current()) { | 3093 if (m_valueList->current()) { |
3092 if (validUnit(m_valueList->current(), FLength)) { | 3094 if (validUnit(m_valueList->current(), FLength)) { |
3093 value3 = createPrimitiveNumericValue(m_valueList->current()); | 3095 value3 = createPrimitiveNumericValue(m_valueList->current()); |
(...skipping 5324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8418 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); | 8420 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); |
8419 if (!seenStroke) | 8421 if (!seenStroke) |
8420 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); | 8422 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); |
8421 if (!seenMarkers) | 8423 if (!seenMarkers) |
8422 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); | 8424 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); |
8423 | 8425 |
8424 return parsedValues.release(); | 8426 return parsedValues.release(); |
8425 } | 8427 } |
8426 | 8428 |
8427 } // namespace WebCore | 8429 } // namespace WebCore |
OLD | NEW |