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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #include "config.h" | 25 #include "config.h" |
26 #include "core/css/ComputedStyleCSSValueMapping.h" | 26 #include "core/css/ComputedStyleCSSValueMapping.h" |
27 | 27 |
28 #include "core/StylePropertyShorthand.h" | 28 #include "core/StylePropertyShorthand.h" |
29 #include "core/css/BasicShapeFunctions.h" | 29 #include "core/css/BasicShapeFunctions.h" |
30 #include "core/css/CSSBasicShapeValues.h" | 30 #include "core/css/CSSBasicShapeValues.h" |
31 #include "core/css/CSSBorderImage.h" | 31 #include "core/css/CSSBorderImage.h" |
32 #include "core/css/CSSBorderImageSliceValue.h" | 32 #include "core/css/CSSBorderImageSliceValue.h" |
33 #include "core/css/CSSCounterValue.h" | 33 #include "core/css/CSSCounterValue.h" |
| 34 #include "core/css/CSSCustomIdentValue.h" |
34 #include "core/css/CSSFontFeatureValue.h" | 35 #include "core/css/CSSFontFeatureValue.h" |
35 #include "core/css/CSSFunctionValue.h" | 36 #include "core/css/CSSFunctionValue.h" |
36 #include "core/css/CSSGridLineNamesValue.h" | 37 #include "core/css/CSSGridLineNamesValue.h" |
37 #include "core/css/CSSGridTemplateAreasValue.h" | 38 #include "core/css/CSSGridTemplateAreasValue.h" |
38 #include "core/css/CSSPathValue.h" | 39 #include "core/css/CSSPathValue.h" |
39 #include "core/css/CSSPrimitiveValueMappings.h" | 40 #include "core/css/CSSPrimitiveValueMappings.h" |
40 #include "core/css/CSSQuadValue.h" | 41 #include "core/css/CSSQuadValue.h" |
41 #include "core/css/CSSReflectValue.h" | 42 #include "core/css/CSSReflectValue.h" |
42 #include "core/css/CSSShadowValue.h" | 43 #include "core/css/CSSShadowValue.h" |
| 44 #include "core/css/CSSStringValue.h" |
43 #include "core/css/CSSTimingFunctionValue.h" | 45 #include "core/css/CSSTimingFunctionValue.h" |
| 46 #include "core/css/CSSURIValue.h" |
44 #include "core/css/CSSValueList.h" | 47 #include "core/css/CSSValueList.h" |
45 #include "core/css/CSSValuePair.h" | 48 #include "core/css/CSSValuePair.h" |
46 #include "core/css/CSSValuePool.h" | 49 #include "core/css/CSSValuePool.h" |
47 #include "core/layout/LayoutBlock.h" | 50 #include "core/layout/LayoutBlock.h" |
48 #include "core/layout/LayoutBox.h" | 51 #include "core/layout/LayoutBox.h" |
49 #include "core/layout/LayoutGrid.h" | 52 #include "core/layout/LayoutGrid.h" |
50 #include "core/layout/LayoutObject.h" | 53 #include "core/layout/LayoutObject.h" |
51 #include "core/style/ComputedStyle.h" | 54 #include "core/style/ComputedStyle.h" |
52 #include "core/style/ContentData.h" | 55 #include "core/style/ContentData.h" |
53 #include "core/style/PathStyleMotionPath.h" | 56 #include "core/style/PathStyleMotionPath.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 return CSSValueMonospace; | 508 return CSSValueMonospace; |
506 if (family == FontFamilyNames::webkit_pictograph) | 509 if (family == FontFamilyNames::webkit_pictograph) |
507 return CSSValueWebkitPictograph; | 510 return CSSValueWebkitPictograph; |
508 if (family == FontFamilyNames::webkit_sans_serif) | 511 if (family == FontFamilyNames::webkit_sans_serif) |
509 return CSSValueSansSerif; | 512 return CSSValueSansSerif; |
510 if (family == FontFamilyNames::webkit_serif) | 513 if (family == FontFamilyNames::webkit_serif) |
511 return CSSValueSerif; | 514 return CSSValueSerif; |
512 return CSSValueInvalid; | 515 return CSSValueInvalid; |
513 } | 516 } |
514 | 517 |
515 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFamily(const AtomicStri
ng& family) | 518 static PassRefPtrWillBeRawPtr<CSSValue> valueForFamily(const AtomicString& famil
y) |
516 { | 519 { |
517 if (CSSValueID familyIdentifier = identifierForFamily(family)) | 520 if (CSSValueID familyIdentifier = identifierForFamily(family)) |
518 return cssValuePool().createIdentifierValue(familyIdentifier); | 521 return cssValuePool().createIdentifierValue(familyIdentifier); |
519 return cssValuePool().createValue(family.string(), CSSPrimitiveValue::UnitTy
pe::CustomIdentifier); | 522 return CSSCustomIdentValue::create(family.string()); |
520 } | 523 } |
521 | 524 |
522 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const ComputedSty
le& style) | 525 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const ComputedSty
le& style) |
523 { | 526 { |
524 const FontFamily& firstFamily = style.fontDescription().family(); | 527 const FontFamily& firstFamily = style.fontDescription().family(); |
525 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 528 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
526 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) | 529 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) |
527 list->append(valueForFamily(family->family())); | 530 list->append(valueForFamily(family->family())); |
528 return list.release(); | 531 return list.release(); |
529 } | 532 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 } | 583 } |
581 | 584 |
582 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) | 585 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) |
583 { | 586 { |
584 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); | 587 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); |
585 if (namedGridLines.isEmpty()) | 588 if (namedGridLines.isEmpty()) |
586 return; | 589 return; |
587 | 590 |
588 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); | 591 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); |
589 for (size_t j = 0; j < namedGridLines.size(); ++j) | 592 for (size_t j = 0; j < namedGridLines.size(); ++j) |
590 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi
tiveValue::UnitType::CustomIdentifier)); | 593 lineNames->append(CSSCustomIdentValue::create(namedGridLines[j])); |
591 list.append(lineNames.release()); | 594 list.append(lineNames.release()); |
592 } | 595 } |
593 | 596 |
594 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* layoutObject, const ComputedStyle& style) | 597 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* layoutObject, const ComputedStyle& style) |
595 { | 598 { |
596 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); | 599 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); |
597 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); | 600 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); |
598 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); | 601 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); |
599 | 602 |
600 // Handle the 'none' case. | 603 // Handle the 'none' case. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); | 638 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); |
636 return list.release(); | 639 return list.release(); |
637 } | 640 } |
638 | 641 |
639 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition&
position) | 642 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition&
position) |
640 { | 643 { |
641 if (position.isAuto()) | 644 if (position.isAuto()) |
642 return cssValuePool().createIdentifierValue(CSSValueAuto); | 645 return cssValuePool().createIdentifierValue(CSSValueAuto); |
643 | 646 |
644 if (position.isNamedGridArea()) | 647 if (position.isNamedGridArea()) |
645 return cssValuePool().createValue(position.namedGridLine(), CSSPrimitive
Value::UnitType::CustomIdentifier); | 648 return CSSCustomIdentValue::create(position.namedGridLine()); |
646 | 649 |
647 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 650 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
648 if (position.isSpan()) { | 651 if (position.isSpan()) { |
649 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); | 652 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); |
650 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); | 653 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); |
651 } else { | 654 } else { |
652 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); | 655 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); |
653 } | 656 } |
654 | 657 |
655 if (!position.namedGridLine().isNull()) | 658 if (!position.namedGridLine().isNull()) |
656 list->append(cssValuePool().createValue(position.namedGridLine(), CSSPri
mitiveValue::UnitType::CustomIdentifier)); | 659 list->append(CSSCustomIdentValue::create(position.namedGridLine())); |
657 return list; | 660 return list; |
658 } | 661 } |
659 | 662 |
660 static LayoutRect sizingBox(const LayoutObject* layoutObject) | 663 static LayoutRect sizingBox(const LayoutObject* layoutObject) |
661 { | 664 { |
662 if (!layoutObject->isBox()) | 665 if (!layoutObject->isBox()) |
663 return LayoutRect(); | 666 return LayoutRect(); |
664 | 667 |
665 const LayoutBox* box = toLayoutBox(layoutObject); | 668 const LayoutBox* box = toLayoutBox(layoutObject); |
666 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); | 669 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 list->append(valueForMatrixTransform(transform, style)); | 959 list->append(valueForMatrixTransform(transform, style)); |
957 | 960 |
958 return list.release(); | 961 return list.release(); |
959 } | 962 } |
960 | 963 |
961 static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSST
ransitionData::TransitionProperty& property) | 964 static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSST
ransitionData::TransitionProperty& property) |
962 { | 965 { |
963 if (property.propertyType == CSSTransitionData::TransitionNone) | 966 if (property.propertyType == CSSTransitionData::TransitionNone) |
964 return cssValuePool().createIdentifierValue(CSSValueNone); | 967 return cssValuePool().createIdentifierValue(CSSValueNone); |
965 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) | 968 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) |
966 return cssValuePool().createValue(property.propertyString, CSSPrimitiveV
alue::UnitType::CustomIdentifier); | 969 return CSSCustomIdentValue::create(property.propertyString); |
967 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); | 970 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); |
968 return cssValuePool().createValue(getPropertyNameString(property.unresolvedP
roperty), CSSPrimitiveValue::UnitType::CustomIdentifier); | 971 return CSSCustomIdentValue::create(getPropertyNameString(property.unresolved
Property)); |
969 } | 972 } |
970 | 973 |
971 static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTran
sitionData* transitionData) | 974 static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTran
sitionData* transitionData) |
972 { | 975 { |
973 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 976 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
974 if (transitionData) { | 977 if (transitionData) { |
975 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 978 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
976 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); | 979 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); |
977 } else { | 980 } else { |
978 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); | 981 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); |
(...skipping 17 matching lines...) Expand all Loading... |
996 return CSSValueInvalid; | 999 return CSSValueInvalid; |
997 } | 1000 } |
998 | 1001 |
999 static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
style) | 1002 static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
style) |
1000 { | 1003 { |
1001 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1004 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1002 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { | 1005 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { |
1003 if (contentData->isCounter()) { | 1006 if (contentData->isCounter()) { |
1004 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); | 1007 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); |
1005 ASSERT(counter); | 1008 ASSERT(counter); |
1006 RefPtrWillBeRawPtr<CSSPrimitiveValue> identifier = cssValuePool().cr
eateValue(counter->identifier(), CSSPrimitiveValue::UnitType::CustomIdentifier); | 1009 RefPtrWillBeRawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentV
alue::create(counter->identifier()); |
1007 RefPtrWillBeRawPtr<CSSPrimitiveValue> separator = cssValuePool().cre
ateValue(counter->separator(), CSSPrimitiveValue::UnitType::CustomIdentifier); | 1010 RefPtrWillBeRawPtr<CSSCustomIdentValue> separator = CSSCustomIdentVa
lue::create(counter->separator()); |
1008 CSSValueID listStyleIdent = CSSValueNone; | 1011 CSSValueID listStyleIdent = CSSValueNone; |
1009 if (counter->listStyle() != NoneListStyle) | 1012 if (counter->listStyle() != NoneListStyle) |
1010 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); | 1013 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); |
1011 RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().cre
ateIdentifierValue(listStyleIdent); | 1014 RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().cre
ateIdentifierValue(listStyleIdent); |
1012 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); | 1015 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); |
1013 } else if (contentData->isImage()) { | 1016 } else if (contentData->isImage()) { |
1014 const StyleImage* image = toImageContentData(contentData)->image(); | 1017 const StyleImage* image = toImageContentData(contentData)->image(); |
1015 ASSERT(image); | 1018 ASSERT(image); |
1016 list->append(image->computedCSSValue()); | 1019 list->append(image->computedCSSValue()); |
1017 } else if (contentData->isText()) { | 1020 } else if (contentData->isText()) { |
1018 list->append(cssValuePool().createValue(toTextContentData(contentDat
a)->text(), CSSPrimitiveValue::UnitType::String)); | 1021 list->append(CSSStringValue::create(toTextContentData(contentData)->
text())); |
1019 } else if (contentData->isQuote()) { | 1022 } else if (contentData->isQuote()) { |
1020 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; | 1023 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; |
1021 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); | 1024 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); |
1022 } else { | 1025 } else { |
1023 ASSERT_NOT_REACHED(); | 1026 ASSERT_NOT_REACHED(); |
1024 } | 1027 } |
1025 } | 1028 } |
1026 return list.release(); | 1029 return list.release(); |
1027 } | 1030 } |
1028 | 1031 |
1029 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const Computed
Style& style, CSSPropertyID propertyID) | 1032 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const Computed
Style& style, CSSPropertyID propertyID) |
1030 { | 1033 { |
1031 const CounterDirectiveMap* map = style.counterDirectives(); | 1034 const CounterDirectiveMap* map = style.counterDirectives(); |
1032 if (!map) | 1035 if (!map) |
1033 return cssValuePool().createIdentifierValue(CSSValueNone); | 1036 return cssValuePool().createIdentifierValue(CSSValueNone); |
1034 | 1037 |
1035 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1038 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1036 for (const auto& item : *map) { | 1039 for (const auto& item : *map) { |
1037 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); | 1040 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); |
1038 if (!isValidCounterValue) | 1041 if (!isValidCounterValue) |
1039 continue; | 1042 continue; |
1040 | 1043 |
1041 list->append(cssValuePool().createValue(item.key, CSSPrimitiveValue::Uni
tType::CustomIdentifier)); | 1044 list->append(CSSCustomIdentValue::create(item.key)); |
1042 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); | 1045 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); |
1043 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Number)); | 1046 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Number)); |
1044 } | 1047 } |
1045 | 1048 |
1046 if (!list->length()) | 1049 if (!list->length()) |
1047 return cssValuePool().createIdentifierValue(CSSValueNone); | 1050 return cssValuePool().createIdentifierValue(CSSValueNone); |
1048 | 1051 |
1049 return list.release(); | 1052 return list.release(); |
1050 } | 1053 } |
1051 | 1054 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 } | 1190 } |
1188 } | 1191 } |
1189 | 1192 |
1190 return list.release(); | 1193 return list.release(); |
1191 } | 1194 } |
1192 | 1195 |
1193 static PassRefPtrWillBeRawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintTy
pe paintType, const String& url, const Color& color, const Color& currentColor) | 1196 static PassRefPtrWillBeRawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintTy
pe paintType, const String& url, const Color& color, const Color& currentColor) |
1194 { | 1197 { |
1195 if (paintType >= SVG_PAINTTYPE_URI_NONE) { | 1198 if (paintType >= SVG_PAINTTYPE_URI_NONE) { |
1196 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSepar
ated(); | 1199 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSepar
ated(); |
1197 values->append(CSSPrimitiveValue::create(url, CSSPrimitiveValue::UnitTyp
e::URI)); | 1200 values->append(CSSURIValue::create(url)); |
1198 if (paintType == SVG_PAINTTYPE_URI_NONE) | 1201 if (paintType == SVG_PAINTTYPE_URI_NONE) |
1199 values->append(CSSPrimitiveValue::create(CSSValueNone)); | 1202 values->append(CSSPrimitiveValue::create(CSSValueNone)); |
1200 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) | 1203 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) |
1201 values->append(CSSPrimitiveValue::createColor(currentColor.rgb())); | 1204 values->append(CSSPrimitiveValue::createColor(currentColor.rgb())); |
1202 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) | 1205 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) |
1203 values->append(CSSPrimitiveValue::createColor(color.rgb())); | 1206 values->append(CSSPrimitiveValue::createColor(color.rgb())); |
1204 return values.release(); | 1207 return values.release(); |
1205 } | 1208 } |
1206 if (paintType == SVG_PAINTTYPE_NONE) | 1209 if (paintType == SVG_PAINTTYPE_NONE) |
1207 return CSSPrimitiveValue::create(CSSValueNone); | 1210 return CSSPrimitiveValue::create(CSSValueNone); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 | 1249 |
1247 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1250 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1248 | 1251 |
1249 RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; | 1252 RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; |
1250 | 1253 |
1251 for (const auto& operation : filterOperations.operations()) { | 1254 for (const auto& operation : filterOperations.operations()) { |
1252 FilterOperation* filterOperation = operation.get(); | 1255 FilterOperation* filterOperation = operation.get(); |
1253 switch (filterOperation->type()) { | 1256 switch (filterOperation->type()) { |
1254 case FilterOperation::REFERENCE: | 1257 case FilterOperation::REFERENCE: |
1255 filterValue = CSSFunctionValue::create(CSSValueUrl); | 1258 filterValue = CSSFunctionValue::create(CSSValueUrl); |
1256 filterValue->append(cssValuePool().createValue(toReferenceFilterOper
ation(filterOperation)->url(), CSSPrimitiveValue::UnitType::CustomIdentifier)); | 1259 filterValue->append(CSSCustomIdentValue::create(toReferenceFilterOpe
ration(filterOperation)->url())); |
1257 break; | 1260 break; |
1258 case FilterOperation::GRAYSCALE: | 1261 case FilterOperation::GRAYSCALE: |
1259 filterValue = CSSFunctionValue::create(CSSValueGrayscale); | 1262 filterValue = CSSFunctionValue::create(CSSValueGrayscale); |
1260 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); | 1263 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); |
1261 break; | 1264 break; |
1262 case FilterOperation::SEPIA: | 1265 case FilterOperation::SEPIA: |
1263 filterValue = CSSFunctionValue::create(CSSValueSepia); | 1266 filterValue = CSSFunctionValue::create(CSSValueSepia); |
1264 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); | 1267 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); |
1265 break; | 1268 break; |
1266 case FilterOperation::SATURATE: | 1269 case FilterOperation::SATURATE: |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, | 1727 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, |
1725 // the "height" property does not apply for non-replaced inline elem
ents. | 1728 // the "height" property does not apply for non-replaced inline elem
ents. |
1726 if (!layoutObject->isReplaced() && layoutObject->isInline()) | 1729 if (!layoutObject->isReplaced() && layoutObject->isInline()) |
1727 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1730 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1728 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), styl
e); | 1731 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), styl
e); |
1729 } | 1732 } |
1730 return zoomAdjustedPixelValueForLength(style.height(), style); | 1733 return zoomAdjustedPixelValueForLength(style.height(), style); |
1731 case CSSPropertyWebkitHighlight: | 1734 case CSSPropertyWebkitHighlight: |
1732 if (style.highlight() == nullAtom) | 1735 if (style.highlight() == nullAtom) |
1733 return cssValuePool().createIdentifierValue(CSSValueNone); | 1736 return cssValuePool().createIdentifierValue(CSSValueNone); |
1734 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue::
UnitType::String); | 1737 return CSSStringValue::create(style.highlight()); |
1735 case CSSPropertyWebkitHyphenateCharacter: | 1738 case CSSPropertyWebkitHyphenateCharacter: |
1736 if (style.hyphenationString().isNull()) | 1739 if (style.hyphenationString().isNull()) |
1737 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1740 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1738 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv
eValue::UnitType::String); | 1741 return CSSStringValue::create(style.hyphenationString()); |
1739 case CSSPropertyImageRendering: | 1742 case CSSPropertyImageRendering: |
1740 return CSSPrimitiveValue::create(style.imageRendering()); | 1743 return CSSPrimitiveValue::create(style.imageRendering()); |
1741 case CSSPropertyImageOrientation: | 1744 case CSSPropertyImageOrientation: |
1742 if (style.respectImageOrientation() == RespectImageOrientation) | 1745 if (style.respectImageOrientation() == RespectImageOrientation) |
1743 return cssValuePool().createValue(CSSValueFromImage); | 1746 return cssValuePool().createValue(CSSValueFromImage); |
1744 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Degree
s); | 1747 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Degree
s); |
1745 case CSSPropertyIsolation: | 1748 case CSSPropertyIsolation: |
1746 return cssValuePool().createValue(style.isolation()); | 1749 return cssValuePool().createValue(style.isolation()); |
1747 case CSSPropertyJustifyItems: | 1750 case CSSPropertyJustifyItems: |
1748 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItemsPosition(), &style), style.justifyItemsOverflowAlignment(), styl
e.justifyItemsPositionType()); | 1751 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItemsPosition(), &style), style.justifyItemsOverflowAlignment(), styl
e.justifyItemsPositionType()); |
(...skipping 17 matching lines...) Expand all Loading... |
1766 if (style.listStyleImage()) | 1769 if (style.listStyleImage()) |
1767 return style.listStyleImage()->computedCSSValue(); | 1770 return style.listStyleImage()->computedCSSValue(); |
1768 return cssValuePool().createIdentifierValue(CSSValueNone); | 1771 return cssValuePool().createIdentifierValue(CSSValueNone); |
1769 case CSSPropertyListStylePosition: | 1772 case CSSPropertyListStylePosition: |
1770 return cssValuePool().createValue(style.listStylePosition()); | 1773 return cssValuePool().createValue(style.listStylePosition()); |
1771 case CSSPropertyListStyleType: | 1774 case CSSPropertyListStyleType: |
1772 return cssValuePool().createValue(style.listStyleType()); | 1775 return cssValuePool().createValue(style.listStyleType()); |
1773 case CSSPropertyWebkitLocale: | 1776 case CSSPropertyWebkitLocale: |
1774 if (style.locale().isNull()) | 1777 if (style.locale().isNull()) |
1775 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1778 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1776 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::Uni
tType::String); | 1779 return CSSStringValue::create(style.locale()); |
1777 case CSSPropertyMarginTop: { | 1780 case CSSPropertyMarginTop: { |
1778 Length marginTop = style.marginTop(); | 1781 Length marginTop = style.marginTop(); |
1779 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) | 1782 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) |
1780 return zoomAdjustedPixelValueForLength(marginTop, style); | 1783 return zoomAdjustedPixelValueForLength(marginTop, style); |
1781 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st
yle); | 1784 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st
yle); |
1782 } | 1785 } |
1783 case CSSPropertyMarginRight: { | 1786 case CSSPropertyMarginRight: { |
1784 Length marginRight = style.marginRight(); | 1787 Length marginRight = style.marginRight(); |
1785 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) | 1788 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) |
1786 return zoomAdjustedPixelValueForLength(marginRight, style); | 1789 return zoomAdjustedPixelValueForLength(marginRight, style); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 case CSSPropertyPosition: | 1909 case CSSPropertyPosition: |
1907 return cssValuePool().createValue(style.position()); | 1910 return cssValuePool().createValue(style.position()); |
1908 case CSSPropertyQuotes: | 1911 case CSSPropertyQuotes: |
1909 if (!style.quotes()) { | 1912 if (!style.quotes()) { |
1910 // TODO(ramya.v): We should return the quote values that we're actua
lly using. | 1913 // TODO(ramya.v): We should return the quote values that we're actua
lly using. |
1911 return nullptr; | 1914 return nullptr; |
1912 } | 1915 } |
1913 if (style.quotes()->size()) { | 1916 if (style.quotes()->size()) { |
1914 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); | 1917 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); |
1915 for (int i = 0; i < style.quotes()->size(); i++) { | 1918 for (int i = 0; i < style.quotes()->size(); i++) { |
1916 list->append(cssValuePool().createValue(style.quotes()->getOpenQ
uote(i), CSSPrimitiveValue::UnitType::String)); | 1919 list->append(CSSStringValue::create(style.quotes()->getOpenQuote
(i))); |
1917 list->append(cssValuePool().createValue(style.quotes()->getClose
Quote(i), CSSPrimitiveValue::UnitType::String)); | 1920 list->append(CSSStringValue::create(style.quotes()->getCloseQuot
e(i))); |
1918 } | 1921 } |
1919 return list.release(); | 1922 return list.release(); |
1920 } | 1923 } |
1921 return cssValuePool().createIdentifierValue(CSSValueNone); | 1924 return cssValuePool().createIdentifierValue(CSSValueNone); |
1922 case CSSPropertyRight: | 1925 case CSSPropertyRight: |
1923 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); | 1926 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); |
1924 case CSSPropertyWebkitRubyPosition: | 1927 case CSSPropertyWebkitRubyPosition: |
1925 return cssValuePool().createValue(style.rubyPosition()); | 1928 return cssValuePool().createValue(style.rubyPosition()); |
1926 case CSSPropertyScrollBehavior: | 1929 case CSSPropertyScrollBehavior: |
1927 return cssValuePool().createValue(style.scrollBehavior()); | 1930 return cssValuePool().createValue(style.scrollBehavior()); |
(...skipping 23 matching lines...) Expand all Loading... |
1951 return currentColorOrValidColor(style, style.textFillColor()); | 1954 return currentColorOrValidColor(style, style.textFillColor()); |
1952 case CSSPropertyWebkitTextEmphasisColor: | 1955 case CSSPropertyWebkitTextEmphasisColor: |
1953 return currentColorOrValidColor(style, style.textEmphasisColor()); | 1956 return currentColorOrValidColor(style, style.textEmphasisColor()); |
1954 case CSSPropertyWebkitTextEmphasisPosition: | 1957 case CSSPropertyWebkitTextEmphasisPosition: |
1955 return cssValuePool().createValue(style.textEmphasisPosition()); | 1958 return cssValuePool().createValue(style.textEmphasisPosition()); |
1956 case CSSPropertyWebkitTextEmphasisStyle: | 1959 case CSSPropertyWebkitTextEmphasisStyle: |
1957 switch (style.textEmphasisMark()) { | 1960 switch (style.textEmphasisMark()) { |
1958 case TextEmphasisMarkNone: | 1961 case TextEmphasisMarkNone: |
1959 return cssValuePool().createIdentifierValue(CSSValueNone); | 1962 return cssValuePool().createIdentifierValue(CSSValueNone); |
1960 case TextEmphasisMarkCustom: | 1963 case TextEmphasisMarkCustom: |
1961 return cssValuePool().createValue(style.textEmphasisCustomMark(), CS
SPrimitiveValue::UnitType::String); | 1964 return CSSStringValue::create(style.textEmphasisCustomMark()); |
1962 case TextEmphasisMarkAuto: | 1965 case TextEmphasisMarkAuto: |
1963 ASSERT_NOT_REACHED(); | 1966 ASSERT_NOT_REACHED(); |
1964 // Fall through | 1967 // Fall through |
1965 case TextEmphasisMarkDot: | 1968 case TextEmphasisMarkDot: |
1966 case TextEmphasisMarkCircle: | 1969 case TextEmphasisMarkCircle: |
1967 case TextEmphasisMarkDoubleCircle: | 1970 case TextEmphasisMarkDoubleCircle: |
1968 case TextEmphasisMarkTriangle: | 1971 case TextEmphasisMarkTriangle: |
1969 case TextEmphasisMarkSesame: { | 1972 case TextEmphasisMarkSesame: { |
1970 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); | 1973 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); |
1971 list->append(cssValuePool().createValue(style.textEmphasisFill())); | 1974 list->append(cssValuePool().createValue(style.textEmphasisFill())); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2129 } else { | 2132 } else { |
2130 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); | 2133 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); |
2131 } | 2134 } |
2132 return list.release(); | 2135 return list.release(); |
2133 } | 2136 } |
2134 case CSSPropertyAnimationName: { | 2137 case CSSPropertyAnimationName: { |
2135 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2138 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
2136 const CSSAnimationData* animationData = style.animations(); | 2139 const CSSAnimationData* animationData = style.animations(); |
2137 if (animationData) { | 2140 if (animationData) { |
2138 for (size_t i = 0; i < animationData->nameList().size(); ++i) | 2141 for (size_t i = 0; i < animationData->nameList().size(); ++i) |
2139 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::UnitType::CustomIdentifier)); | 2142 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); |
2140 } else { | 2143 } else { |
2141 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2144 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
2142 } | 2145 } |
2143 return list.release(); | 2146 return list.release(); |
2144 } | 2147 } |
2145 case CSSPropertyAnimationPlayState: { | 2148 case CSSPropertyAnimationPlayState: { |
2146 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2149 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
2147 const CSSAnimationData* animationData = style.animations(); | 2150 const CSSAnimationData* animationData = style.animations(); |
2148 if (animationData) { | 2151 if (animationData) { |
2149 for (size_t i = 0; i < animationData->playStateList().size(); ++i) | 2152 for (size_t i = 0; i < animationData->playStateList().size(); ++i) |
2150 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); | 2153 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); |
2151 } else { | 2154 } else { |
2152 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2155 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
2153 } | 2156 } |
2154 return list.release(); | 2157 return list.release(); |
2155 } | 2158 } |
2156 case CSSPropertyAnimationTimingFunction: | 2159 case CSSPropertyAnimationTimingFunction: |
2157 return valueForAnimationTimingFunction(style.animations()); | 2160 return valueForAnimationTimingFunction(style.animations()); |
2158 case CSSPropertyAnimation: { | 2161 case CSSPropertyAnimation: { |
2159 const CSSAnimationData* animationData = style.animations(); | 2162 const CSSAnimationData* animationData = style.animations(); |
2160 if (animationData) { | 2163 if (animationData) { |
2161 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea
teCommaSeparated(); | 2164 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea
teCommaSeparated(); |
2162 for (size_t i = 0; i < animationData->nameList().size(); ++i) { | 2165 for (size_t i = 0; i < animationData->nameList().size(); ++i) { |
2163 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); | 2166 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); |
2164 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::UnitType::CustomIdentifier)); | 2167 list->append(CSSCustomIdentValue::create(animationData->nameList
()[i])); |
2165 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2168 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
2166 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); | 2169 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); |
2167 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2170 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
2168 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); | 2171 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); |
2169 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); | 2172 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); |
2170 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); | 2173 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); |
2171 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); | 2174 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); |
2172 animationsList->append(list); | 2175 animationsList->append(list); |
2173 } | 2176 } |
2174 return animationsList.release(); | 2177 return animationsList.release(); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 return valueForContentData(style); | 2345 return valueForContentData(style); |
2343 case CSSPropertyCounterIncrement: | 2346 case CSSPropertyCounterIncrement: |
2344 return valueForCounterDirectives(style, propertyID); | 2347 return valueForCounterDirectives(style, propertyID); |
2345 case CSSPropertyCounterReset: | 2348 case CSSPropertyCounterReset: |
2346 return valueForCounterDirectives(style, propertyID); | 2349 return valueForCounterDirectives(style, propertyID); |
2347 case CSSPropertyWebkitClipPath: | 2350 case CSSPropertyWebkitClipPath: |
2348 if (ClipPathOperation* operation = style.clipPath()) { | 2351 if (ClipPathOperation* operation = style.clipPath()) { |
2349 if (operation->type() == ClipPathOperation::SHAPE) | 2352 if (operation->type() == ClipPathOperation::SHAPE) |
2350 return valueForBasicShape(style, toShapeClipPathOperation(operat
ion)->basicShape()); | 2353 return valueForBasicShape(style, toShapeClipPathOperation(operat
ion)->basicShape()); |
2351 if (operation->type() == ClipPathOperation::REFERENCE) | 2354 if (operation->type() == ClipPathOperation::REFERENCE) |
2352 return CSSPrimitiveValue::create(toReferenceClipPathOperation(op
eration)->url(), CSSPrimitiveValue::UnitType::URI); | 2355 return CSSURIValue::create(toReferenceClipPathOperation(operatio
n)->url()); |
2353 } | 2356 } |
2354 return cssValuePool().createIdentifierValue(CSSValueNone); | 2357 return cssValuePool().createIdentifierValue(CSSValueNone); |
2355 case CSSPropertyShapeMargin: | 2358 case CSSPropertyShapeMargin: |
2356 return cssValuePool().createValue(style.shapeMargin(), style); | 2359 return cssValuePool().createValue(style.shapeMargin(), style); |
2357 case CSSPropertyShapeImageThreshold: | 2360 case CSSPropertyShapeImageThreshold: |
2358 return cssValuePool().createValue(style.shapeImageThreshold(), CSSPrimit
iveValue::UnitType::Number); | 2361 return cssValuePool().createValue(style.shapeImageThreshold(), CSSPrimit
iveValue::UnitType::Number); |
2359 case CSSPropertyShapeOutside: | 2362 case CSSPropertyShapeOutside: |
2360 return valueForShape(style, style.shapeOutside()); | 2363 return valueForShape(style, style.shapeOutside()); |
2361 case CSSPropertyWebkitFilter: | 2364 case CSSPropertyWebkitFilter: |
2362 return valueForFilter(style, style.filter()); | 2365 return valueForFilter(style, style.filter()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2546 case CSSPropertyAlignmentBaseline: | 2549 case CSSPropertyAlignmentBaseline: |
2547 return CSSPrimitiveValue::create(svgStyle.alignmentBaseline()); | 2550 return CSSPrimitiveValue::create(svgStyle.alignmentBaseline()); |
2548 case CSSPropertyDominantBaseline: | 2551 case CSSPropertyDominantBaseline: |
2549 return CSSPrimitiveValue::create(svgStyle.dominantBaseline()); | 2552 return CSSPrimitiveValue::create(svgStyle.dominantBaseline()); |
2550 case CSSPropertyTextAnchor: | 2553 case CSSPropertyTextAnchor: |
2551 return CSSPrimitiveValue::create(svgStyle.textAnchor()); | 2554 return CSSPrimitiveValue::create(svgStyle.textAnchor()); |
2552 case CSSPropertyWritingMode: | 2555 case CSSPropertyWritingMode: |
2553 return CSSPrimitiveValue::create(svgStyle.writingMode()); | 2556 return CSSPrimitiveValue::create(svgStyle.writingMode()); |
2554 case CSSPropertyClipPath: | 2557 case CSSPropertyClipPath: |
2555 if (!svgStyle.clipperResource().isEmpty()) | 2558 if (!svgStyle.clipperResource().isEmpty()) |
2556 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.clipperResource()), CSSPrimitiveValue::UnitType::URI); | 2559 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.cl
ipperResource())); |
2557 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2560 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2558 case CSSPropertyMask: | 2561 case CSSPropertyMask: |
2559 if (!svgStyle.maskerResource().isEmpty()) | 2562 if (!svgStyle.maskerResource().isEmpty()) |
2560 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.maskerResource()), CSSPrimitiveValue::UnitType::URI); | 2563 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma
skerResource())); |
2561 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2564 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2562 case CSSPropertyFilter: | 2565 case CSSPropertyFilter: |
2563 if (!svgStyle.filterResource().isEmpty()) | 2566 if (!svgStyle.filterResource().isEmpty()) |
2564 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.filterResource()), CSSPrimitiveValue::UnitType::URI); | 2567 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.fi
lterResource())); |
2565 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2568 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2566 case CSSPropertyFloodColor: | 2569 case CSSPropertyFloodColor: |
2567 return currentColorOrValidColor(style, svgStyle.floodColor()); | 2570 return currentColorOrValidColor(style, svgStyle.floodColor()); |
2568 case CSSPropertyLightingColor: | 2571 case CSSPropertyLightingColor: |
2569 return currentColorOrValidColor(style, svgStyle.lightingColor()); | 2572 return currentColorOrValidColor(style, svgStyle.lightingColor()); |
2570 case CSSPropertyStopColor: | 2573 case CSSPropertyStopColor: |
2571 return currentColorOrValidColor(style, svgStyle.stopColor()); | 2574 return currentColorOrValidColor(style, svgStyle.stopColor()); |
2572 case CSSPropertyFill: | 2575 case CSSPropertyFill: |
2573 return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle.
fillPaintUri(), svgStyle.fillPaintColor(), style.color()); | 2576 return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle.
fillPaintUri(), svgStyle.fillPaintColor(), style.color()); |
2574 case CSSPropertyMarkerEnd: | 2577 case CSSPropertyMarkerEnd: |
2575 if (!svgStyle.markerEndResource().isEmpty()) | 2578 if (!svgStyle.markerEndResource().isEmpty()) |
2576 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerEndResource()), CSSPrimitiveValue::UnitType::URI); | 2579 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma
rkerEndResource())); |
2577 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2580 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2578 case CSSPropertyMarkerMid: | 2581 case CSSPropertyMarkerMid: |
2579 if (!svgStyle.markerMidResource().isEmpty()) | 2582 if (!svgStyle.markerMidResource().isEmpty()) |
2580 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerMidResource()), CSSPrimitiveValue::UnitType::URI); | 2583 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma
rkerMidResource())); |
2581 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2584 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2582 case CSSPropertyMarkerStart: | 2585 case CSSPropertyMarkerStart: |
2583 if (!svgStyle.markerStartResource().isEmpty()) | 2586 if (!svgStyle.markerStartResource().isEmpty()) |
2584 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerStartResource()), CSSPrimitiveValue::UnitType::URI); | 2587 return CSSURIValue::create(serializeAsFragmentIdentifier(svgStyle.ma
rkerStartResource())); |
2585 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2588 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2586 case CSSPropertyStroke: | 2589 case CSSPropertyStroke: |
2587 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl
e.strokePaintUri(), svgStyle.strokePaintColor(), style.color()); | 2590 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl
e.strokePaintUri(), svgStyle.strokePaintColor(), style.color()); |
2588 case CSSPropertyStrokeDasharray: | 2591 case CSSPropertyStrokeDasharray: |
2589 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style)
; | 2592 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style)
; |
2590 case CSSPropertyStrokeDashoffset: | 2593 case CSSPropertyStrokeDashoffset: |
2591 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl
e); | 2594 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl
e); |
2592 case CSSPropertyStrokeWidth: | 2595 case CSSPropertyStrokeWidth: |
2593 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style); | 2596 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style); |
2594 case CSSPropertyBaselineShift: { | 2597 case CSSPropertyBaselineShift: { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2700 case CSSPropertyAll: | 2703 case CSSPropertyAll: |
2701 return nullptr; | 2704 return nullptr; |
2702 default: | 2705 default: |
2703 break; | 2706 break; |
2704 } | 2707 } |
2705 ASSERT_NOT_REACHED(); | 2708 ASSERT_NOT_REACHED(); |
2706 return nullptr; | 2709 return nullptr; |
2707 } | 2710 } |
2708 | 2711 |
2709 } | 2712 } |
OLD | NEW |