Chromium Code Reviews| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1212 return cssValuePool().createIdentifierValue(CSSValueNone); | 1212 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 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); |
|
Timothy Loh
2015/03/04 23:21:45
Maybe we should just make this use a CSS_URI here.
| |
| 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1652 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr operty, | 1652 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr operty, |
| 1653 // the "height" property does not apply for non-replaced inline elem ents. | 1653 // the "height" property does not apply for non-replaced inline elem ents. |
| 1654 if (!renderer->isReplaced() && renderer->isInline()) | 1654 if (!renderer->isReplaced() && renderer->isInline()) |
| 1655 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1655 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1656 return zoomAdjustedPixelValue(sizingBox(renderer).height(), style); | 1656 return zoomAdjustedPixelValue(sizingBox(renderer).height(), style); |
| 1657 } | 1657 } |
| 1658 return zoomAdjustedPixelValueForLength(style.height(), style); | 1658 return zoomAdjustedPixelValueForLength(style.height(), style); |
| 1659 case CSSPropertyWebkitHighlight: | 1659 case CSSPropertyWebkitHighlight: |
| 1660 if (style.highlight() == nullAtom) | 1660 if (style.highlight() == nullAtom) |
| 1661 return cssValuePool().createIdentifierValue(CSSValueNone); | 1661 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1662 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue:: CSS_STRING); | 1662 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue:: CSS_CUSTOM_IDENT); |
|
Timothy Loh
2015/03/04 23:21:45
string
| |
| 1663 case CSSPropertyWebkitHyphenateCharacter: | 1663 case CSSPropertyWebkitHyphenateCharacter: |
| 1664 if (style.hyphenationString().isNull()) | 1664 if (style.hyphenationString().isNull()) |
| 1665 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1665 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1666 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv eValue::CSS_STRING); | 1666 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv eValue::CSS_CUSTOM_IDENT); |
|
Timothy Loh
2015/03/04 23:21:45
string
| |
| 1667 case CSSPropertyImageRendering: | 1667 case CSSPropertyImageRendering: |
| 1668 return CSSPrimitiveValue::create(style.imageRendering()); | 1668 return CSSPrimitiveValue::create(style.imageRendering()); |
| 1669 case CSSPropertyIsolation: | 1669 case CSSPropertyIsolation: |
| 1670 return cssValuePool().createValue(style.isolation()); | 1670 return cssValuePool().createValue(style.isolation()); |
| 1671 case CSSPropertyJustifyItems: | 1671 case CSSPropertyJustifyItems: |
| 1672 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifyItems(), styledNode), style.justifyItemsOverflowAlignment(), style.ju stifyItemsPositionType()); | 1672 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifyItems(), styledNode), style.justifyItemsOverflowAlignment(), style.ju stifyItemsPositionType()); |
| 1673 case CSSPropertyJustifySelf: | 1673 case CSSPropertyJustifySelf: |
| 1674 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifySelf(), styledNode->parentNode()), style.justifySelfOverflowAlignment (), NonLegacyPosition); | 1674 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st yle.justifySelf(), styledNode->parentNode()), style.justifySelfOverflowAlignment (), NonLegacyPosition); |
| 1675 case CSSPropertyLeft: | 1675 case CSSPropertyLeft: |
| 1676 return valueForPositionOffset(style, CSSPropertyLeft, renderer); | 1676 return valueForPositionOffset(style, CSSPropertyLeft, renderer); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1688 if (style.listStyleImage()) | 1688 if (style.listStyleImage()) |
| 1689 return style.listStyleImage()->cssValue(); | 1689 return style.listStyleImage()->cssValue(); |
| 1690 return cssValuePool().createIdentifierValue(CSSValueNone); | 1690 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1691 case CSSPropertyListStylePosition: | 1691 case CSSPropertyListStylePosition: |
| 1692 return cssValuePool().createValue(style.listStylePosition()); | 1692 return cssValuePool().createValue(style.listStylePosition()); |
| 1693 case CSSPropertyListStyleType: | 1693 case CSSPropertyListStyleType: |
| 1694 return cssValuePool().createValue(style.listStyleType()); | 1694 return cssValuePool().createValue(style.listStyleType()); |
| 1695 case CSSPropertyWebkitLocale: | 1695 case CSSPropertyWebkitLocale: |
| 1696 if (style.locale().isNull()) | 1696 if (style.locale().isNull()) |
| 1697 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1697 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1698 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::CSS _STRING); | 1698 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::CSS _CUSTOM_IDENT); |
|
Timothy Loh
2015/03/04 23:21:45
string
| |
| 1699 case CSSPropertyMarginTop: { | 1699 case CSSPropertyMarginTop: { |
| 1700 Length marginTop = style.marginTop(); | 1700 Length marginTop = style.marginTop(); |
| 1701 if (marginTop.isFixed() || !renderer || !renderer->isBox()) | 1701 if (marginTop.isFixed() || !renderer || !renderer->isBox()) |
| 1702 return zoomAdjustedPixelValueForLength(marginTop, style); | 1702 return zoomAdjustedPixelValueForLength(marginTop, style); |
| 1703 return zoomAdjustedPixelValue(toLayoutBox(renderer)->marginTop(), style) ; | 1703 return zoomAdjustedPixelValue(toLayoutBox(renderer)->marginTop(), style) ; |
| 1704 } | 1704 } |
| 1705 case CSSPropertyMarginRight: { | 1705 case CSSPropertyMarginRight: { |
| 1706 Length marginRight = style.marginRight(); | 1706 Length marginRight = style.marginRight(); |
| 1707 if (marginRight.isFixed() || !renderer || !renderer->isBox()) | 1707 if (marginRight.isFixed() || !renderer || !renderer->isBox()) |
| 1708 return zoomAdjustedPixelValueForLength(marginRight, style); | 1708 return zoomAdjustedPixelValueForLength(marginRight, style); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1856 return currentColorOrValidColor(style, style.textFillColor()); | 1856 return currentColorOrValidColor(style, style.textFillColor()); |
| 1857 case CSSPropertyWebkitTextEmphasisColor: | 1857 case CSSPropertyWebkitTextEmphasisColor: |
| 1858 return currentColorOrValidColor(style, style.textEmphasisColor()); | 1858 return currentColorOrValidColor(style, style.textEmphasisColor()); |
| 1859 case CSSPropertyWebkitTextEmphasisPosition: | 1859 case CSSPropertyWebkitTextEmphasisPosition: |
| 1860 return cssValuePool().createValue(style.textEmphasisPosition()); | 1860 return cssValuePool().createValue(style.textEmphasisPosition()); |
| 1861 case CSSPropertyWebkitTextEmphasisStyle: | 1861 case CSSPropertyWebkitTextEmphasisStyle: |
| 1862 switch (style.textEmphasisMark()) { | 1862 switch (style.textEmphasisMark()) { |
| 1863 case TextEmphasisMarkNone: | 1863 case TextEmphasisMarkNone: |
| 1864 return cssValuePool().createIdentifierValue(CSSValueNone); | 1864 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1865 case TextEmphasisMarkCustom: | 1865 case TextEmphasisMarkCustom: |
| 1866 return cssValuePool().createValue(style.textEmphasisCustomMark(), CS SPrimitiveValue::CSS_STRING); | 1866 return cssValuePool().createValue(style.textEmphasisCustomMark(), CS SPrimitiveValue::CSS_CUSTOM_IDENT); |
|
Timothy Loh
2015/03/04 23:21:45
string I think?
| |
| 1867 case TextEmphasisMarkAuto: | 1867 case TextEmphasisMarkAuto: |
| 1868 ASSERT_NOT_REACHED(); | 1868 ASSERT_NOT_REACHED(); |
| 1869 // Fall through | 1869 // Fall through |
| 1870 case TextEmphasisMarkDot: | 1870 case TextEmphasisMarkDot: |
| 1871 case TextEmphasisMarkCircle: | 1871 case TextEmphasisMarkCircle: |
| 1872 case TextEmphasisMarkDoubleCircle: | 1872 case TextEmphasisMarkDoubleCircle: |
| 1873 case TextEmphasisMarkTriangle: | 1873 case TextEmphasisMarkTriangle: |
| 1874 case TextEmphasisMarkSesame: { | 1874 case TextEmphasisMarkSesame: { |
| 1875 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep arated(); | 1875 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep arated(); |
| 1876 list->append(cssValuePool().createValue(style.textEmphasisFill())); | 1876 list->append(cssValuePool().createValue(style.textEmphasisFill())); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2052 } | 2052 } |
| 2053 return list.release(); | 2053 return list.release(); |
| 2054 } | 2054 } |
| 2055 case CSSPropertyAnimationName: | 2055 case CSSPropertyAnimationName: |
| 2056 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | 2056 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); |
| 2057 case CSSPropertyWebkitAnimationName: { | 2057 case CSSPropertyWebkitAnimationName: { |
| 2058 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat ed(); | 2058 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat ed(); |
| 2059 const CSSAnimationData* animationData = style.animations(); | 2059 const CSSAnimationData* animationData = style.animations(); |
| 2060 if (animationData) { | 2060 if (animationData) { |
| 2061 for (size_t i = 0; i < animationData->nameList().size(); ++i) | 2061 for (size_t i = 0; i < animationData->nameList().size(); ++i) |
| 2062 list->append(cssValuePool().createValue(animationData->nameList( )[i], CSSPrimitiveValue::CSS_STRING)); | 2062 list->append(cssValuePool().createValue(animationData->nameList( )[i], CSSPrimitiveValue::CSS_CUSTOM_IDENT)); |
| 2063 } else { | 2063 } else { |
| 2064 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2064 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
| 2065 } | 2065 } |
| 2066 return list.release(); | 2066 return list.release(); |
| 2067 } | 2067 } |
| 2068 case CSSPropertyAnimationPlayState: | 2068 case CSSPropertyAnimationPlayState: |
| 2069 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | 2069 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); |
| 2070 case CSSPropertyWebkitAnimationPlayState: { | 2070 case CSSPropertyWebkitAnimationPlayState: { |
| 2071 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat ed(); | 2071 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat ed(); |
| 2072 const CSSAnimationData* animationData = style.animations(); | 2072 const CSSAnimationData* animationData = style.animations(); |
| 2073 if (animationData) { | 2073 if (animationData) { |
| 2074 for (size_t i = 0; i < animationData->playStateList().size(); ++i) | 2074 for (size_t i = 0; i < animationData->playStateList().size(); ++i) |
| 2075 list->append(valueForAnimationPlayState(animationData->playState List()[i])); | 2075 list->append(valueForAnimationPlayState(animationData->playState List()[i])); |
| 2076 } else { | 2076 } else { |
| 2077 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2077 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
| 2078 } | 2078 } |
| 2079 return list.release(); | 2079 return list.release(); |
| 2080 } | 2080 } |
| 2081 case CSSPropertyAnimationTimingFunction: | 2081 case CSSPropertyAnimationTimingFunction: |
| 2082 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); | 2082 ASSERT(RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()); |
| 2083 case CSSPropertyWebkitAnimationTimingFunction: | 2083 case CSSPropertyWebkitAnimationTimingFunction: |
| 2084 return valueForAnimationTimingFunction(style.animations()); | 2084 return valueForAnimationTimingFunction(style.animations()); |
| 2085 case CSSPropertyAnimation: | 2085 case CSSPropertyAnimation: |
| 2086 case CSSPropertyWebkitAnimation: { | 2086 case CSSPropertyWebkitAnimation: { |
| 2087 const CSSAnimationData* animationData = style.animations(); | 2087 const CSSAnimationData* animationData = style.animations(); |
| 2088 if (animationData) { | 2088 if (animationData) { |
| 2089 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea teCommaSeparated(); | 2089 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea teCommaSeparated(); |
| 2090 for (size_t i = 0; i < animationData->nameList().size(); ++i) { | 2090 for (size_t i = 0; i < animationData->nameList().size(); ++i) { |
| 2091 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac eSeparated(); | 2091 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac eSeparated(); |
| 2092 list->append(cssValuePool().createValue(animationData->nameList( )[i], CSSPrimitiveValue::CSS_STRING)); | 2092 list->append(cssValuePool().createValue(animationData->nameList( )[i], CSSPrimitiveValue::CSS_CUSTOM_IDENT)); |
| 2093 list->append(cssValuePool().createValue(CSSTimingData::getRepeat ed(animationData->durationList(), i), CSSPrimitiveValue::CSS_S)); | 2093 list->append(cssValuePool().createValue(CSSTimingData::getRepeat ed(animationData->durationList(), i), CSSPrimitiveValue::CSS_S)); |
| 2094 list->append(createTimingFunctionValue(CSSTimingData::getRepeate d(animationData->timingFunctionList(), i).get())); | 2094 list->append(createTimingFunctionValue(CSSTimingData::getRepeate d(animationData->timingFunctionList(), i).get())); |
| 2095 list->append(cssValuePool().createValue(CSSTimingData::getRepeat ed(animationData->delayList(), i), CSSPrimitiveValue::CSS_S)); | 2095 list->append(cssValuePool().createValue(CSSTimingData::getRepeat ed(animationData->delayList(), i), CSSPrimitiveValue::CSS_S)); |
| 2096 list->append(valueForAnimationIterationCount(CSSTimingData::getR epeated(animationData->iterationCountList(), i))); | 2096 list->append(valueForAnimationIterationCount(CSSTimingData::getR epeated(animationData->iterationCountList(), i))); |
| 2097 list->append(valueForAnimationDirection(CSSTimingData::getRepeat ed(animationData->directionList(), i))); | 2097 list->append(valueForAnimationDirection(CSSTimingData::getRepeat ed(animationData->directionList(), i))); |
| 2098 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate d(animationData->fillModeList(), i))); | 2098 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate d(animationData->fillModeList(), i))); |
| 2099 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat ed(animationData->playStateList(), i))); | 2099 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat ed(animationData->playStateList(), i))); |
| 2100 animationsList->append(list); | 2100 animationsList->append(list); |
| 2101 } | 2101 } |
| 2102 return animationsList.release(); | 2102 return animationsList.release(); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2570 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); | 2570 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); |
| 2571 | 2571 |
| 2572 case CSSPropertyAll: | 2572 case CSSPropertyAll: |
| 2573 return nullptr; | 2573 return nullptr; |
| 2574 } | 2574 } |
| 2575 ASSERT_NOT_REACHED(); | 2575 ASSERT_NOT_REACHED(); |
| 2576 return nullptr; | 2576 return nullptr; |
| 2577 } | 2577 } |
| 2578 | 2578 |
| 2579 } | 2579 } |
| OLD | NEW |