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 9102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9113 // <length> | <percentage> | inherit | 9113 // <length> | <percentage> | inherit |
9114 if (m_valueList->size() == 1) { | 9114 if (m_valueList->size() == 1) { |
9115 CSSParserValue* value = m_valueList->current(); | 9115 CSSParserValue* value = m_valueList->current(); |
9116 if (!value->id && validUnit(value, FLength | FPercent)) { | 9116 if (!value->id && validUnit(value, FLength | FPercent)) { |
9117 list->append(createPrimitiveNumericValue(value)); | 9117 list->append(createPrimitiveNumericValue(value)); |
9118 m_valueList->next(); | 9118 m_valueList->next(); |
9119 return list.release(); | 9119 return list.release(); |
9120 } | 9120 } |
9121 } | 9121 } |
9122 | 9122 |
9123 #if ENABLE(CSS3_TEXT) | 9123 if (!RuntimeEnabledFeatures::css3TextEnabled()) |
| 9124 return 0; |
| 9125 |
9124 // The case where text-indent has only <length>(or <percentage>) value | 9126 // The case where text-indent has only <length>(or <percentage>) value |
9125 // is handled above if statement even though CSS3_TEXT is enabled. | 9127 // is handled above if statement even though css3TextEnabled() returns true. |
9126 | 9128 |
9127 // [ [ <length> | <percentage> ] && -webkit-each-line ] | inherit | 9129 // [ [ <length> | <percentage> ] && each-line ] | inherit |
9128 if (m_valueList->size() != 2) | 9130 if (m_valueList->size() != 2) |
9129 return 0; | 9131 return 0; |
9130 | 9132 |
9131 CSSParserValue* firstValue = m_valueList->current(); | 9133 CSSParserValue* firstValue = m_valueList->current(); |
9132 CSSParserValue* secondValue = m_valueList->next(); | 9134 CSSParserValue* secondValue = m_valueList->next(); |
9133 CSSParserValue* lengthOrPercentageValue = 0; | 9135 CSSParserValue* lengthOrPercentageValue = 0; |
9134 | 9136 |
9135 // [ <length> | <percentage> ] -webkit-each-line | 9137 // [ <length> | <percentage> ] each-line |
9136 if (validUnit(firstValue, FLength | FPercent) && secondValue->id == CSSValue
WebkitEachLine) | 9138 if (validUnit(firstValue, FLength | FPercent) && secondValue->id == CSSValue
EachLine) |
9137 lengthOrPercentageValue = firstValue; | 9139 lengthOrPercentageValue = firstValue; |
9138 // -webkit-each-line [ <length> | <percentage> ] | 9140 // each-line [ <length> | <percentage> ] |
9139 else if (firstValue->id == CSSValueWebkitEachLine && validUnit(secondValue,
FLength | FPercent)) | 9141 else if (firstValue->id == CSSValueEachLine && validUnit(secondValue, FLengt
h | FPercent)) |
9140 lengthOrPercentageValue = secondValue; | 9142 lengthOrPercentageValue = secondValue; |
9141 | 9143 |
9142 if (lengthOrPercentageValue) { | 9144 if (lengthOrPercentageValue) { |
9143 list->append(createPrimitiveNumericValue(lengthOrPercentageValue)); | 9145 list->append(createPrimitiveNumericValue(lengthOrPercentageValue)); |
9144 list->append(cssValuePool().createIdentifierValue(CSSValueWebkitEachLine
)); | 9146 list->append(cssValuePool().createIdentifierValue(CSSValueEachLine)); |
9145 m_valueList->next(); | 9147 m_valueList->next(); |
9146 return list.release(); | 9148 return list.release(); |
9147 } | 9149 } |
9148 #endif | |
9149 | 9150 |
9150 return 0; | 9151 return 0; |
9151 } | 9152 } |
9152 | 9153 |
9153 bool CSSParser::parseLineBoxContain(bool important) | 9154 bool CSSParser::parseLineBoxContain(bool important) |
9154 { | 9155 { |
9155 LineBoxContain lineBoxContain = LineBoxContainNone; | 9156 LineBoxContain lineBoxContain = LineBoxContainNone; |
9156 | 9157 |
9157 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { | 9158 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { |
9158 if (value->id == CSSValueBlock) { | 9159 if (value->id == CSSValueBlock) { |
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11920 { | 11921 { |
11921 // The tokenizer checks for the construct of an+b. | 11922 // The tokenizer checks for the construct of an+b. |
11922 // However, since the {ident} rule precedes the {nth} rule, some of those | 11923 // However, since the {ident} rule precedes the {nth} rule, some of those |
11923 // tokens are identified as string literal. Furthermore we need to accept | 11924 // tokens are identified as string literal. Furthermore we need to accept |
11924 // "odd" and "even" which does not match to an+b. | 11925 // "odd" and "even" which does not match to an+b. |
11925 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") | 11926 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") |
11926 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 11927 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
11927 } | 11928 } |
11928 | 11929 |
11929 } | 11930 } |
OLD | NEW |