| 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 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 m_useCounter->count(propId); | 1672 m_useCounter->count(propId); |
| 1673 | 1673 |
| 1674 if (!m_valueList) | 1674 if (!m_valueList) |
| 1675 return false; | 1675 return false; |
| 1676 | 1676 |
| 1677 CSSParserValue* value = m_valueList->current(); | 1677 CSSParserValue* value = m_valueList->current(); |
| 1678 | 1678 |
| 1679 if (!value) | 1679 if (!value) |
| 1680 return false; | 1680 return false; |
| 1681 | 1681 |
| 1682 if (inViewport()) { |
| 1683 if (!RuntimeEnabledFeatures::cssViewportEnabled()) |
| 1684 return false; |
| 1685 |
| 1686 return parseViewportProperty(propId, important); |
| 1687 } |
| 1688 |
| 1682 // Note: m_parsedCalculation is used to pass the calc value to validUnit and
then cleared at the end of this function. | 1689 // Note: m_parsedCalculation is used to pass the calc value to validUnit and
then cleared at the end of this function. |
| 1683 // FIXME: This is to avoid having to pass parsedCalc to all validUnit caller
s. | 1690 // FIXME: This is to avoid having to pass parsedCalc to all validUnit caller
s. |
| 1684 ASSERT(!m_parsedCalculation); | 1691 ASSERT(!m_parsedCalculation); |
| 1685 | 1692 |
| 1686 CSSValueID id = value->id; | 1693 CSSValueID id = value->id; |
| 1687 | 1694 |
| 1688 int num = inShorthand() ? 1 : m_valueList->size(); | 1695 int num = inShorthand() ? 1 : m_valueList->size(); |
| 1689 | 1696 |
| 1690 if (id == CSSValueInherit) { | 1697 if (id == CSSValueInherit) { |
| 1691 if (num != 1) | 1698 if (num != 1) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1709 | 1716 |
| 1710 if (isKeywordPropertyID(propId)) { | 1717 if (isKeywordPropertyID(propId)) { |
| 1711 if (!isValidKeywordPropertyAndValue(propId, id, m_context)) | 1718 if (!isValidKeywordPropertyAndValue(propId, id, m_context)) |
| 1712 return false; | 1719 return false; |
| 1713 if (m_valueList->next() && !inShorthand()) | 1720 if (m_valueList->next() && !inShorthand()) |
| 1714 return false; | 1721 return false; |
| 1715 addProperty(propId, cssValuePool().createIdentifierValue(id), important)
; | 1722 addProperty(propId, cssValuePool().createIdentifierValue(id), important)
; |
| 1716 return true; | 1723 return true; |
| 1717 } | 1724 } |
| 1718 | 1725 |
| 1719 if (inViewport()) { | |
| 1720 if (!RuntimeEnabledFeatures::cssViewportEnabled()) | |
| 1721 return false; | |
| 1722 | |
| 1723 return parseViewportProperty(propId, important); | |
| 1724 } | |
| 1725 | |
| 1726 bool validPrimitive = false; | 1726 bool validPrimitive = false; |
| 1727 RefPtr<CSSValue> parsedValue; | 1727 RefPtr<CSSValue> parsedValue; |
| 1728 | 1728 |
| 1729 switch (propId) { | 1729 switch (propId) { |
| 1730 case CSSPropertySize: // <length>{1,2} | auto | [ <page-size
> || [ portrait | landscape] ] | 1730 case CSSPropertySize: // <length>{1,2} | auto | [ <page-size
> || [ portrait | landscape] ] |
| 1731 return parseSize(propId, important); | 1731 return parseSize(propId, important); |
| 1732 | 1732 |
| 1733 case CSSPropertyQuotes: // [<string> <string>]+ | none | inher
it | 1733 case CSSPropertyQuotes: // [<string> <string>]+ | none | inher
it |
| 1734 if (id) | 1734 if (id) |
| 1735 validPrimitive = true; | 1735 validPrimitive = true; |
| (...skipping 10237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11973 { | 11973 { |
| 11974 // The tokenizer checks for the construct of an+b. | 11974 // The tokenizer checks for the construct of an+b. |
| 11975 // However, since the {ident} rule precedes the {nth} rule, some of those | 11975 // However, since the {ident} rule precedes the {nth} rule, some of those |
| 11976 // tokens are identified as string literal. Furthermore we need to accept | 11976 // tokens are identified as string literal. Furthermore we need to accept |
| 11977 // "odd" and "even" which does not match to an+b. | 11977 // "odd" and "even" which does not match to an+b. |
| 11978 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") | 11978 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") |
| 11979 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 11979 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
| 11980 } | 11980 } |
| 11981 | 11981 |
| 11982 } | 11982 } |
| OLD | NEW |