| 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 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 else | 1890 else |
| 1891 addProperty(animationProperties.properties()[i], values[i].release()
, important); | 1891 addProperty(animationProperties.properties()[i], values[i].release()
, important); |
| 1892 } | 1892 } |
| 1893 | 1893 |
| 1894 return true; | 1894 return true; |
| 1895 } | 1895 } |
| 1896 | 1896 |
| 1897 bool CSSPropertyParser::parseTransitionShorthand(CSSPropertyID propId, bool impo
rtant) | 1897 bool CSSPropertyParser::parseTransitionShorthand(CSSPropertyID propId, bool impo
rtant) |
| 1898 { | 1898 { |
| 1899 const unsigned numProperties = 4; | 1899 const unsigned numProperties = 4; |
| 1900 const StylePropertyShorthand& shorthand = shorthandForProperty(propId); | 1900 const StylePropertyShorthand& shorthand = parsingShorthandForProperty(propId
); |
| 1901 ASSERT(numProperties == shorthand.length()); | 1901 ASSERT(numProperties == shorthand.length()); |
| 1902 | 1902 |
| 1903 ShorthandScope scope(this, propId); | 1903 ShorthandScope scope(this, propId); |
| 1904 | 1904 |
| 1905 bool parsedProperty[numProperties] = { false }; | 1905 bool parsedProperty[numProperties] = { false }; |
| 1906 RefPtrWillBeRawPtr<CSSValueList> values[numProperties]; | 1906 RefPtrWillBeRawPtr<CSSValueList> values[numProperties]; |
| 1907 for (size_t i = 0; i < numProperties; ++i) | 1907 for (size_t i = 0; i < numProperties; ++i) |
| 1908 values[i] = CSSValueList::createCommaSeparated(); | 1908 values[i] = CSSValueList::createCommaSeparated(); |
| 1909 | 1909 |
| 1910 while (m_valueList->current()) { | 1910 while (m_valueList->current()) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1931 break; | 1931 break; |
| 1932 } | 1932 } |
| 1933 } | 1933 } |
| 1934 | 1934 |
| 1935 // if we didn't find at least one match, this is an | 1935 // if we didn't find at least one match, this is an |
| 1936 // invalid shorthand and we have to ignore it | 1936 // invalid shorthand and we have to ignore it |
| 1937 if (!found) | 1937 if (!found) |
| 1938 return false; | 1938 return false; |
| 1939 } | 1939 } |
| 1940 | 1940 |
| 1941 ASSERT(shorthand.properties()[0] == CSSPropertyTransitionProperty || shortha
nd.properties()[0] == CSSPropertyWebkitTransitionProperty); | 1941 ASSERT(shorthand.properties()[3] == CSSPropertyTransitionProperty || shortha
nd.properties()[3] == CSSPropertyWebkitTransitionProperty); |
| 1942 if (!isValidTransitionPropertyList(values[0].get())) | 1942 if (!isValidTransitionPropertyList(values[3].get())) |
| 1943 return false; | 1943 return false; |
| 1944 | 1944 |
| 1945 // Fill in any remaining properties with the initial value and add | 1945 // Fill in any remaining properties with the initial value and add |
| 1946 for (size_t i = 0; i < numProperties; ++i) { | 1946 for (size_t i = 0; i < numProperties; ++i) { |
| 1947 if (!parsedProperty[i]) | 1947 if (!parsedProperty[i]) |
| 1948 values[i]->append(cssValuePool().createImplicitInitialValue()); | 1948 values[i]->append(cssValuePool().createImplicitInitialValue()); |
| 1949 addPropertyWithPrefixingVariant(shorthand.properties()[i], values[i].rel
ease(), important); | 1949 addPropertyWithPrefixingVariant(shorthand.properties()[i], values[i].rel
ease(), important); |
| 1950 } | 1950 } |
| 1951 | 1951 |
| 1952 return true; | 1952 return true; |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3080 // Since all is valid css property keyword, cssPropertyID for all | 3080 // Since all is valid css property keyword, cssPropertyID for all |
| 3081 // returns non-null value. We need to check "all" before | 3081 // returns non-null value. We need to check "all" before |
| 3082 // cssPropertyID check. | 3082 // cssPropertyID check. |
| 3083 if (equalIgnoringCase(value, "all")) | 3083 if (equalIgnoringCase(value, "all")) |
| 3084 return cssValuePool().createIdentifierValue(CSSValueAll); | 3084 return cssValuePool().createIdentifierValue(CSSValueAll); |
| 3085 CSSPropertyID result = cssPropertyID(value->string); | 3085 CSSPropertyID result = cssPropertyID(value->string); |
| 3086 if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result)) | 3086 if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result)) |
| 3087 return cssValuePool().createIdentifierValue(result); | 3087 return cssValuePool().createIdentifierValue(result); |
| 3088 if (equalIgnoringCase(value, "none")) | 3088 if (equalIgnoringCase(value, "none")) |
| 3089 return cssValuePool().createIdentifierValue(CSSValueNone); | 3089 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 3090 return nullptr; | 3090 if (equalIgnoringCase(value, "inherit") || equalIgnoringCase(value, "initial
")) |
| 3091 return nullptr; |
| 3092 return createPrimitiveStringValue(value); |
| 3091 } | 3093 } |
| 3092 | 3094 |
| 3093 bool CSSPropertyParser::parseWebkitTransformOriginShorthand(RefPtrWillBeRawPtr<C
SSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, RefPtrWillBeRawPtr<CSSVa
lue>& value3) | 3095 bool CSSPropertyParser::parseWebkitTransformOriginShorthand(RefPtrWillBeRawPtr<C
SSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, RefPtrWillBeRawPtr<CSSVa
lue>& value3) |
| 3094 { | 3096 { |
| 3095 parse2ValuesFillPosition(m_valueList.get(), value1, value2); | 3097 parse2ValuesFillPosition(m_valueList.get(), value1, value2); |
| 3096 | 3098 |
| 3097 // now get z | 3099 // now get z |
| 3098 if (m_valueList->current()) { | 3100 if (m_valueList->current()) { |
| 3099 if (validUnit(m_valueList->current(), FLength)) { | 3101 if (validUnit(m_valueList->current(), FLength)) { |
| 3100 value3 = createPrimitiveNumericValue(m_valueList->current()); | 3102 value3 = createPrimitiveNumericValue(m_valueList->current()); |
| (...skipping 5323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8424 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); | 8426 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); |
| 8425 if (!seenStroke) | 8427 if (!seenStroke) |
| 8426 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); | 8428 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); |
| 8427 if (!seenMarkers) | 8429 if (!seenMarkers) |
| 8428 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); | 8430 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); |
| 8429 | 8431 |
| 8430 return parsedValues.release(); | 8432 return parsedValues.release(); |
| 8431 } | 8433 } |
| 8432 | 8434 |
| 8433 } // namespace WebCore | 8435 } // namespace WebCore |
| OLD | NEW |