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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 case CSSPropertyWebkitBorderEndWidth: | 653 case CSSPropertyWebkitBorderEndWidth: |
654 case CSSPropertyWebkitBorderBeforeWidth: | 654 case CSSPropertyWebkitBorderBeforeWidth: |
655 case CSSPropertyWebkitBorderAfterWidth: | 655 case CSSPropertyWebkitBorderAfterWidth: |
656 case CSSPropertyWebkitColumnRuleWidth: | 656 case CSSPropertyWebkitColumnRuleWidth: |
657 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) | 657 if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) |
658 validPrimitive = true; | 658 validPrimitive = true; |
659 else | 659 else |
660 validPrimitive = validUnit(value, FLength | FNonNeg | unitless); | 660 validPrimitive = validUnit(value, FLength | FNonNeg | unitless); |
661 break; | 661 break; |
662 | 662 |
663 case CSSPropertyTextIndent: | |
664 parsedValue = parseTextIndent(); | |
665 break; | |
666 | |
667 case CSSPropertyPaddingTop: //// <padding-width> | inherit | 663 case CSSPropertyPaddingTop: //// <padding-width> | inherit |
668 case CSSPropertyPaddingRight: // Which is defined as | 664 case CSSPropertyPaddingRight: // Which is defined as |
669 case CSSPropertyPaddingBottom: // <length> | <percentage> | 665 case CSSPropertyPaddingBottom: // <length> | <percentage> |
670 case CSSPropertyPaddingLeft: //// | 666 case CSSPropertyPaddingLeft: //// |
671 unitless = FUnitlessQuirk; | 667 unitless = FUnitlessQuirk; |
672 // fall through | 668 // fall through |
673 case CSSPropertyWebkitPaddingStart: | 669 case CSSPropertyWebkitPaddingStart: |
674 case CSSPropertyWebkitPaddingEnd: | 670 case CSSPropertyWebkitPaddingEnd: |
675 case CSSPropertyWebkitPaddingBefore: | 671 case CSSPropertyWebkitPaddingBefore: |
676 case CSSPropertyWebkitPaddingAfter: | 672 case CSSPropertyWebkitPaddingAfter: |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 case CSSPropertyFontSize: | 1343 case CSSPropertyFontSize: |
1348 case CSSPropertyLineHeight: | 1344 case CSSPropertyLineHeight: |
1349 case CSSPropertyRotate: | 1345 case CSSPropertyRotate: |
1350 case CSSPropertyFont: | 1346 case CSSPropertyFont: |
1351 case CSSPropertyWebkitBorderHorizontalSpacing: | 1347 case CSSPropertyWebkitBorderHorizontalSpacing: |
1352 case CSSPropertyWebkitBorderVerticalSpacing: | 1348 case CSSPropertyWebkitBorderVerticalSpacing: |
1353 case CSSPropertyBorderSpacing: | 1349 case CSSPropertyBorderSpacing: |
1354 case CSSPropertyCounterIncrement: | 1350 case CSSPropertyCounterIncrement: |
1355 case CSSPropertyCounterReset: | 1351 case CSSPropertyCounterReset: |
1356 case CSSPropertySize: | 1352 case CSSPropertySize: |
| 1353 case CSSPropertyTextIndent: |
1357 validPrimitive = false; | 1354 validPrimitive = false; |
1358 break; | 1355 break; |
1359 | 1356 |
1360 case CSSPropertyScrollSnapPointsX: | 1357 case CSSPropertyScrollSnapPointsX: |
1361 case CSSPropertyScrollSnapPointsY: | 1358 case CSSPropertyScrollSnapPointsY: |
1362 parsedValue = parseScrollSnapPoints(); | 1359 parsedValue = parseScrollSnapPoints(); |
1363 break; | 1360 break; |
1364 case CSSPropertyScrollSnapCoordinate: | 1361 case CSSPropertyScrollSnapCoordinate: |
1365 parsedValue = parseScrollSnapCoordinate(); | 1362 parsedValue = parseScrollSnapCoordinate(); |
1366 break; | 1363 break; |
(...skipping 4991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6358 return parsedValues.release(); | 6355 return parsedValues.release(); |
6359 } | 6356 } |
6360 if (fill) | 6357 if (fill) |
6361 return fill.release(); | 6358 return fill.release(); |
6362 if (shape) | 6359 if (shape) |
6363 return shape.release(); | 6360 return shape.release(); |
6364 | 6361 |
6365 return nullptr; | 6362 return nullptr; |
6366 } | 6363 } |
6367 | 6364 |
6368 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextIndent() | |
6369 { | |
6370 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | |
6371 | |
6372 bool hasLengthOrPercentage = false; | |
6373 bool hasEachLine = false; | |
6374 bool hasHanging = false; | |
6375 | |
6376 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL
ist->next()) { | |
6377 // <length> | <percentage> | inherit when RuntimeEnabledFeatures::css3Te
xtEnabled() returns false | |
6378 if (!hasLengthOrPercentage && validUnit(value, FLength | FPercent | FUni
tlessQuirk)) { | |
6379 list->append(createPrimitiveNumericValue(value)); | |
6380 hasLengthOrPercentage = true; | |
6381 continue; | |
6382 } | |
6383 | |
6384 // [ <length> | <percentage> ] && hanging? && each-line? | inherit | |
6385 // when RuntimeEnabledFeatures::css3TextEnabled() returns true | |
6386 if (RuntimeEnabledFeatures::css3TextEnabled()) { | |
6387 if (!hasEachLine && value->id == CSSValueEachLine) { | |
6388 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); | |
6389 hasEachLine = true; | |
6390 continue; | |
6391 } | |
6392 if (!hasHanging && value->id == CSSValueHanging) { | |
6393 list->append(cssValuePool().createIdentifierValue(CSSValueHangin
g)); | |
6394 hasHanging = true; | |
6395 continue; | |
6396 } | |
6397 } | |
6398 return nullptr; | |
6399 } | |
6400 | |
6401 if (!hasLengthOrPercentage) | |
6402 return nullptr; | |
6403 | |
6404 return list.release(); | |
6405 } | |
6406 | |
6407 bool CSSPropertyParser::parseCalculation(CSSParserValue* value, ValueRange range
) | 6365 bool CSSPropertyParser::parseCalculation(CSSParserValue* value, ValueRange range
) |
6408 { | 6366 { |
6409 ASSERT(isCalculation(value)); | 6367 ASSERT(isCalculation(value)); |
6410 | 6368 |
6411 CSSParserTokenRange args = value->calcFunction->args; | 6369 CSSParserTokenRange args = value->calcFunction->args; |
6412 | 6370 |
6413 ASSERT(!m_parsedCalculation); | 6371 ASSERT(!m_parsedCalculation); |
6414 m_parsedCalculation = CSSCalcValue::create(args, range); | 6372 m_parsedCalculation = CSSCalcValue::create(args, range); |
6415 | 6373 |
6416 if (!m_parsedCalculation) | 6374 if (!m_parsedCalculation) |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6991 } | 6949 } |
6992 } | 6950 } |
6993 | 6951 |
6994 if (!list->length()) | 6952 if (!list->length()) |
6995 return nullptr; | 6953 return nullptr; |
6996 | 6954 |
6997 return list.release(); | 6955 return list.release(); |
6998 } | 6956 } |
6999 | 6957 |
7000 } // namespace blink | 6958 } // namespace blink |
OLD | NEW |