| 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 9118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9129 // <length> | <percentage> | inherit | 9129 // <length> | <percentage> | inherit |
| 9130 if (m_valueList->size() == 1) { | 9130 if (m_valueList->size() == 1) { |
| 9131 CSSParserValue* value = m_valueList->current(); | 9131 CSSParserValue* value = m_valueList->current(); |
| 9132 if (!value->id && validUnit(value, FLength | FPercent)) { | 9132 if (!value->id && validUnit(value, FLength | FPercent)) { |
| 9133 list->append(createPrimitiveNumericValue(value)); | 9133 list->append(createPrimitiveNumericValue(value)); |
| 9134 m_valueList->next(); | 9134 m_valueList->next(); |
| 9135 return list.release(); | 9135 return list.release(); |
| 9136 } | 9136 } |
| 9137 } | 9137 } |
| 9138 | 9138 |
| 9139 #if ENABLE(CSS3_TEXT) | 9139 if (!RuntimeEnabledFeatures::css3TextEnabled()) |
| 9140 return 0; |
| 9141 |
| 9140 // The case where text-indent has only <length>(or <percentage>) value | 9142 // The case where text-indent has only <length>(or <percentage>) value |
| 9141 // is handled above if statement even though CSS3_TEXT is enabled. | 9143 // is handled above if statement even though css3TextEnabled() returns true. |
| 9142 | 9144 |
| 9143 // [ [ <length> | <percentage> ] && -webkit-each-line ] | inherit | 9145 // [ [ <length> | <percentage> ] && each-line ] | inherit |
| 9144 if (m_valueList->size() != 2) | 9146 if (m_valueList->size() != 2) |
| 9145 return 0; | 9147 return 0; |
| 9146 | 9148 |
| 9147 CSSParserValue* firstValue = m_valueList->current(); | 9149 CSSParserValue* firstValue = m_valueList->current(); |
| 9148 CSSParserValue* secondValue = m_valueList->next(); | 9150 CSSParserValue* secondValue = m_valueList->next(); |
| 9149 CSSParserValue* lengthOrPercentageValue = 0; | 9151 CSSParserValue* lengthOrPercentageValue = 0; |
| 9150 | 9152 |
| 9151 // [ <length> | <percentage> ] -webkit-each-line | 9153 // [ <length> | <percentage> ] each-line |
| 9152 if (validUnit(firstValue, FLength | FPercent) && secondValue->id == CSSValue
WebkitEachLine) | 9154 if (validUnit(firstValue, FLength | FPercent) && secondValue->id == CSSValue
EachLine) |
| 9153 lengthOrPercentageValue = firstValue; | 9155 lengthOrPercentageValue = firstValue; |
| 9154 // -webkit-each-line [ <length> | <percentage> ] | 9156 // each-line [ <length> | <percentage> ] |
| 9155 else if (firstValue->id == CSSValueWebkitEachLine && validUnit(secondValue,
FLength | FPercent)) | 9157 else if (firstValue->id == CSSValueEachLine && validUnit(secondValue, FLengt
h | FPercent)) |
| 9156 lengthOrPercentageValue = secondValue; | 9158 lengthOrPercentageValue = secondValue; |
| 9157 | 9159 |
| 9158 if (lengthOrPercentageValue) { | 9160 if (lengthOrPercentageValue) { |
| 9159 list->append(createPrimitiveNumericValue(lengthOrPercentageValue)); | 9161 list->append(createPrimitiveNumericValue(lengthOrPercentageValue)); |
| 9160 list->append(cssValuePool().createIdentifierValue(CSSValueWebkitEachLine
)); | 9162 list->append(cssValuePool().createIdentifierValue(CSSValueEachLine)); |
| 9161 m_valueList->next(); | 9163 m_valueList->next(); |
| 9162 return list.release(); | 9164 return list.release(); |
| 9163 } | 9165 } |
| 9164 #endif | |
| 9165 | 9166 |
| 9166 return 0; | 9167 return 0; |
| 9167 } | 9168 } |
| 9168 | 9169 |
| 9169 bool CSSParser::parseLineBoxContain(bool important) | 9170 bool CSSParser::parseLineBoxContain(bool important) |
| 9170 { | 9171 { |
| 9171 LineBoxContain lineBoxContain = LineBoxContainNone; | 9172 LineBoxContain lineBoxContain = LineBoxContainNone; |
| 9172 | 9173 |
| 9173 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { | 9174 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { |
| 9174 if (value->id == CSSValueBlock) { | 9175 if (value->id == CSSValueBlock) { |
| (...skipping 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11948 { | 11949 { |
| 11949 // The tokenizer checks for the construct of an+b. | 11950 // The tokenizer checks for the construct of an+b. |
| 11950 // However, since the {ident} rule precedes the {nth} rule, some of those | 11951 // However, since the {ident} rule precedes the {nth} rule, some of those |
| 11951 // tokens are identified as string literal. Furthermore we need to accept | 11952 // tokens are identified as string literal. Furthermore we need to accept |
| 11952 // "odd" and "even" which does not match to an+b. | 11953 // "odd" and "even" which does not match to an+b. |
| 11953 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") | 11954 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") |
| 11954 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 11955 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
| 11955 } | 11956 } |
| 11956 | 11957 |
| 11957 } | 11958 } |
| OLD | NEW |