| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 return false; | 457 return false; |
| 458 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial
Value(), important); | 458 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial
Value(), important); |
| 459 return true; | 459 return true; |
| 460 } else if (id == CSSValueUnset) { | 460 } else if (id == CSSValueUnset) { |
| 461 if (m_valueList->size() != 1) | 461 if (m_valueList->size() != 1) |
| 462 return false; | 462 return false; |
| 463 addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), i
mportant); | 463 addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), i
mportant); |
| 464 return true; | 464 return true; |
| 465 } | 465 } |
| 466 | 466 |
| 467 int num = inShorthand() ? 1 : m_valueList->size(); | |
| 468 | |
| 469 if (CSSParserFastPaths::isKeywordPropertyID(propId)) { | 467 if (CSSParserFastPaths::isKeywordPropertyID(propId)) { |
| 470 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) | 468 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) |
| 471 return false; | 469 return false; |
| 472 if (m_valueList->next() && !inShorthand()) | 470 if (m_valueList->next() && !inShorthand()) |
| 473 return false; | 471 return false; |
| 474 addProperty(propId, cssValuePool().createIdentifierValue(id), important)
; | 472 addProperty(propId, cssValuePool().createIdentifierValue(id), important)
; |
| 475 return true; | 473 return true; |
| 476 } | 474 } |
| 477 | 475 |
| 478 bool validPrimitive = false; | 476 bool validPrimitive = false; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 499 validPrimitive = true; | 497 validPrimitive = true; |
| 500 else if (value->m_unit == CSSParserValue::Function) | 498 else if (value->m_unit == CSSParserValue::Function) |
| 501 parsedValue = parseClipShape(); | 499 parsedValue = parseClipShape(); |
| 502 break; | 500 break; |
| 503 | 501 |
| 504 /* Start of supported CSS properties with validation. This is needed for par
seShorthand to work | 502 /* Start of supported CSS properties with validation. This is needed for par
seShorthand to work |
| 505 * correctly and allows optimization in blink::applyRule(..) | 503 * correctly and allows optimization in blink::applyRule(..) |
| 506 */ | 504 */ |
| 507 case CSSPropertyOverflow: { | 505 case CSSPropertyOverflow: { |
| 508 ShorthandScope scope(this, propId); | 506 ShorthandScope scope(this, propId); |
| 509 if (num != 1 || !parseValue(CSSPropertyOverflowY, important)) | 507 if (!parseValue(CSSPropertyOverflowY, important) || m_valueList->current
()) |
| 510 return false; | 508 return false; |
| 511 | 509 |
| 512 RefPtrWillBeRawPtr<CSSValue> overflowXValue = nullptr; | 510 RefPtrWillBeRawPtr<CSSValue> overflowXValue = nullptr; |
| 513 | 511 |
| 514 // FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. I
f this value has been | 512 // FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. I
f this value has been |
| 515 // set using the shorthand, then for now overflow-x will default to auto
, but once we implement | 513 // set using the shorthand, then for now overflow-x will default to auto
, but once we implement |
| 516 // pagination controls, it should default to hidden. If the overflow-y v
alue is anything but | 514 // pagination controls, it should default to hidden. If the overflow-y v
alue is anything but |
| 517 // paged-x or paged-y, then overflow-x and overflow-y should have the sa
me value. | 515 // paged-x or paged-y, then overflow-x and overflow-y should have the sa
me value. |
| 518 if (id == CSSValueWebkitPagedX || id == CSSValueWebkitPagedY) | 516 if (id == CSSValueWebkitPagedX || id == CSSValueWebkitPagedY) |
| 519 overflowXValue = cssValuePool().createIdentifierValue(CSSValueAuto); | 517 overflowXValue = cssValuePool().createIdentifierValue(CSSValueAuto); |
| 520 else | 518 else |
| 521 overflowXValue = m_parsedProperties.last().value(); | 519 overflowXValue = m_parsedProperties.last().value(); |
| 522 addProperty(CSSPropertyOverflowX, overflowXValue.release(), important); | 520 addProperty(CSSPropertyOverflowX, overflowXValue.release(), important); |
| 523 return true; | 521 return true; |
| 524 } | 522 } |
| 525 | 523 |
| 526 case CSSPropertyTextAlign: | 524 case CSSPropertyTextAlign: |
| 527 // left | right | center | justify | -webkit-left | -webkit-right | -web
kit-center | -webkit-match-parent | 525 // left | right | center | justify | -webkit-left | -webkit-right | -web
kit-center | -webkit-match-parent |
| 528 // | start | end | <string> | inherit | -webkit-auto (converted to start
) | 526 // | start | end | <string> | inherit | -webkit-auto (converted to start
) |
| 529 // FIXME: <string> not supported right now | 527 // FIXME: <string> not supported right now |
| 530 if ((id >= CSSValueWebkitAuto && id <= CSSValueWebkitMatchParent) || id
== CSSValueStart || id == CSSValueEnd) { | 528 if ((id >= CSSValueWebkitAuto && id <= CSSValueWebkitMatchParent) || id
== CSSValueStart || id == CSSValueEnd) { |
| 531 validPrimitive = true; | 529 validPrimitive = true; |
| 532 } | 530 } |
| 533 break; | 531 break; |
| 534 | 532 |
| 535 case CSSPropertyFontWeight: { // normal | bold | bolder | lighter | 100 | 2
00 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit | 533 case CSSPropertyFontWeight: // normal | bold | bolder | lighter | 100 | 200
| 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit |
| 536 if (m_valueList->size() != 1) | 534 return parseFontWeight(important) && !m_valueList->next(); |
| 537 return false; | |
| 538 return parseFontWeight(important); | |
| 539 } | |
| 540 | 535 |
| 541 case CSSPropertyBorderSpacing: { | 536 case CSSPropertyBorderSpacing: { |
| 542 if (num == 1) { | 537 ShorthandScope scope(this, CSSPropertyBorderSpacing); |
| 543 ShorthandScope scope(this, CSSPropertyBorderSpacing); | 538 if (!parseValue(CSSPropertyWebkitBorderHorizontalSpacing, important)) |
| 544 if (!parseValue(CSSPropertyWebkitBorderHorizontalSpacing, important)
) | 539 return false; |
| 545 return false; | 540 if (!m_valueList->current()) { |
| 546 CSSValue* value = m_parsedProperties.last().value(); | 541 CSSValue* value = m_parsedProperties.last().value(); |
| 547 addProperty(CSSPropertyWebkitBorderVerticalSpacing, value, important
); | 542 addProperty(CSSPropertyWebkitBorderVerticalSpacing, value, important
); |
| 548 return true; | 543 return true; |
| 549 } | 544 } |
| 550 else if (num == 2) { | 545 if (!parseValue(CSSPropertyWebkitBorderVerticalSpacing, important)) |
| 551 ShorthandScope scope(this, CSSPropertyBorderSpacing); | 546 return false; |
| 552 if (!parseValue(CSSPropertyWebkitBorderHorizontalSpacing, important)
|| !parseValue(CSSPropertyWebkitBorderVerticalSpacing, important)) | 547 return !m_valueList->current(); |
| 553 return false; | |
| 554 return true; | |
| 555 } | |
| 556 return false; | |
| 557 } | 548 } |
| 558 case CSSPropertyWebkitBorderHorizontalSpacing: | 549 case CSSPropertyWebkitBorderHorizontalSpacing: |
| 559 case CSSPropertyWebkitBorderVerticalSpacing: | 550 case CSSPropertyWebkitBorderVerticalSpacing: |
| 560 unitless = FLength | FNonNeg; | 551 unitless = FLength | FNonNeg; |
| 561 if (inShorthand() && m_currentShorthand == CSSPropertyBorderSpacing) | 552 if (inShorthand() && m_currentShorthand == CSSPropertyBorderSpacing) |
| 562 unitless = unitless | FUnitlessQuirk; | 553 unitless = unitless | FUnitlessQuirk; |
| 563 validPrimitive = validUnit(value, unitless); | 554 validPrimitive = validUnit(value, unitless); |
| 564 break; | 555 break; |
| 565 case CSSPropertyOutlineColor: // <color> | invert | inherit | 556 case CSSPropertyOutlineColor: // <color> | invert | inherit |
| 566 // Outline color has "invert" as additional keyword. | 557 // Outline color has "invert" as additional keyword. |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 if (parseBorderImageWidth(result)) { | 962 if (parseBorderImageWidth(result)) { |
| 972 addProperty(propId, result, important); | 963 addProperty(propId, result, important); |
| 973 return true; | 964 return true; |
| 974 } | 965 } |
| 975 break; | 966 break; |
| 976 } | 967 } |
| 977 case CSSPropertyBorderTopRightRadius: | 968 case CSSPropertyBorderTopRightRadius: |
| 978 case CSSPropertyBorderTopLeftRadius: | 969 case CSSPropertyBorderTopLeftRadius: |
| 979 case CSSPropertyBorderBottomLeftRadius: | 970 case CSSPropertyBorderBottomLeftRadius: |
| 980 case CSSPropertyBorderBottomRightRadius: { | 971 case CSSPropertyBorderBottomRightRadius: { |
| 981 if (num != 1 && num != 2) | |
| 982 return false; | |
| 983 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg); | 972 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg); |
| 984 if (!validPrimitive) | 973 if (!validPrimitive) |
| 985 return false; | 974 return false; |
| 986 RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1 = createPrimitiveNume
ricValue(value); | 975 RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1 = createPrimitiveNume
ricValue(value); |
| 987 RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2 = nullptr; | 976 RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2 = nullptr; |
| 988 if (num == 2) { | 977 value = m_valueList->next(); |
| 989 value = m_valueList->next(); | 978 if (value) { |
| 990 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg); | 979 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg); |
| 991 if (!validPrimitive) | 980 if (!validPrimitive) |
| 992 return false; | 981 return false; |
| 993 parsedValue2 = createPrimitiveNumericValue(value); | 982 parsedValue2 = createPrimitiveNumericValue(value); |
| 994 } else | 983 } else |
| 995 parsedValue2 = parsedValue1; | 984 parsedValue2 = parsedValue1; |
| 996 | 985 |
| 986 if (m_valueList->next()) |
| 987 return false; |
| 997 addProperty(propId, createPrimitiveValuePair(parsedValue1.release(), par
sedValue2.release()), important); | 988 addProperty(propId, createPrimitiveValuePair(parsedValue1.release(), par
sedValue2.release()), important); |
| 998 return true; | 989 return true; |
| 999 } | 990 } |
| 1000 case CSSPropertyTabSize: | 991 case CSSPropertyTabSize: |
| 1001 // May be specified as a unit-less non-negative integer or length indica
ting number of space characters. | 992 // May be specified as a unit-less non-negative integer or length indica
ting number of space characters. |
| 1002 validPrimitive = validUnit(value, FInteger | FLength | FNonNeg); | 993 validPrimitive = validUnit(value, FInteger | FLength | FNonNeg); |
| 1003 break; | 994 break; |
| 1004 case CSSPropertyBorderRadius: | 995 case CSSPropertyBorderRadius: |
| 1005 case CSSPropertyAliasWebkitBorderRadius: | 996 case CSSPropertyAliasWebkitBorderRadius: |
| 1006 return parseBorderRadius(unresolvedProperty, important); | 997 return parseBorderRadius(unresolvedProperty, important); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 | 1285 |
| 1295 case CSSPropertyGridTemplate: | 1286 case CSSPropertyGridTemplate: |
| 1296 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); | 1287 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
| 1297 return parseGridTemplateShorthand(important); | 1288 return parseGridTemplateShorthand(important); |
| 1298 | 1289 |
| 1299 case CSSPropertyGrid: | 1290 case CSSPropertyGrid: |
| 1300 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); | 1291 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
| 1301 return parseGridShorthand(important); | 1292 return parseGridShorthand(important); |
| 1302 | 1293 |
| 1303 case CSSPropertyWebkitMarginCollapse: { | 1294 case CSSPropertyWebkitMarginCollapse: { |
| 1304 if (num == 1) { | 1295 ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse); |
| 1305 ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse); | 1296 if (!parseValue(webkitMarginCollapseShorthand().properties()[0], importa
nt)) |
| 1306 if (!parseValue(webkitMarginCollapseShorthand().properties()[0], imp
ortant)) | 1297 return false; |
| 1307 return false; | 1298 if (!m_valueList->current()) { |
| 1308 CSSValue* value = m_parsedProperties.last().value(); | 1299 CSSValue* value = m_parsedProperties.last().value(); |
| 1309 addProperty(webkitMarginCollapseShorthand().properties()[1], value,
important); | 1300 addProperty(webkitMarginCollapseShorthand().properties()[1], value,
important); |
| 1310 return true; | 1301 return true; |
| 1311 } | 1302 } |
| 1312 else if (num == 2) { | 1303 if (!parseValue(webkitMarginCollapseShorthand().properties()[1], importa
nt)) |
| 1313 ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse); | 1304 return false; |
| 1314 if (!parseValue(webkitMarginCollapseShorthand().properties()[0], imp
ortant) || !parseValue(webkitMarginCollapseShorthand().properties()[1], importan
t)) | 1305 return !m_valueList->current(); |
| 1315 return false; | |
| 1316 return true; | |
| 1317 } | |
| 1318 return false; | |
| 1319 } | 1306 } |
| 1320 case CSSPropertyWebkitColumnCount: | 1307 case CSSPropertyWebkitColumnCount: |
| 1321 parsedValue = parseColumnCount(); | 1308 parsedValue = parseColumnCount(); |
| 1322 break; | 1309 break; |
| 1323 case CSSPropertyWebkitColumnGap: // normal | <length> | 1310 case CSSPropertyWebkitColumnGap: // normal | <length> |
| 1324 if (id == CSSValueNormal) | 1311 if (id == CSSValueNormal) |
| 1325 validPrimitive = true; | 1312 validPrimitive = true; |
| 1326 else | 1313 else |
| 1327 validPrimitive = validUnit(value, FLength | FNonNeg); | 1314 validPrimitive = validUnit(value, FLength | FNonNeg); |
| 1328 break; | 1315 break; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 // <margin-width>{1,4} | inherit | 1429 // <margin-width>{1,4} | inherit |
| 1443 return parse4Values(propId, marginShorthand().properties(), important); | 1430 return parse4Values(propId, marginShorthand().properties(), important); |
| 1444 case CSSPropertyPadding: | 1431 case CSSPropertyPadding: |
| 1445 // <padding-width>{1,4} | inherit | 1432 // <padding-width>{1,4} | inherit |
| 1446 return parse4Values(propId, paddingShorthand().properties(), important); | 1433 return parse4Values(propId, paddingShorthand().properties(), important); |
| 1447 case CSSPropertyFlexFlow: | 1434 case CSSPropertyFlexFlow: |
| 1448 return parseShorthand(propId, flexFlowShorthand(), important); | 1435 return parseShorthand(propId, flexFlowShorthand(), important); |
| 1449 case CSSPropertyFont: | 1436 case CSSPropertyFont: |
| 1450 // [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [
/ 'line-height' ]? | 1437 // [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [
/ 'line-height' ]? |
| 1451 // 'font-family' ] | caption | icon | menu | message-box | small-caption
| status-bar | inherit | 1438 // 'font-family' ] | caption | icon | menu | message-box | small-caption
| status-bar | inherit |
| 1452 if (num == 1 && id >= CSSValueCaption && id <= CSSValueStatusBar) { | 1439 if (id >= CSSValueCaption && id <= CSSValueStatusBar) |
| 1453 parseSystemFont(important); | 1440 return parseSystemFont(important); |
| 1454 return true; | |
| 1455 } | |
| 1456 return parseFont(important); | 1441 return parseFont(important); |
| 1457 case CSSPropertyListStyle: | 1442 case CSSPropertyListStyle: |
| 1458 return parseShorthand(propId, listStyleShorthand(), important); | 1443 return parseShorthand(propId, listStyleShorthand(), important); |
| 1459 case CSSPropertyWebkitColumns: | 1444 case CSSPropertyWebkitColumns: |
| 1460 return parseColumnsShorthand(important); | 1445 return parseColumnsShorthand(important); |
| 1461 case CSSPropertyWebkitColumnRule: | 1446 case CSSPropertyWebkitColumnRule: |
| 1462 return parseShorthand(propId, webkitColumnRuleShorthand(), important); | 1447 return parseShorthand(propId, webkitColumnRuleShorthand(), important); |
| 1463 case CSSPropertyWebkitTextStroke: | 1448 case CSSPropertyWebkitTextStroke: |
| 1464 return parseShorthand(propId, webkitTextStrokeShorthand(), important); | 1449 return parseShorthand(propId, webkitTextStrokeShorthand(), important); |
| 1465 case CSSPropertyAnimation: | 1450 case CSSPropertyAnimation: |
| (...skipping 3177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4643 | 4628 |
| 4644 // FIXME: http://www.w3.org/TR/2011/WD-css3-fonts-20110324/#font-prop requir
es that | 4629 // FIXME: http://www.w3.org/TR/2011/WD-css3-fonts-20110324/#font-prop requir
es that |
| 4645 // "font-stretch", "font-size-adjust", and "font-kerning" be reset to their
initial values | 4630 // "font-stretch", "font-size-adjust", and "font-kerning" be reset to their
initial values |
| 4646 // but we don't seem to support them at the moment. They should also be adde
d here once implemented. | 4631 // but we don't seem to support them at the moment. They should also be adde
d here once implemented. |
| 4647 if (m_valueList->current()) | 4632 if (m_valueList->current()) |
| 4648 return false; | 4633 return false; |
| 4649 | 4634 |
| 4650 return true; | 4635 return true; |
| 4651 } | 4636 } |
| 4652 | 4637 |
| 4653 void CSSPropertyParser::parseSystemFont(bool important) | 4638 bool CSSPropertyParser::parseSystemFont(bool important) |
| 4654 { | 4639 { |
| 4655 ASSERT(m_valueList->size() == 1); | |
| 4656 CSSValueID systemFontID = m_valueList->valueAt(0)->id; | 4640 CSSValueID systemFontID = m_valueList->valueAt(0)->id; |
| 4657 ASSERT(systemFontID >= CSSValueCaption && systemFontID <= CSSValueStatusBar)
; | 4641 ASSERT(systemFontID >= CSSValueCaption && systemFontID <= CSSValueStatusBar)
; |
| 4658 m_valueList->next(); | 4642 if (m_valueList->next()) |
| 4643 return false; |
| 4659 | 4644 |
| 4660 FontStyle fontStyle = FontStyleNormal; | 4645 FontStyle fontStyle = FontStyleNormal; |
| 4661 FontWeight fontWeight = FontWeightNormal; | 4646 FontWeight fontWeight = FontWeightNormal; |
| 4662 float fontSize = 0; | 4647 float fontSize = 0; |
| 4663 AtomicString fontFamily; | 4648 AtomicString fontFamily; |
| 4664 LayoutTheme::theme().systemFont(systemFontID, fontStyle, fontWeight, fontSiz
e, fontFamily); | 4649 LayoutTheme::theme().systemFont(systemFontID, fontStyle, fontWeight, fontSiz
e, fontFamily); |
| 4665 | 4650 |
| 4666 ShorthandScope scope(this, CSSPropertyFont); | 4651 ShorthandScope scope(this, CSSPropertyFont); |
| 4667 addProperty(CSSPropertyFontStyle, cssValuePool().createIdentifierValue(fontS
tyle == FontStyleItalic ? CSSValueItalic : CSSValueNormal), important); | 4652 addProperty(CSSPropertyFontStyle, cssValuePool().createIdentifierValue(fontS
tyle == FontStyleItalic ? CSSValueItalic : CSSValueNormal), important); |
| 4668 addProperty(CSSPropertyFontWeight, cssValuePool().createValue(fontWeight), i
mportant); | 4653 addProperty(CSSPropertyFontWeight, cssValuePool().createValue(fontWeight), i
mportant); |
| 4669 addProperty(CSSPropertyFontSize, cssValuePool().createValue(fontSize, CSSPri
mitiveValue::UnitType::Pixels), important); | 4654 addProperty(CSSPropertyFontSize, cssValuePool().createValue(fontSize, CSSPri
mitiveValue::UnitType::Pixels), important); |
| 4670 RefPtrWillBeRawPtr<CSSValueList> fontFamilyList = CSSValueList::createCommaS
eparated(); | 4655 RefPtrWillBeRawPtr<CSSValueList> fontFamilyList = CSSValueList::createCommaS
eparated(); |
| 4671 fontFamilyList->append(cssValuePool().createFontFamilyValue(fontFamily)); | 4656 fontFamilyList->append(cssValuePool().createFontFamilyValue(fontFamily)); |
| 4672 addProperty(CSSPropertyFontFamily, fontFamilyList.release(), important); | 4657 addProperty(CSSPropertyFontFamily, fontFamilyList.release(), important); |
| 4673 | 4658 |
| 4674 addProperty(CSSPropertyFontStretch, cssValuePool().createIdentifierValue(CSS
ValueNormal), important); | 4659 addProperty(CSSPropertyFontStretch, cssValuePool().createIdentifierValue(CSS
ValueNormal), important); |
| 4675 addProperty(CSSPropertyFontVariant, cssValuePool().createIdentifierValue(CSS
ValueNormal), important); | 4660 addProperty(CSSPropertyFontVariant, cssValuePool().createIdentifierValue(CSS
ValueNormal), important); |
| 4676 addProperty(CSSPropertyLineHeight, cssValuePool().createIdentifierValue(CSSV
alueNormal), important); | 4661 addProperty(CSSPropertyLineHeight, cssValuePool().createIdentifierValue(CSSV
alueNormal), important); |
| 4662 return true; |
| 4677 } | 4663 } |
| 4678 | 4664 |
| 4679 class FontFamilyValueBuilder { | 4665 class FontFamilyValueBuilder { |
| 4680 STACK_ALLOCATED(); | 4666 STACK_ALLOCATED(); |
| 4681 public: | 4667 public: |
| 4682 FontFamilyValueBuilder(CSSValueList* list) | 4668 FontFamilyValueBuilder(CSSValueList* list) |
| 4683 : m_list(list) | 4669 : m_list(list) |
| 4684 { | 4670 { |
| 4685 } | 4671 } |
| 4686 | 4672 |
| (...skipping 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7433 // TODO(rwlbuis): check there is only one family-name | 7419 // TODO(rwlbuis): check there is only one family-name |
| 7434 parsedValue = parseFontFamily(); | 7420 parsedValue = parseFontFamily(); |
| 7435 break; | 7421 break; |
| 7436 case CSSPropertySrc: // This is a list of urls or local references. | 7422 case CSSPropertySrc: // This is a list of urls or local references. |
| 7437 parsedValue = parseFontFaceSrc(); | 7423 parsedValue = parseFontFaceSrc(); |
| 7438 break; | 7424 break; |
| 7439 case CSSPropertyUnicodeRange: | 7425 case CSSPropertyUnicodeRange: |
| 7440 parsedValue = parseFontFaceUnicodeRange(); | 7426 parsedValue = parseFontFaceUnicodeRange(); |
| 7441 break; | 7427 break; |
| 7442 case CSSPropertyFontWeight: // normal | bold | 100 | 200 | 300 | 400 | 500 |
600 | 700 | 800 | 900 | 7428 case CSSPropertyFontWeight: // normal | bold | 100 | 200 | 300 | 400 | 500 |
600 | 700 | 800 | 900 |
| 7443 if (m_valueList->size() != 1) | 7429 return parseFontWeight(false) && !m_valueList->next(); |
| 7444 return false; | |
| 7445 return parseFontWeight(false); | |
| 7446 case CSSPropertyFontStretch: | 7430 case CSSPropertyFontStretch: |
| 7447 case CSSPropertyFontStyle: | 7431 case CSSPropertyFontStyle: |
| 7448 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) | 7432 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) |
| 7449 return false; | 7433 return false; |
| 7450 addProperty(propId, cssValuePool().createIdentifierValue(id), false); | 7434 addProperty(propId, cssValuePool().createIdentifierValue(id), false); |
| 7451 return true; | 7435 return true; |
| 7452 case CSSPropertyFontVariant: // normal | small-caps | inherit | 7436 case CSSPropertyFontVariant: // normal | small-caps | inherit |
| 7453 return parseFontVariant(false); | 7437 return parseFontVariant(false); |
| 7454 case CSSPropertyWebkitFontFeatureSettings: | 7438 case CSSPropertyWebkitFontFeatureSettings: |
| 7455 if (id == CSSValueNormal) { | 7439 if (id == CSSValueNormal) { |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8123 } | 8107 } |
| 8124 } | 8108 } |
| 8125 | 8109 |
| 8126 if (!list->length()) | 8110 if (!list->length()) |
| 8127 return nullptr; | 8111 return nullptr; |
| 8128 | 8112 |
| 8129 return list.release(); | 8113 return list.release(); |
| 8130 } | 8114 } |
| 8131 | 8115 |
| 8132 } // namespace blink | 8116 } // namespace blink |
| OLD | NEW |