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 7723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7734 return true; | 7734 return true; |
7735 } | 7735 } |
7736 | 7736 |
7737 return false; | 7737 return false; |
7738 } | 7738 } |
7739 | 7739 |
7740 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextIndent() | 7740 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextIndent() |
7741 { | 7741 { |
7742 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 7742 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
7743 | 7743 |
7744 // <length> | <percentage> | inherit | 7744 bool hasLengthOrPercentage = false; |
7745 if (m_valueList->size() == 1) { | 7745 bool hasEachLine = false; |
7746 CSSParserValue* value = m_valueList->current(); | 7746 bool hasHanging = false; |
7747 if (!value->id && validUnit(value, FLength | FPercent)) { | 7747 |
| 7748 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { |
| 7749 // <length> | <percentage> | inherit when RuntimeEnabledFeatures::css3Te
xtEnabled() returns false |
| 7750 if (!hasLengthOrPercentage && validUnit(value, FLength | FPercent)) { |
7748 list->append(createPrimitiveNumericValue(value)); | 7751 list->append(createPrimitiveNumericValue(value)); |
7749 m_valueList->next(); | 7752 hasLengthOrPercentage = true; |
7750 return list.release(); | 7753 continue; |
7751 } | 7754 } |
| 7755 |
| 7756 // [ <length> | <percentage> ] && hanging? && each-line? | inherit |
| 7757 // when RuntimeEnabledFeatures::css3TextEnabled() returns true |
| 7758 if (RuntimeEnabledFeatures::css3TextEnabled()) { |
| 7759 if (!hasEachLine && value->id == CSSValueEachLine) { |
| 7760 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); |
| 7761 hasEachLine = true; |
| 7762 continue; |
| 7763 } |
| 7764 if (!hasHanging && value->id == CSSValueHanging) { |
| 7765 list->append(cssValuePool().createIdentifierValue(CSSValueHangin
g)); |
| 7766 hasHanging = true; |
| 7767 continue; |
| 7768 } |
| 7769 } |
| 7770 return nullptr; |
7752 } | 7771 } |
7753 | 7772 |
7754 if (!RuntimeEnabledFeatures::css3TextEnabled()) | 7773 if (!hasLengthOrPercentage) |
7755 return nullptr; | 7774 return nullptr; |
7756 | 7775 |
7757 // The case where text-indent has only <length>(or <percentage>) value | 7776 return list.release(); |
7758 // is handled above if statement even though css3TextEnabled() returns true. | |
7759 | |
7760 // [ [ <length> | <percentage> ] && each-line ] | inherit | |
7761 if (m_valueList->size() != 2) | |
7762 return nullptr; | |
7763 | |
7764 CSSParserValue* firstValue = m_valueList->current(); | |
7765 CSSParserValue* secondValue = m_valueList->next(); | |
7766 CSSParserValue* lengthOrPercentageValue = 0; | |
7767 | |
7768 // [ <length> | <percentage> ] each-line | |
7769 if (validUnit(firstValue, FLength | FPercent) && secondValue->id == CSSValue
EachLine) | |
7770 lengthOrPercentageValue = firstValue; | |
7771 // each-line [ <length> | <percentage> ] | |
7772 else if (firstValue->id == CSSValueEachLine && validUnit(secondValue, FLengt
h | FPercent)) | |
7773 lengthOrPercentageValue = secondValue; | |
7774 | |
7775 if (lengthOrPercentageValue) { | |
7776 list->append(createPrimitiveNumericValue(lengthOrPercentageValue)); | |
7777 list->append(cssValuePool().createIdentifierValue(CSSValueEachLine)); | |
7778 m_valueList->next(); | |
7779 return list.release(); | |
7780 } | |
7781 | |
7782 return nullptr; | |
7783 } | 7777 } |
7784 | 7778 |
7785 bool CSSPropertyParser::parseLineBoxContain(bool important) | 7779 bool CSSPropertyParser::parseLineBoxContain(bool important) |
7786 { | 7780 { |
7787 LineBoxContain lineBoxContain = LineBoxContainNone; | 7781 LineBoxContain lineBoxContain = LineBoxContainNone; |
7788 | 7782 |
7789 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { | 7783 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { |
7790 if (value->id == CSSValueBlock) { | 7784 if (value->id == CSSValueBlock) { |
7791 if (lineBoxContain & LineBoxContainBlock) | 7785 if (lineBoxContain & LineBoxContainBlock) |
7792 return false; | 7786 return false; |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8483 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); | 8477 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); |
8484 if (!seenStroke) | 8478 if (!seenStroke) |
8485 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); | 8479 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); |
8486 if (!seenMarkers) | 8480 if (!seenMarkers) |
8487 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); | 8481 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); |
8488 | 8482 |
8489 return parsedValues.release(); | 8483 return parsedValues.release(); |
8490 } | 8484 } |
8491 | 8485 |
8492 } // namespace WebCore | 8486 } // namespace WebCore |
OLD | NEW |