| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/css/parser/CSSPropertyParser.h" | 6 #include "core/css/parser/CSSPropertyParser.h" |
| 7 | 7 |
| 8 #include "core/StylePropertyShorthand.h" | 8 #include "core/StylePropertyShorthand.h" |
| 9 #include "core/css/CSSCalculationValue.h" | 9 #include "core/css/CSSCalculationValue.h" |
| 10 #include "core/css/CSSCustomIdentValue.h" | 10 #include "core/css/CSSCustomIdentValue.h" |
| (...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 do { | 1746 do { |
| 1747 RefPtrWillBeRawPtr<CSSValue> parsedTransformValue = consumeTransformValu
e(range, cssParserMode, useLegacyParsing); | 1747 RefPtrWillBeRawPtr<CSSValue> parsedTransformValue = consumeTransformValu
e(range, cssParserMode, useLegacyParsing); |
| 1748 if (!parsedTransformValue) | 1748 if (!parsedTransformValue) |
| 1749 return nullptr; | 1749 return nullptr; |
| 1750 list->append(parsedTransformValue.release()); | 1750 list->append(parsedTransformValue.release()); |
| 1751 } while (!range.atEnd()); | 1751 } while (!range.atEnd()); |
| 1752 | 1752 |
| 1753 return list.release(); | 1753 return list.release(); |
| 1754 } | 1754 } |
| 1755 | 1755 |
| 1756 static PassRefPtrWillBeRawPtr<CSSValue> consumePaint(CSSParserTokenRange& range,
CSSParserContext context) |
| 1757 { |
| 1758 if (range.peek().id() == CSSValueNone) |
| 1759 return consumeIdent(range); |
| 1760 String url = consumeUrl(range); |
| 1761 if (!url.isNull()) { |
| 1762 RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr; |
| 1763 if (range.peek().id() == CSSValueNone) |
| 1764 parsedValue = consumeIdent(range); |
| 1765 else |
| 1766 parsedValue = consumeColor(range, context); |
| 1767 if (parsedValue) { |
| 1768 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceS
eparated(); |
| 1769 values->append(CSSURIValue::create(url)); |
| 1770 values->append(parsedValue); |
| 1771 return values.release(); |
| 1772 } |
| 1773 return CSSURIValue::create(url); |
| 1774 } |
| 1775 return consumeColor(range, context); |
| 1776 } |
| 1777 |
| 1756 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
ID unresolvedProperty) | 1778 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
ID unresolvedProperty) |
| 1757 { | 1779 { |
| 1758 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); | 1780 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); |
| 1759 m_range.consumeWhitespace(); | 1781 m_range.consumeWhitespace(); |
| 1760 switch (property) { | 1782 switch (property) { |
| 1761 case CSSPropertyWillChange: | 1783 case CSSPropertyWillChange: |
| 1762 return consumeWillChange(m_range); | 1784 return consumeWillChange(m_range); |
| 1763 case CSSPropertyPage: | 1785 case CSSPropertyPage: |
| 1764 return consumePage(m_range); | 1786 return consumePage(m_range); |
| 1765 case CSSPropertyQuotes: | 1787 case CSSPropertyQuotes: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 case CSSPropertyWebkitTextStrokeWidth: | 1878 case CSSPropertyWebkitTextStrokeWidth: |
| 1857 return consumeTextStrokeWidth(m_range, m_context.mode()); | 1879 return consumeTextStrokeWidth(m_range, m_context.mode()); |
| 1858 case CSSPropertyWebkitTextFillColor: | 1880 case CSSPropertyWebkitTextFillColor: |
| 1859 case CSSPropertyWebkitTapHighlightColor: | 1881 case CSSPropertyWebkitTapHighlightColor: |
| 1860 case CSSPropertyWebkitTextEmphasisColor: | 1882 case CSSPropertyWebkitTextEmphasisColor: |
| 1861 case CSSPropertyWebkitBorderStartColor: | 1883 case CSSPropertyWebkitBorderStartColor: |
| 1862 case CSSPropertyWebkitBorderEndColor: | 1884 case CSSPropertyWebkitBorderEndColor: |
| 1863 case CSSPropertyWebkitBorderBeforeColor: | 1885 case CSSPropertyWebkitBorderBeforeColor: |
| 1864 case CSSPropertyWebkitBorderAfterColor: | 1886 case CSSPropertyWebkitBorderAfterColor: |
| 1865 case CSSPropertyWebkitTextStrokeColor: | 1887 case CSSPropertyWebkitTextStrokeColor: |
| 1888 case CSSPropertyStopColor: |
| 1889 case CSSPropertyFloodColor: |
| 1890 case CSSPropertyLightingColor: |
| 1866 return consumeColor(m_range, m_context); | 1891 return consumeColor(m_range, m_context); |
| 1867 case CSSPropertyColor: | 1892 case CSSPropertyColor: |
| 1868 return consumeColor(m_range, m_context, inQuirksMode()); | 1893 return consumeColor(m_range, m_context, inQuirksMode()); |
| 1869 case CSSPropertyWebkitBorderStartWidth: | 1894 case CSSPropertyWebkitBorderStartWidth: |
| 1870 case CSSPropertyWebkitBorderEndWidth: | 1895 case CSSPropertyWebkitBorderEndWidth: |
| 1871 case CSSPropertyWebkitBorderBeforeWidth: | 1896 case CSSPropertyWebkitBorderBeforeWidth: |
| 1872 case CSSPropertyWebkitBorderAfterWidth: | 1897 case CSSPropertyWebkitBorderAfterWidth: |
| 1873 return consumeBorderWidth(m_range, m_context.mode()); | 1898 return consumeBorderWidth(m_range, m_context.mode()); |
| 1874 case CSSPropertyZIndex: | 1899 case CSSPropertyZIndex: |
| 1875 return consumeZIndex(m_range); | 1900 return consumeZIndex(m_range); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1894 case CSSPropertyWebkitTextEmphasisStyle: | 1919 case CSSPropertyWebkitTextEmphasisStyle: |
| 1895 return consumeTextEmphasisStyle(m_range); | 1920 return consumeTextEmphasisStyle(m_range); |
| 1896 case CSSPropertyOutlineColor: | 1921 case CSSPropertyOutlineColor: |
| 1897 return consumeOutlineColor(m_range, m_context); | 1922 return consumeOutlineColor(m_range, m_context); |
| 1898 case CSSPropertyOutlineOffset: | 1923 case CSSPropertyOutlineOffset: |
| 1899 return consumeLength(m_range, m_context.mode(), ValueRangeAll); | 1924 return consumeLength(m_range, m_context.mode(), ValueRangeAll); |
| 1900 case CSSPropertyOutlineWidth: | 1925 case CSSPropertyOutlineWidth: |
| 1901 return consumeLineWidth(m_range, m_context.mode()); | 1926 return consumeLineWidth(m_range, m_context.mode()); |
| 1902 case CSSPropertyTransform: | 1927 case CSSPropertyTransform: |
| 1903 return consumeTransform(m_range, m_context.mode(), unresolvedProperty ==
CSSPropertyAliasWebkitTransform); | 1928 return consumeTransform(m_range, m_context.mode(), unresolvedProperty ==
CSSPropertyAliasWebkitTransform); |
| 1929 case CSSPropertyFill: |
| 1930 case CSSPropertyStroke: |
| 1931 return consumePaint(m_range, m_context); |
| 1904 default: | 1932 default: |
| 1905 return nullptr; | 1933 return nullptr; |
| 1906 } | 1934 } |
| 1907 } | 1935 } |
| 1908 | 1936 |
| 1909 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse
rTokenRange& range) | 1937 static PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParse
rTokenRange& range) |
| 1910 { | 1938 { |
| 1911 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated
(); | 1939 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated
(); |
| 1912 | 1940 |
| 1913 do { | 1941 do { |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2391 return consumeShorthandGreedily(webkitBorderAfterShorthand(), important)
; | 2419 return consumeShorthandGreedily(webkitBorderAfterShorthand(), important)
; |
| 2392 case CSSPropertyWebkitTextStroke: | 2420 case CSSPropertyWebkitTextStroke: |
| 2393 return consumeShorthandGreedily(webkitTextStrokeShorthand(), important); | 2421 return consumeShorthandGreedily(webkitTextStrokeShorthand(), important); |
| 2394 default: | 2422 default: |
| 2395 m_currentShorthand = oldShorthand; | 2423 m_currentShorthand = oldShorthand; |
| 2396 return false; | 2424 return false; |
| 2397 } | 2425 } |
| 2398 } | 2426 } |
| 2399 | 2427 |
| 2400 } // namespace blink | 2428 } // namespace blink |
| OLD | NEW |