OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
7 * Copyright (C) 2015 Google Inc. All rights reserved. | 7 * Copyright (C) 2015 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 return CSSValueSansSerif; | 485 return CSSValueSansSerif; |
486 if (family == FontFamilyNames::webkit_serif) | 486 if (family == FontFamilyNames::webkit_serif) |
487 return CSSValueSerif; | 487 return CSSValueSerif; |
488 return CSSValueInvalid; | 488 return CSSValueInvalid; |
489 } | 489 } |
490 | 490 |
491 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFamily(const AtomicStri
ng& family) | 491 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFamily(const AtomicStri
ng& family) |
492 { | 492 { |
493 if (CSSValueID familyIdentifier = identifierForFamily(family)) | 493 if (CSSValueID familyIdentifier = identifierForFamily(family)) |
494 return cssValuePool().createIdentifierValue(familyIdentifier); | 494 return cssValuePool().createIdentifierValue(familyIdentifier); |
495 return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_ST
RING); | 495 return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_CU
STOM_IDENT); |
496 } | 496 } |
497 | 497 |
498 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const LayoutStyle
& style) | 498 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const LayoutStyle
& style) |
499 { | 499 { |
500 const FontFamily& firstFamily = style.fontDescription().family(); | 500 const FontFamily& firstFamily = style.fontDescription().family(); |
501 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 501 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
502 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) | 502 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) |
503 list->append(valueForFamily(family->family())); | 503 list->append(valueForFamily(family->family())); |
504 return list.release(); | 504 return list.release(); |
505 } | 505 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } | 556 } |
557 | 557 |
558 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) | 558 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) |
559 { | 559 { |
560 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); | 560 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); |
561 if (namedGridLines.isEmpty()) | 561 if (namedGridLines.isEmpty()) |
562 return; | 562 return; |
563 | 563 |
564 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); | 564 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); |
565 for (size_t j = 0; j < namedGridLines.size(); ++j) | 565 for (size_t j = 0; j < namedGridLines.size(); ++j) |
566 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi
tiveValue::CSS_STRING)); | 566 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi
tiveValue::CSS_CUSTOM_IDENT)); |
567 list.append(lineNames.release()); | 567 list.append(lineNames.release()); |
568 } | 568 } |
569 | 569 |
570 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* renderer, const LayoutStyle& style) | 570 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* renderer, const LayoutStyle& style) |
571 { | 571 { |
572 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); | 572 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); |
573 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); | 573 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); |
574 bool isLayoutGrid = renderer && renderer->isLayoutGrid(); | 574 bool isLayoutGrid = renderer && renderer->isLayoutGrid(); |
575 | 575 |
576 // Handle the 'none' case. | 576 // Handle the 'none' case. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, trackSizes.size(),
*list); | 608 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, trackSizes.size(),
*list); |
609 return list.release(); | 609 return list.release(); |
610 } | 610 } |
611 | 611 |
612 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition&
position) | 612 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition&
position) |
613 { | 613 { |
614 if (position.isAuto()) | 614 if (position.isAuto()) |
615 return cssValuePool().createIdentifierValue(CSSValueAuto); | 615 return cssValuePool().createIdentifierValue(CSSValueAuto); |
616 | 616 |
617 if (position.isNamedGridArea()) | 617 if (position.isNamedGridArea()) |
618 return cssValuePool().createValue(position.namedGridLine(), CSSPrimitive
Value::CSS_STRING); | 618 return cssValuePool().createValue(position.namedGridLine(), CSSPrimitive
Value::CSS_CUSTOM_IDENT); |
619 | 619 |
620 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 620 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
621 if (position.isSpan()) { | 621 if (position.isSpan()) { |
622 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); | 622 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); |
623 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::CSS_NUMBER)); | 623 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::CSS_NUMBER)); |
624 } else { | 624 } else { |
625 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::CSS_NUMBER)); | 625 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::CSS_NUMBER)); |
626 } | 626 } |
627 | 627 |
628 if (!position.namedGridLine().isNull()) | 628 if (!position.namedGridLine().isNull()) |
629 list->append(cssValuePool().createValue(position.namedGridLine(), CSSPri
mitiveValue::CSS_STRING)); | 629 list->append(cssValuePool().createValue(position.namedGridLine(), CSSPri
mitiveValue::CSS_CUSTOM_IDENT)); |
630 return list; | 630 return list; |
631 } | 631 } |
632 | 632 |
633 static LayoutRect sizingBox(const LayoutObject* renderer) | 633 static LayoutRect sizingBox(const LayoutObject* renderer) |
634 { | 634 { |
635 if (!renderer->isBox()) | 635 if (!renderer->isBox()) |
636 return LayoutRect(); | 636 return LayoutRect(); |
637 | 637 |
638 const LayoutBox* box = toLayoutBox(renderer); | 638 const LayoutBox* box = toLayoutBox(renderer); |
639 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); | 639 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 return list.release(); | 939 return list.release(); |
940 } | 940 } |
941 | 941 |
942 static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSST
ransitionData::TransitionProperty& property) | 942 static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSST
ransitionData::TransitionProperty& property) |
943 { | 943 { |
944 if (property.propertyType == CSSTransitionData::TransitionNone) | 944 if (property.propertyType == CSSTransitionData::TransitionNone) |
945 return cssValuePool().createIdentifierValue(CSSValueNone); | 945 return cssValuePool().createIdentifierValue(CSSValueNone); |
946 if (property.propertyType == CSSTransitionData::TransitionAll) | 946 if (property.propertyType == CSSTransitionData::TransitionAll) |
947 return cssValuePool().createIdentifierValue(CSSValueAll); | 947 return cssValuePool().createIdentifierValue(CSSValueAll); |
948 if (property.propertyType == CSSTransitionData::TransitionUnknown) | 948 if (property.propertyType == CSSTransitionData::TransitionUnknown) |
949 return cssValuePool().createValue(property.propertyString, CSSPrimitiveV
alue::CSS_STRING); | 949 return cssValuePool().createValue(property.propertyString, CSSPrimitiveV
alue::CSS_CUSTOM_IDENT); |
950 ASSERT(property.propertyType == CSSTransitionData::TransitionSingleProperty)
; | 950 ASSERT(property.propertyType == CSSTransitionData::TransitionSingleProperty)
; |
951 return cssValuePool().createValue(getPropertyNameString(property.propertyId)
, CSSPrimitiveValue::CSS_STRING); | 951 return cssValuePool().createValue(getPropertyNameString(property.propertyId)
, CSSPrimitiveValue::CSS_CUSTOM_IDENT); |
952 } | 952 } |
953 | 953 |
954 static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTran
sitionData* transitionData) | 954 static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTran
sitionData* transitionData) |
955 { | 955 { |
956 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 956 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
957 if (transitionData) { | 957 if (transitionData) { |
958 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 958 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
959 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); | 959 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); |
960 } else { | 960 } else { |
961 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); | 961 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); |
(...skipping 14 matching lines...) Expand all Loading... |
976 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { | 976 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { |
977 if (contentData->isCounter()) { | 977 if (contentData->isCounter()) { |
978 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); | 978 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); |
979 ASSERT(counter); | 979 ASSERT(counter); |
980 list->append(cssValuePool().createValue(counter->identifier(), CSSPr
imitiveValue::CSS_COUNTER_NAME)); | 980 list->append(cssValuePool().createValue(counter->identifier(), CSSPr
imitiveValue::CSS_COUNTER_NAME)); |
981 } else if (contentData->isImage()) { | 981 } else if (contentData->isImage()) { |
982 const StyleImage* image = toImageContentData(contentData)->image(); | 982 const StyleImage* image = toImageContentData(contentData)->image(); |
983 ASSERT(image); | 983 ASSERT(image); |
984 list->append(image->cssValue()); | 984 list->append(image->cssValue()); |
985 } else if (contentData->isText()) { | 985 } else if (contentData->isText()) { |
986 list->append(cssValuePool().createValue(toTextContentData(contentDat
a)->text(), CSSPrimitiveValue::CSS_STRING)); | 986 list->append(cssValuePool().createValue(toTextContentData(contentDat
a)->text(), CSSPrimitiveValue::CSS_CUSTOM_IDENT)); |
987 } | 987 } |
988 } | 988 } |
989 return list.release(); | 989 return list.release(); |
990 } | 990 } |
991 | 991 |
992 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const LayoutSt
yle& style, CSSPropertyID propertyID) | 992 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const LayoutSt
yle& style, CSSPropertyID propertyID) |
993 { | 993 { |
994 const CounterDirectiveMap* map = style.counterDirectives(); | 994 const CounterDirectiveMap* map = style.counterDirectives(); |
995 if (!map) | 995 if (!map) |
996 return cssValuePool().createIdentifierValue(CSSValueNone); | 996 return cssValuePool().createIdentifierValue(CSSValueNone); |
997 | 997 |
998 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 998 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
999 for (const auto& item : *map) { | 999 for (const auto& item : *map) { |
1000 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); | 1000 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); |
1001 if (!isValidCounterValue) | 1001 if (!isValidCounterValue) |
1002 continue; | 1002 continue; |
1003 | 1003 |
1004 list->append(cssValuePool().createValue(item.key, CSSPrimitiveValue::CSS
_STRING)); | 1004 list->append(cssValuePool().createValue(item.key, CSSPrimitiveValue::CSS
_CUSTOM_IDENT)); |
1005 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); | 1005 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); |
1006 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::CSS_NUMBER)); | 1006 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::CSS_NUMBER)); |
1007 } | 1007 } |
1008 | 1008 |
1009 if (!list->length()) | 1009 if (!list->length()) |
1010 return cssValuePool().createIdentifierValue(CSSValueNone); | 1010 return cssValuePool().createIdentifierValue(CSSValueNone); |
1011 | 1011 |
1012 return list.release(); | 1012 return list.release(); |
1013 } | 1013 } |
1014 | 1014 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 | 1213 |
1214 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1214 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1215 | 1215 |
1216 RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; | 1216 RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; |
1217 | 1217 |
1218 for (const auto& operation : style.filter().operations()) { | 1218 for (const auto& operation : style.filter().operations()) { |
1219 FilterOperation* filterOperation = operation.get(); | 1219 FilterOperation* filterOperation = operation.get(); |
1220 switch (filterOperation->type()) { | 1220 switch (filterOperation->type()) { |
1221 case FilterOperation::REFERENCE: | 1221 case FilterOperation::REFERENCE: |
1222 filterValue = CSSFunctionValue::create(CSSValueUrl); | 1222 filterValue = CSSFunctionValue::create(CSSValueUrl); |
1223 filterValue->append(cssValuePool().createValue(toReferenceFilterOper
ation(filterOperation)->url(), CSSPrimitiveValue::CSS_STRING)); | 1223 filterValue->append(cssValuePool().createValue(toReferenceFilterOper
ation(filterOperation)->url(), CSSPrimitiveValue::CSS_CUSTOM_IDENT)); |
1224 break; | 1224 break; |
1225 case FilterOperation::GRAYSCALE: | 1225 case FilterOperation::GRAYSCALE: |
1226 filterValue = CSSFunctionValue::create(CSSValueGrayscale); | 1226 filterValue = CSSFunctionValue::create(CSSValueGrayscale); |
1227 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::CSS_NUMBER)); | 1227 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::CSS_NUMBER)); |
1228 break; | 1228 break; |
1229 case FilterOperation::SEPIA: | 1229 case FilterOperation::SEPIA: |
1230 filterValue = CSSFunctionValue::create(CSSValueSepia); | 1230 filterValue = CSSFunctionValue::create(CSSValueSepia); |
1231 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::CSS_NUMBER)); | 1231 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::CSS_NUMBER)); |
1232 break; | 1232 break; |
1233 case FilterOperation::SATURATE: | 1233 case FilterOperation::SATURATE: |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, | 1648 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, |
1649 // the "height" property does not apply for non-replaced inline elem
ents. | 1649 // the "height" property does not apply for non-replaced inline elem
ents. |
1650 if (!renderer->isReplaced() && renderer->isInline()) | 1650 if (!renderer->isReplaced() && renderer->isInline()) |
1651 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1651 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1652 return zoomAdjustedPixelValue(sizingBox(renderer).height(), style); | 1652 return zoomAdjustedPixelValue(sizingBox(renderer).height(), style); |
1653 } | 1653 } |
1654 return zoomAdjustedPixelValueForLength(style.height(), style); | 1654 return zoomAdjustedPixelValueForLength(style.height(), style); |
1655 case CSSPropertyWebkitHighlight: | 1655 case CSSPropertyWebkitHighlight: |
1656 if (style.highlight() == nullAtom) | 1656 if (style.highlight() == nullAtom) |
1657 return cssValuePool().createIdentifierValue(CSSValueNone); | 1657 return cssValuePool().createIdentifierValue(CSSValueNone); |
1658 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue::
CSS_STRING); | 1658 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue::
CSS_CUSTOM_IDENT); |
1659 case CSSPropertyWebkitHyphenateCharacter: | 1659 case CSSPropertyWebkitHyphenateCharacter: |
1660 if (style.hyphenationString().isNull()) | 1660 if (style.hyphenationString().isNull()) |
1661 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1661 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1662 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv
eValue::CSS_STRING); | 1662 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv
eValue::CSS_CUSTOM_IDENT); |
1663 case CSSPropertyImageRendering: | 1663 case CSSPropertyImageRendering: |
1664 return CSSPrimitiveValue::create(style.imageRendering()); | 1664 return CSSPrimitiveValue::create(style.imageRendering()); |
1665 case CSSPropertyIsolation: | 1665 case CSSPropertyIsolation: |
1666 return cssValuePool().createValue(style.isolation()); | 1666 return cssValuePool().createValue(style.isolation()); |
1667 case CSSPropertyJustifyItems: | 1667 case CSSPropertyJustifyItems: |
1668 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItems(), styledNode), style.justifyItemsOverflowAlignment(), style.ju
stifyItemsPositionType()); | 1668 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItems(), styledNode), style.justifyItemsOverflowAlignment(), style.ju
stifyItemsPositionType()); |
1669 case CSSPropertyJustifySelf: | 1669 case CSSPropertyJustifySelf: |
1670 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifySelf(), styledNode->parentNode()), style.justifySelfOverflowAlignment
(), NonLegacyPosition); | 1670 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifySelf(), styledNode->parentNode()), style.justifySelfOverflowAlignment
(), NonLegacyPosition); |
1671 case CSSPropertyLeft: | 1671 case CSSPropertyLeft: |
1672 return valueForPositionOffset(style, CSSPropertyLeft, renderer); | 1672 return valueForPositionOffset(style, CSSPropertyLeft, renderer); |
(...skipping 11 matching lines...) Expand all Loading... |
1684 if (style.listStyleImage()) | 1684 if (style.listStyleImage()) |
1685 return style.listStyleImage()->cssValue(); | 1685 return style.listStyleImage()->cssValue(); |
1686 return cssValuePool().createIdentifierValue(CSSValueNone); | 1686 return cssValuePool().createIdentifierValue(CSSValueNone); |
1687 case CSSPropertyListStylePosition: | 1687 case CSSPropertyListStylePosition: |
1688 return cssValuePool().createValue(style.listStylePosition()); | 1688 return cssValuePool().createValue(style.listStylePosition()); |
1689 case CSSPropertyListStyleType: | 1689 case CSSPropertyListStyleType: |
1690 return cssValuePool().createValue(style.listStyleType()); | 1690 return cssValuePool().createValue(style.listStyleType()); |
1691 case CSSPropertyWebkitLocale: | 1691 case CSSPropertyWebkitLocale: |
1692 if (style.locale().isNull()) | 1692 if (style.locale().isNull()) |
1693 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1693 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1694 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::CSS
_STRING); | 1694 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::CSS
_CUSTOM_IDENT); |
1695 case CSSPropertyMarginTop: { | 1695 case CSSPropertyMarginTop: { |
1696 Length marginTop = style.marginTop(); | 1696 Length marginTop = style.marginTop(); |
1697 if (marginTop.isFixed() || !renderer || !renderer->isBox()) | 1697 if (marginTop.isFixed() || !renderer || !renderer->isBox()) |
1698 return zoomAdjustedPixelValueForLength(marginTop, style); | 1698 return zoomAdjustedPixelValueForLength(marginTop, style); |
1699 return zoomAdjustedPixelValue(toLayoutBox(renderer)->marginTop(), style)
; | 1699 return zoomAdjustedPixelValue(toLayoutBox(renderer)->marginTop(), style)
; |
1700 } | 1700 } |
1701 case CSSPropertyMarginRight: { | 1701 case CSSPropertyMarginRight: { |
1702 Length marginRight = style.marginRight(); | 1702 Length marginRight = style.marginRight(); |
1703 if (marginRight.isFixed() || !renderer || !renderer->isBox()) | 1703 if (marginRight.isFixed() || !renderer || !renderer->isBox()) |
1704 return zoomAdjustedPixelValueForLength(marginRight, style); | 1704 return zoomAdjustedPixelValueForLength(marginRight, style); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 return currentColorOrValidColor(style, style.textFillColor()); | 1852 return currentColorOrValidColor(style, style.textFillColor()); |
1853 case CSSPropertyWebkitTextEmphasisColor: | 1853 case CSSPropertyWebkitTextEmphasisColor: |
1854 return currentColorOrValidColor(style, style.textEmphasisColor()); | 1854 return currentColorOrValidColor(style, style.textEmphasisColor()); |
1855 case CSSPropertyWebkitTextEmphasisPosition: | 1855 case CSSPropertyWebkitTextEmphasisPosition: |
1856 return cssValuePool().createValue(style.textEmphasisPosition()); | 1856 return cssValuePool().createValue(style.textEmphasisPosition()); |
1857 case CSSPropertyWebkitTextEmphasisStyle: | 1857 case CSSPropertyWebkitTextEmphasisStyle: |
1858 switch (style.textEmphasisMark()) { | 1858 switch (style.textEmphasisMark()) { |
1859 case TextEmphasisMarkNone: | 1859 case TextEmphasisMarkNone: |
1860 return cssValuePool().createIdentifierValue(CSSValueNone); | 1860 return cssValuePool().createIdentifierValue(CSSValueNone); |
1861 case TextEmphasisMarkCustom: | 1861 case TextEmphasisMarkCustom: |
1862 return cssValuePool().createValue(style.textEmphasisCustomMark(), CS
SPrimitiveValue::CSS_STRING); | 1862 return cssValuePool().createValue(style.textEmphasisCustomMark(), CS
SPrimitiveValue::CSS_CUSTOM_IDENT); |
1863 case TextEmphasisMarkAuto: | 1863 case TextEmphasisMarkAuto: |
1864 ASSERT_NOT_REACHED(); | 1864 ASSERT_NOT_REACHED(); |
1865 // Fall through | 1865 // Fall through |
1866 case TextEmphasisMarkDot: | 1866 case TextEmphasisMarkDot: |
1867 case TextEmphasisMarkCircle: | 1867 case TextEmphasisMarkCircle: |
1868 case TextEmphasisMarkDoubleCircle: | 1868 case TextEmphasisMarkDoubleCircle: |
1869 case TextEmphasisMarkTriangle: | 1869 case TextEmphasisMarkTriangle: |
1870 case TextEmphasisMarkSesame: { | 1870 case TextEmphasisMarkSesame: { |
1871 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); | 1871 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); |
1872 list->append(cssValuePool().createValue(style.textEmphasisFill())); | 1872 list->append(cssValuePool().createValue(style.textEmphasisFill())); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 } | 2048 } |
2049 return list.release(); | 2049 return list.release(); |
2050 } | 2050 } |
2051 case CSSPropertyAnimationName: | 2051 case CSSPropertyAnimationName: |
2052 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | 2052 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); |
2053 case CSSPropertyWebkitAnimationName: { | 2053 case CSSPropertyWebkitAnimationName: { |
2054 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2054 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
2055 const CSSAnimationData* animationData = style.animations(); | 2055 const CSSAnimationData* animationData = style.animations(); |
2056 if (animationData) { | 2056 if (animationData) { |
2057 for (size_t i = 0; i < animationData->nameList().size(); ++i) | 2057 for (size_t i = 0; i < animationData->nameList().size(); ++i) |
2058 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::CSS_STRING)); | 2058 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::CSS_CUSTOM_IDENT)); |
2059 } else { | 2059 } else { |
2060 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2060 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
2061 } | 2061 } |
2062 return list.release(); | 2062 return list.release(); |
2063 } | 2063 } |
2064 case CSSPropertyAnimationPlayState: | 2064 case CSSPropertyAnimationPlayState: |
2065 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | 2065 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); |
2066 case CSSPropertyWebkitAnimationPlayState: { | 2066 case CSSPropertyWebkitAnimationPlayState: { |
2067 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2067 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
2068 const CSSAnimationData* animationData = style.animations(); | 2068 const CSSAnimationData* animationData = style.animations(); |
2069 if (animationData) { | 2069 if (animationData) { |
2070 for (size_t i = 0; i < animationData->playStateList().size(); ++i) | 2070 for (size_t i = 0; i < animationData->playStateList().size(); ++i) |
2071 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); | 2071 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); |
2072 } else { | 2072 } else { |
2073 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2073 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
2074 } | 2074 } |
2075 return list.release(); | 2075 return list.release(); |
2076 } | 2076 } |
2077 case CSSPropertyAnimationTimingFunction: | 2077 case CSSPropertyAnimationTimingFunction: |
2078 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | 2078 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); |
2079 case CSSPropertyWebkitAnimationTimingFunction: | 2079 case CSSPropertyWebkitAnimationTimingFunction: |
2080 return valueForAnimationTimingFunction(style.animations()); | 2080 return valueForAnimationTimingFunction(style.animations()); |
2081 case CSSPropertyAnimation: | 2081 case CSSPropertyAnimation: |
2082 case CSSPropertyWebkitAnimation: { | 2082 case CSSPropertyWebkitAnimation: { |
2083 const CSSAnimationData* animationData = style.animations(); | 2083 const CSSAnimationData* animationData = style.animations(); |
2084 if (animationData) { | 2084 if (animationData) { |
2085 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea
teCommaSeparated(); | 2085 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea
teCommaSeparated(); |
2086 for (size_t i = 0; i < animationData->nameList().size(); ++i) { | 2086 for (size_t i = 0; i < animationData->nameList().size(); ++i) { |
2087 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); | 2087 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); |
2088 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::CSS_STRING)); | 2088 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::CSS_CUSTOM_IDENT)); |
2089 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::CSS_S)); | 2089 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::CSS_S)); |
2090 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); | 2090 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); |
2091 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::CSS_S)); | 2091 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::CSS_S)); |
2092 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); | 2092 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); |
2093 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); | 2093 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); |
2094 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); | 2094 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); |
2095 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); | 2095 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); |
2096 animationsList->append(list); | 2096 animationsList->append(list); |
2097 } | 2097 } |
2098 return animationsList.release(); | 2098 return animationsList.release(); |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); | 2566 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); |
2567 | 2567 |
2568 case CSSPropertyAll: | 2568 case CSSPropertyAll: |
2569 return nullptr; | 2569 return nullptr; |
2570 } | 2570 } |
2571 ASSERT_NOT_REACHED(); | 2571 ASSERT_NOT_REACHED(); |
2572 return nullptr; | 2572 return nullptr; |
2573 } | 2573 } |
2574 | 2574 |
2575 } | 2575 } |
OLD | NEW |