| 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 21 matching lines...) Expand all Loading... |
| 32 #include "core/css/CSSCounterValue.h" | 32 #include "core/css/CSSCounterValue.h" |
| 33 #include "core/css/CSSFontFeatureValue.h" | 33 #include "core/css/CSSFontFeatureValue.h" |
| 34 #include "core/css/CSSFunctionValue.h" | 34 #include "core/css/CSSFunctionValue.h" |
| 35 #include "core/css/CSSGridLineNamesValue.h" | 35 #include "core/css/CSSGridLineNamesValue.h" |
| 36 #include "core/css/CSSGridTemplateAreasValue.h" | 36 #include "core/css/CSSGridTemplateAreasValue.h" |
| 37 #include "core/css/CSSPathValue.h" | 37 #include "core/css/CSSPathValue.h" |
| 38 #include "core/css/CSSPrimitiveValueMappings.h" | 38 #include "core/css/CSSPrimitiveValueMappings.h" |
| 39 #include "core/css/CSSQuadValue.h" | 39 #include "core/css/CSSQuadValue.h" |
| 40 #include "core/css/CSSReflectValue.h" | 40 #include "core/css/CSSReflectValue.h" |
| 41 #include "core/css/CSSShadowValue.h" | 41 #include "core/css/CSSShadowValue.h" |
| 42 #include "core/css/CSSStringValue.h" |
| 42 #include "core/css/CSSTimingFunctionValue.h" | 43 #include "core/css/CSSTimingFunctionValue.h" |
| 43 #include "core/css/CSSValueList.h" | 44 #include "core/css/CSSValueList.h" |
| 44 #include "core/css/CSSValuePair.h" | 45 #include "core/css/CSSValuePair.h" |
| 45 #include "core/css/CSSValuePool.h" | 46 #include "core/css/CSSValuePool.h" |
| 46 #include "core/layout/LayoutBlock.h" | 47 #include "core/layout/LayoutBlock.h" |
| 47 #include "core/layout/LayoutBox.h" | 48 #include "core/layout/LayoutBox.h" |
| 48 #include "core/layout/LayoutGrid.h" | 49 #include "core/layout/LayoutGrid.h" |
| 49 #include "core/layout/LayoutObject.h" | 50 #include "core/layout/LayoutObject.h" |
| 50 #include "core/style/ComputedStyle.h" | 51 #include "core/style/ComputedStyle.h" |
| 51 #include "core/style/ContentData.h" | 52 #include "core/style/ContentData.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 return CSSValueMonospace; | 484 return CSSValueMonospace; |
| 484 if (family == FontFamilyNames::webkit_pictograph) | 485 if (family == FontFamilyNames::webkit_pictograph) |
| 485 return CSSValueWebkitPictograph; | 486 return CSSValueWebkitPictograph; |
| 486 if (family == FontFamilyNames::webkit_sans_serif) | 487 if (family == FontFamilyNames::webkit_sans_serif) |
| 487 return CSSValueSansSerif; | 488 return CSSValueSansSerif; |
| 488 if (family == FontFamilyNames::webkit_serif) | 489 if (family == FontFamilyNames::webkit_serif) |
| 489 return CSSValueSerif; | 490 return CSSValueSerif; |
| 490 return CSSValueInvalid; | 491 return CSSValueInvalid; |
| 491 } | 492 } |
| 492 | 493 |
| 493 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForFamily(const AtomicStri
ng& family) | 494 static PassRefPtrWillBeRawPtr<CSSValue> valueForFamily(const AtomicString& famil
y) |
| 494 { | 495 { |
| 495 if (CSSValueID familyIdentifier = identifierForFamily(family)) | 496 if (CSSValueID familyIdentifier = identifierForFamily(family)) |
| 496 return cssValuePool().createIdentifierValue(familyIdentifier); | 497 return cssValuePool().createIdentifierValue(familyIdentifier); |
| 497 return cssValuePool().createValue(family.string(), CSSPrimitiveValue::UnitTy
pe::CustomIdentifier); | 498 return CSSStringValue::create(family.string(), CSSStringValue::SerializeAsCu
stomIdentifier); |
| 498 } | 499 } |
| 499 | 500 |
| 500 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const ComputedSty
le& style) | 501 static PassRefPtrWillBeRawPtr<CSSValueList> valueForFontFamily(const ComputedSty
le& style) |
| 501 { | 502 { |
| 502 const FontFamily& firstFamily = style.fontDescription().family(); | 503 const FontFamily& firstFamily = style.fontDescription().family(); |
| 503 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 504 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
| 504 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) | 505 for (const FontFamily* family = &firstFamily; family; family = family->next(
)) |
| 505 list->append(valueForFamily(family->family())); | 506 list->append(valueForFamily(family->family())); |
| 506 return list.release(); | 507 return list.release(); |
| 507 } | 508 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 } | 559 } |
| 559 | 560 |
| 560 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) | 561 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) |
| 561 { | 562 { |
| 562 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); | 563 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); |
| 563 if (namedGridLines.isEmpty()) | 564 if (namedGridLines.isEmpty()) |
| 564 return; | 565 return; |
| 565 | 566 |
| 566 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); | 567 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); |
| 567 for (size_t j = 0; j < namedGridLines.size(); ++j) | 568 for (size_t j = 0; j < namedGridLines.size(); ++j) |
| 568 lineNames->append(cssValuePool().createValue(namedGridLines[j], CSSPrimi
tiveValue::UnitType::CustomIdentifier)); | 569 lineNames->append(CSSStringValue::create(namedGridLines[j], CSSStringVal
ue::SerializeAsCustomIdentifier)); |
| 569 list.append(lineNames.release()); | 570 list.append(lineNames.release()); |
| 570 } | 571 } |
| 571 | 572 |
| 572 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* layoutObject, const ComputedStyle& style) | 573 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
ection direction, const LayoutObject* layoutObject, const ComputedStyle& style) |
| 573 { | 574 { |
| 574 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); | 575 const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gr
idTemplateColumns() : style.gridTemplateRows(); |
| 575 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); | 576 const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns
? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines(); |
| 576 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); | 577 bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid(); |
| 577 | 578 |
| 578 // Handle the 'none' case. | 579 // Handle the 'none' case. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); | 614 addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, insertionIndex, *li
st); |
| 614 return list.release(); | 615 return list.release(); |
| 615 } | 616 } |
| 616 | 617 |
| 617 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition&
position) | 618 static PassRefPtrWillBeRawPtr<CSSValue> valueForGridPosition(const GridPosition&
position) |
| 618 { | 619 { |
| 619 if (position.isAuto()) | 620 if (position.isAuto()) |
| 620 return cssValuePool().createIdentifierValue(CSSValueAuto); | 621 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 621 | 622 |
| 622 if (position.isNamedGridArea()) | 623 if (position.isNamedGridArea()) |
| 623 return cssValuePool().createValue(position.namedGridLine(), CSSPrimitive
Value::UnitType::CustomIdentifier); | 624 return CSSStringValue::create(position.namedGridLine(), CSSStringValue::
SerializeAsCustomIdentifier); |
| 624 | 625 |
| 625 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 626 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 626 if (position.isSpan()) { | 627 if (position.isSpan()) { |
| 627 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); | 628 list->append(cssValuePool().createIdentifierValue(CSSValueSpan)); |
| 628 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); | 629 list->append(cssValuePool().createValue(position.spanPosition(), CSSPrim
itiveValue::UnitType::Number)); |
| 629 } else { | 630 } else { |
| 630 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); | 631 list->append(cssValuePool().createValue(position.integerPosition(), CSSP
rimitiveValue::UnitType::Number)); |
| 631 } | 632 } |
| 632 | 633 |
| 633 if (!position.namedGridLine().isNull()) | 634 if (!position.namedGridLine().isNull()) |
| 634 list->append(cssValuePool().createValue(position.namedGridLine(), CSSPri
mitiveValue::UnitType::CustomIdentifier)); | 635 list->append(CSSStringValue::create(position.namedGridLine(), CSSStringV
alue::SerializeAsCustomIdentifier)); |
| 635 return list; | 636 return list; |
| 636 } | 637 } |
| 637 | 638 |
| 638 static LayoutRect sizingBox(const LayoutObject* layoutObject) | 639 static LayoutRect sizingBox(const LayoutObject* layoutObject) |
| 639 { | 640 { |
| 640 if (!layoutObject->isBox()) | 641 if (!layoutObject->isBox()) |
| 641 return LayoutRect(); | 642 return LayoutRect(); |
| 642 | 643 |
| 643 const LayoutBox* box = toLayoutBox(layoutObject); | 644 const LayoutBox* box = toLayoutBox(layoutObject); |
| 644 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); | 645 return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box-
>computedCSSContentBoxRect(); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 list->append(valueForMatrixTransform(transform, style)); | 935 list->append(valueForMatrixTransform(transform, style)); |
| 935 | 936 |
| 936 return list.release(); | 937 return list.release(); |
| 937 } | 938 } |
| 938 | 939 |
| 939 static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSST
ransitionData::TransitionProperty& property) | 940 static PassRefPtrWillBeRawPtr<CSSValue> createTransitionPropertyValue(const CSST
ransitionData::TransitionProperty& property) |
| 940 { | 941 { |
| 941 if (property.propertyType == CSSTransitionData::TransitionNone) | 942 if (property.propertyType == CSSTransitionData::TransitionNone) |
| 942 return cssValuePool().createIdentifierValue(CSSValueNone); | 943 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 943 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) | 944 if (property.propertyType == CSSTransitionData::TransitionUnknownProperty) |
| 944 return cssValuePool().createValue(property.propertyString, CSSPrimitiveV
alue::UnitType::CustomIdentifier); | 945 return CSSStringValue::create(property.propertyString, CSSStringValue::S
erializeAsCustomIdentifier); |
| 945 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); | 946 ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty); |
| 946 return cssValuePool().createValue(getPropertyNameString(property.unresolvedP
roperty), CSSPrimitiveValue::UnitType::CustomIdentifier); | 947 return CSSStringValue::create(getPropertyNameString(property.unresolvedPrope
rty), CSSStringValue::SerializeAsCustomIdentifier); |
| 947 } | 948 } |
| 948 | 949 |
| 949 static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTran
sitionData* transitionData) | 950 static PassRefPtrWillBeRawPtr<CSSValue> valueForTransitionProperty(const CSSTran
sitionData* transitionData) |
| 950 { | 951 { |
| 951 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 952 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
| 952 if (transitionData) { | 953 if (transitionData) { |
| 953 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) | 954 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) |
| 954 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); | 955 list->append(createTransitionPropertyValue(transitionData->propertyL
ist()[i])); |
| 955 } else { | 956 } else { |
| 956 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); | 957 list->append(cssValuePool().createIdentifierValue(CSSValueAll)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 981 return CSSValueInvalid; | 982 return CSSValueInvalid; |
| 982 } | 983 } |
| 983 | 984 |
| 984 static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
style) | 985 static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
style) |
| 985 { | 986 { |
| 986 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 987 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 987 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { | 988 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { |
| 988 if (contentData->isCounter()) { | 989 if (contentData->isCounter()) { |
| 989 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); | 990 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); |
| 990 ASSERT(counter); | 991 ASSERT(counter); |
| 991 RefPtrWillBeRawPtr<CSSPrimitiveValue> identifier = cssValuePool().cr
eateValue(counter->identifier(), CSSPrimitiveValue::UnitType::CustomIdentifier); | 992 RefPtrWillBeRawPtr<CSSStringValue> identifier = CSSStringValue::crea
te(counter->identifier(), CSSStringValue::SerializeAsCustomIdentifier); |
| 992 RefPtrWillBeRawPtr<CSSPrimitiveValue> separator = cssValuePool().cre
ateValue(counter->separator(), CSSPrimitiveValue::UnitType::CustomIdentifier); | 993 RefPtrWillBeRawPtr<CSSStringValue> separator = CSSStringValue::creat
e(counter->separator(), CSSStringValue::SerializeAsCustomIdentifier); |
| 993 CSSValueID listStyleIdent = CSSValueNone; | 994 CSSValueID listStyleIdent = CSSValueNone; |
| 994 if (counter->listStyle() != NoneListStyle) | 995 if (counter->listStyle() != NoneListStyle) |
| 995 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); | 996 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); |
| 996 RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().cre
ateIdentifierValue(listStyleIdent); | 997 RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().cre
ateIdentifierValue(listStyleIdent); |
| 997 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); | 998 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); |
| 998 } else if (contentData->isImage()) { | 999 } else if (contentData->isImage()) { |
| 999 const StyleImage* image = toImageContentData(contentData)->image(); | 1000 const StyleImage* image = toImageContentData(contentData)->image(); |
| 1000 ASSERT(image); | 1001 ASSERT(image); |
| 1001 list->append(image->cssValue()); | 1002 list->append(image->cssValue()); |
| 1002 } else if (contentData->isText()) { | 1003 } else if (contentData->isText()) { |
| 1003 list->append(cssValuePool().createValue(toTextContentData(contentDat
a)->text(), CSSPrimitiveValue::UnitType::String)); | 1004 list->append(CSSStringValue::create(toTextContentData(contentData)->
text(), CSSStringValue::SerializeAsString)); |
| 1004 } else if (contentData->isQuote()) { | 1005 } else if (contentData->isQuote()) { |
| 1005 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; | 1006 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; |
| 1006 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); | 1007 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); |
| 1007 } else { | 1008 } else { |
| 1008 ASSERT_NOT_REACHED(); | 1009 ASSERT_NOT_REACHED(); |
| 1009 } | 1010 } |
| 1010 } | 1011 } |
| 1011 return list.release(); | 1012 return list.release(); |
| 1012 } | 1013 } |
| 1013 | 1014 |
| 1014 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const Computed
Style& style, CSSPropertyID propertyID) | 1015 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const Computed
Style& style, CSSPropertyID propertyID) |
| 1015 { | 1016 { |
| 1016 const CounterDirectiveMap* map = style.counterDirectives(); | 1017 const CounterDirectiveMap* map = style.counterDirectives(); |
| 1017 if (!map) | 1018 if (!map) |
| 1018 return cssValuePool().createIdentifierValue(CSSValueNone); | 1019 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1019 | 1020 |
| 1020 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1021 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 1021 for (const auto& item : *map) { | 1022 for (const auto& item : *map) { |
| 1022 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); | 1023 bool isValidCounterValue = propertyID == CSSPropertyCounterIncrement ? i
tem.value.isIncrement() : item.value.isReset(); |
| 1023 if (!isValidCounterValue) | 1024 if (!isValidCounterValue) |
| 1024 continue; | 1025 continue; |
| 1025 | 1026 |
| 1026 list->append(cssValuePool().createValue(item.key, CSSPrimitiveValue::Uni
tType::CustomIdentifier)); | 1027 list->append(CSSStringValue::create(item.key, CSSStringValue::SerializeA
sCustomIdentifier)); |
| 1027 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); | 1028 short number = propertyID == CSSPropertyCounterIncrement ? item.value.in
crementValue() : item.value.resetValue(); |
| 1028 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Number)); | 1029 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::UnitType::Number)); |
| 1029 } | 1030 } |
| 1030 | 1031 |
| 1031 if (!list->length()) | 1032 if (!list->length()) |
| 1032 return cssValuePool().createIdentifierValue(CSSValueNone); | 1033 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1033 | 1034 |
| 1034 return list.release(); | 1035 return list.release(); |
| 1035 } | 1036 } |
| 1036 | 1037 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 } | 1173 } |
| 1173 } | 1174 } |
| 1174 | 1175 |
| 1175 return list.release(); | 1176 return list.release(); |
| 1176 } | 1177 } |
| 1177 | 1178 |
| 1178 static PassRefPtrWillBeRawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintTy
pe paintType, const String& url, const Color& color, const Color& currentColor) | 1179 static PassRefPtrWillBeRawPtr<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintTy
pe paintType, const String& url, const Color& color, const Color& currentColor) |
| 1179 { | 1180 { |
| 1180 if (paintType >= SVG_PAINTTYPE_URI_NONE) { | 1181 if (paintType >= SVG_PAINTTYPE_URI_NONE) { |
| 1181 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSepar
ated(); | 1182 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSepar
ated(); |
| 1182 values->append(CSSPrimitiveValue::create(url, CSSPrimitiveValue::UnitTyp
e::URI)); | 1183 values->append(CSSStringValue::create(url, CSSStringValue::SerializeAsUR
I)); |
| 1183 if (paintType == SVG_PAINTTYPE_URI_NONE) | 1184 if (paintType == SVG_PAINTTYPE_URI_NONE) |
| 1184 values->append(CSSPrimitiveValue::create(CSSValueNone)); | 1185 values->append(CSSPrimitiveValue::create(CSSValueNone)); |
| 1185 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) | 1186 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) |
| 1186 values->append(CSSPrimitiveValue::createColor(currentColor.rgb())); | 1187 values->append(CSSPrimitiveValue::createColor(currentColor.rgb())); |
| 1187 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) | 1188 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) |
| 1188 values->append(CSSPrimitiveValue::createColor(color.rgb())); | 1189 values->append(CSSPrimitiveValue::createColor(color.rgb())); |
| 1189 return values.release(); | 1190 return values.release(); |
| 1190 } | 1191 } |
| 1191 if (paintType == SVG_PAINTTYPE_NONE) | 1192 if (paintType == SVG_PAINTTYPE_NONE) |
| 1192 return CSSPrimitiveValue::create(CSSValueNone); | 1193 return CSSPrimitiveValue::create(CSSValueNone); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 | 1232 |
| 1232 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1233 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 1233 | 1234 |
| 1234 RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; | 1235 RefPtrWillBeRawPtr<CSSFunctionValue> filterValue = nullptr; |
| 1235 | 1236 |
| 1236 for (const auto& operation : style.filter().operations()) { | 1237 for (const auto& operation : style.filter().operations()) { |
| 1237 FilterOperation* filterOperation = operation.get(); | 1238 FilterOperation* filterOperation = operation.get(); |
| 1238 switch (filterOperation->type()) { | 1239 switch (filterOperation->type()) { |
| 1239 case FilterOperation::REFERENCE: | 1240 case FilterOperation::REFERENCE: |
| 1240 filterValue = CSSFunctionValue::create(CSSValueUrl); | 1241 filterValue = CSSFunctionValue::create(CSSValueUrl); |
| 1241 filterValue->append(cssValuePool().createValue(toReferenceFilterOper
ation(filterOperation)->url(), CSSPrimitiveValue::UnitType::CustomIdentifier)); | 1242 filterValue->append(CSSStringValue::create(toReferenceFilterOperatio
n(filterOperation)->url(), CSSStringValue::SerializeAsCustomIdentifier)); |
| 1242 break; | 1243 break; |
| 1243 case FilterOperation::GRAYSCALE: | 1244 case FilterOperation::GRAYSCALE: |
| 1244 filterValue = CSSFunctionValue::create(CSSValueGrayscale); | 1245 filterValue = CSSFunctionValue::create(CSSValueGrayscale); |
| 1245 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); | 1246 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); |
| 1246 break; | 1247 break; |
| 1247 case FilterOperation::SEPIA: | 1248 case FilterOperation::SEPIA: |
| 1248 filterValue = CSSFunctionValue::create(CSSValueSepia); | 1249 filterValue = CSSFunctionValue::create(CSSValueSepia); |
| 1249 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); | 1250 filterValue->append(cssValuePool().createValue(toBasicColorMatrixFil
terOperation(filterOperation)->amount(), CSSPrimitiveValue::UnitType::Number)); |
| 1250 break; | 1251 break; |
| 1251 case FilterOperation::SATURATE: | 1252 case FilterOperation::SATURATE: |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1707 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, | 1708 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-pr
operty, |
| 1708 // the "height" property does not apply for non-replaced inline elem
ents. | 1709 // the "height" property does not apply for non-replaced inline elem
ents. |
| 1709 if (!layoutObject->isReplaced() && layoutObject->isInline()) | 1710 if (!layoutObject->isReplaced() && layoutObject->isInline()) |
| 1710 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1711 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1711 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), styl
e); | 1712 return zoomAdjustedPixelValue(sizingBox(layoutObject).height(), styl
e); |
| 1712 } | 1713 } |
| 1713 return zoomAdjustedPixelValueForLength(style.height(), style); | 1714 return zoomAdjustedPixelValueForLength(style.height(), style); |
| 1714 case CSSPropertyWebkitHighlight: | 1715 case CSSPropertyWebkitHighlight: |
| 1715 if (style.highlight() == nullAtom) | 1716 if (style.highlight() == nullAtom) |
| 1716 return cssValuePool().createIdentifierValue(CSSValueNone); | 1717 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1717 return cssValuePool().createValue(style.highlight(), CSSPrimitiveValue::
UnitType::String); | 1718 return CSSStringValue::create(style.highlight(), CSSStringValue::Seriali
zeAsString); |
| 1718 case CSSPropertyWebkitHyphenateCharacter: | 1719 case CSSPropertyWebkitHyphenateCharacter: |
| 1719 if (style.hyphenationString().isNull()) | 1720 if (style.hyphenationString().isNull()) |
| 1720 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1721 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1721 return cssValuePool().createValue(style.hyphenationString(), CSSPrimitiv
eValue::UnitType::String); | 1722 return CSSStringValue::create(style.hyphenationString(), CSSStringValue:
:SerializeAsString); |
| 1722 case CSSPropertyImageRendering: | 1723 case CSSPropertyImageRendering: |
| 1723 return CSSPrimitiveValue::create(style.imageRendering()); | 1724 return CSSPrimitiveValue::create(style.imageRendering()); |
| 1724 case CSSPropertyImageOrientation: | 1725 case CSSPropertyImageOrientation: |
| 1725 if (style.respectImageOrientation() == RespectImageOrientation) | 1726 if (style.respectImageOrientation() == RespectImageOrientation) |
| 1726 return cssValuePool().createValue(CSSValueFromImage); | 1727 return cssValuePool().createValue(CSSValueFromImage); |
| 1727 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Degree
s); | 1728 return cssValuePool().createValue(0, CSSPrimitiveValue::UnitType::Degree
s); |
| 1728 case CSSPropertyIsolation: | 1729 case CSSPropertyIsolation: |
| 1729 return cssValuePool().createValue(style.isolation()); | 1730 return cssValuePool().createValue(style.isolation()); |
| 1730 case CSSPropertyJustifyItems: | 1731 case CSSPropertyJustifyItems: |
| 1731 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItemsPosition(), styledNode), style.justifyItemsOverflowAlignment(),
style.justifyItemsPositionType()); | 1732 return valueForItemPositionWithOverflowAlignment(resolveAlignmentAuto(st
yle.justifyItemsPosition(), styledNode), style.justifyItemsOverflowAlignment(),
style.justifyItemsPositionType()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1747 if (style.listStyleImage()) | 1748 if (style.listStyleImage()) |
| 1748 return style.listStyleImage()->cssValue(); | 1749 return style.listStyleImage()->cssValue(); |
| 1749 return cssValuePool().createIdentifierValue(CSSValueNone); | 1750 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1750 case CSSPropertyListStylePosition: | 1751 case CSSPropertyListStylePosition: |
| 1751 return cssValuePool().createValue(style.listStylePosition()); | 1752 return cssValuePool().createValue(style.listStylePosition()); |
| 1752 case CSSPropertyListStyleType: | 1753 case CSSPropertyListStyleType: |
| 1753 return cssValuePool().createValue(style.listStyleType()); | 1754 return cssValuePool().createValue(style.listStyleType()); |
| 1754 case CSSPropertyWebkitLocale: | 1755 case CSSPropertyWebkitLocale: |
| 1755 if (style.locale().isNull()) | 1756 if (style.locale().isNull()) |
| 1756 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1757 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1757 return cssValuePool().createValue(style.locale(), CSSPrimitiveValue::Uni
tType::String); | 1758 return CSSStringValue::create(style.locale(), CSSStringValue::SerializeA
sString); |
| 1758 case CSSPropertyMarginTop: { | 1759 case CSSPropertyMarginTop: { |
| 1759 Length marginTop = style.marginTop(); | 1760 Length marginTop = style.marginTop(); |
| 1760 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) | 1761 if (marginTop.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 1761 return zoomAdjustedPixelValueForLength(marginTop, style); | 1762 return zoomAdjustedPixelValueForLength(marginTop, style); |
| 1762 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st
yle); | 1763 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st
yle); |
| 1763 } | 1764 } |
| 1764 case CSSPropertyMarginRight: { | 1765 case CSSPropertyMarginRight: { |
| 1765 Length marginRight = style.marginRight(); | 1766 Length marginRight = style.marginRight(); |
| 1766 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) | 1767 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) |
| 1767 return zoomAdjustedPixelValueForLength(marginRight, style); | 1768 return zoomAdjustedPixelValueForLength(marginRight, style); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1885 case CSSPropertyPosition: | 1886 case CSSPropertyPosition: |
| 1886 return cssValuePool().createValue(style.position()); | 1887 return cssValuePool().createValue(style.position()); |
| 1887 case CSSPropertyQuotes: | 1888 case CSSPropertyQuotes: |
| 1888 if (!style.quotes()) { | 1889 if (!style.quotes()) { |
| 1889 // TODO(ramya.v): We should return the quote values that we're actua
lly using. | 1890 // TODO(ramya.v): We should return the quote values that we're actua
lly using. |
| 1890 return nullptr; | 1891 return nullptr; |
| 1891 } | 1892 } |
| 1892 if (style.quotes()->size()) { | 1893 if (style.quotes()->size()) { |
| 1893 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); | 1894 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); |
| 1894 for (int i = 0; i < style.quotes()->size(); i++) { | 1895 for (int i = 0; i < style.quotes()->size(); i++) { |
| 1895 list->append(cssValuePool().createValue(style.quotes()->getOpenQ
uote(i), CSSPrimitiveValue::UnitType::String)); | 1896 list->append(CSSStringValue::create(style.quotes()->getOpenQuote
(i), CSSStringValue::SerializeAsString)); |
| 1896 list->append(cssValuePool().createValue(style.quotes()->getClose
Quote(i), CSSPrimitiveValue::UnitType::String)); | 1897 list->append(CSSStringValue::create(style.quotes()->getCloseQuot
e(i), CSSStringValue::SerializeAsString)); |
| 1897 } | 1898 } |
| 1898 return list.release(); | 1899 return list.release(); |
| 1899 } | 1900 } |
| 1900 return cssValuePool().createIdentifierValue(CSSValueNone); | 1901 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1901 case CSSPropertyRight: | 1902 case CSSPropertyRight: |
| 1902 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); | 1903 return valueForPositionOffset(style, CSSPropertyRight, layoutObject); |
| 1903 case CSSPropertyWebkitRubyPosition: | 1904 case CSSPropertyWebkitRubyPosition: |
| 1904 return cssValuePool().createValue(style.rubyPosition()); | 1905 return cssValuePool().createValue(style.rubyPosition()); |
| 1905 case CSSPropertyScrollBehavior: | 1906 case CSSPropertyScrollBehavior: |
| 1906 return cssValuePool().createValue(style.scrollBehavior()); | 1907 return cssValuePool().createValue(style.scrollBehavior()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1930 return currentColorOrValidColor(style, style.textFillColor()); | 1931 return currentColorOrValidColor(style, style.textFillColor()); |
| 1931 case CSSPropertyWebkitTextEmphasisColor: | 1932 case CSSPropertyWebkitTextEmphasisColor: |
| 1932 return currentColorOrValidColor(style, style.textEmphasisColor()); | 1933 return currentColorOrValidColor(style, style.textEmphasisColor()); |
| 1933 case CSSPropertyWebkitTextEmphasisPosition: | 1934 case CSSPropertyWebkitTextEmphasisPosition: |
| 1934 return cssValuePool().createValue(style.textEmphasisPosition()); | 1935 return cssValuePool().createValue(style.textEmphasisPosition()); |
| 1935 case CSSPropertyWebkitTextEmphasisStyle: | 1936 case CSSPropertyWebkitTextEmphasisStyle: |
| 1936 switch (style.textEmphasisMark()) { | 1937 switch (style.textEmphasisMark()) { |
| 1937 case TextEmphasisMarkNone: | 1938 case TextEmphasisMarkNone: |
| 1938 return cssValuePool().createIdentifierValue(CSSValueNone); | 1939 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1939 case TextEmphasisMarkCustom: | 1940 case TextEmphasisMarkCustom: |
| 1940 return cssValuePool().createValue(style.textEmphasisCustomMark(), CS
SPrimitiveValue::UnitType::String); | 1941 return CSSStringValue::create(style.textEmphasisCustomMark(), CSSStr
ingValue::SerializeAsString); |
| 1941 case TextEmphasisMarkAuto: | 1942 case TextEmphasisMarkAuto: |
| 1942 ASSERT_NOT_REACHED(); | 1943 ASSERT_NOT_REACHED(); |
| 1943 // Fall through | 1944 // Fall through |
| 1944 case TextEmphasisMarkDot: | 1945 case TextEmphasisMarkDot: |
| 1945 case TextEmphasisMarkCircle: | 1946 case TextEmphasisMarkCircle: |
| 1946 case TextEmphasisMarkDoubleCircle: | 1947 case TextEmphasisMarkDoubleCircle: |
| 1947 case TextEmphasisMarkTriangle: | 1948 case TextEmphasisMarkTriangle: |
| 1948 case TextEmphasisMarkSesame: { | 1949 case TextEmphasisMarkSesame: { |
| 1949 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); | 1950 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSep
arated(); |
| 1950 list->append(cssValuePool().createValue(style.textEmphasisFill())); | 1951 list->append(cssValuePool().createValue(style.textEmphasisFill())); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 } else { | 2109 } else { |
| 2109 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); | 2110 list->append(cssValuePool().createValue(CSSAnimationData::initialIte
rationCount(), CSSPrimitiveValue::UnitType::Number)); |
| 2110 } | 2111 } |
| 2111 return list.release(); | 2112 return list.release(); |
| 2112 } | 2113 } |
| 2113 case CSSPropertyAnimationName: { | 2114 case CSSPropertyAnimationName: { |
| 2114 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2115 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
| 2115 const CSSAnimationData* animationData = style.animations(); | 2116 const CSSAnimationData* animationData = style.animations(); |
| 2116 if (animationData) { | 2117 if (animationData) { |
| 2117 for (size_t i = 0; i < animationData->nameList().size(); ++i) | 2118 for (size_t i = 0; i < animationData->nameList().size(); ++i) |
| 2118 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::UnitType::CustomIdentifier)); | 2119 list->append(CSSStringValue::create(animationData->nameList()[i]
, CSSStringValue::SerializeAsCustomIdentifier)); |
| 2119 } else { | 2120 } else { |
| 2120 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 2121 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); |
| 2121 } | 2122 } |
| 2122 return list.release(); | 2123 return list.release(); |
| 2123 } | 2124 } |
| 2124 case CSSPropertyAnimationPlayState: { | 2125 case CSSPropertyAnimationPlayState: { |
| 2125 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); | 2126 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparat
ed(); |
| 2126 const CSSAnimationData* animationData = style.animations(); | 2127 const CSSAnimationData* animationData = style.animations(); |
| 2127 if (animationData) { | 2128 if (animationData) { |
| 2128 for (size_t i = 0; i < animationData->playStateList().size(); ++i) | 2129 for (size_t i = 0; i < animationData->playStateList().size(); ++i) |
| 2129 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); | 2130 list->append(valueForAnimationPlayState(animationData->playState
List()[i])); |
| 2130 } else { | 2131 } else { |
| 2131 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); | 2132 list->append(cssValuePool().createIdentifierValue(CSSValueRunning)); |
| 2132 } | 2133 } |
| 2133 return list.release(); | 2134 return list.release(); |
| 2134 } | 2135 } |
| 2135 case CSSPropertyAnimationTimingFunction: | 2136 case CSSPropertyAnimationTimingFunction: |
| 2136 return valueForAnimationTimingFunction(style.animations()); | 2137 return valueForAnimationTimingFunction(style.animations()); |
| 2137 case CSSPropertyAnimation: { | 2138 case CSSPropertyAnimation: { |
| 2138 const CSSAnimationData* animationData = style.animations(); | 2139 const CSSAnimationData* animationData = style.animations(); |
| 2139 if (animationData) { | 2140 if (animationData) { |
| 2140 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea
teCommaSeparated(); | 2141 RefPtrWillBeRawPtr<CSSValueList> animationsList = CSSValueList::crea
teCommaSeparated(); |
| 2141 for (size_t i = 0; i < animationData->nameList().size(); ++i) { | 2142 for (size_t i = 0; i < animationData->nameList().size(); ++i) { |
| 2142 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); | 2143 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac
eSeparated(); |
| 2143 list->append(cssValuePool().createValue(animationData->nameList(
)[i], CSSPrimitiveValue::UnitType::CustomIdentifier)); | 2144 list->append(CSSStringValue::create(animationData->nameList()[i]
, CSSStringValue::SerializeAsCustomIdentifier)); |
| 2144 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2145 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->durationList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
| 2145 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); | 2146 list->append(createTimingFunctionValue(CSSTimingData::getRepeate
d(animationData->timingFunctionList(), i).get())); |
| 2146 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); | 2147 list->append(cssValuePool().createValue(CSSTimingData::getRepeat
ed(animationData->delayList(), i), CSSPrimitiveValue::UnitType::Seconds)); |
| 2147 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); | 2148 list->append(valueForAnimationIterationCount(CSSTimingData::getR
epeated(animationData->iterationCountList(), i))); |
| 2148 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); | 2149 list->append(valueForAnimationDirection(CSSTimingData::getRepeat
ed(animationData->directionList(), i))); |
| 2149 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); | 2150 list->append(valueForAnimationFillMode(CSSTimingData::getRepeate
d(animationData->fillModeList(), i))); |
| 2150 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); | 2151 list->append(valueForAnimationPlayState(CSSTimingData::getRepeat
ed(animationData->playStateList(), i))); |
| 2151 animationsList->append(list); | 2152 animationsList->append(list); |
| 2152 } | 2153 } |
| 2153 return animationsList.release(); | 2154 return animationsList.release(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2317 return valueForContentData(style); | 2318 return valueForContentData(style); |
| 2318 case CSSPropertyCounterIncrement: | 2319 case CSSPropertyCounterIncrement: |
| 2319 return valueForCounterDirectives(style, propertyID); | 2320 return valueForCounterDirectives(style, propertyID); |
| 2320 case CSSPropertyCounterReset: | 2321 case CSSPropertyCounterReset: |
| 2321 return valueForCounterDirectives(style, propertyID); | 2322 return valueForCounterDirectives(style, propertyID); |
| 2322 case CSSPropertyWebkitClipPath: | 2323 case CSSPropertyWebkitClipPath: |
| 2323 if (ClipPathOperation* operation = style.clipPath()) { | 2324 if (ClipPathOperation* operation = style.clipPath()) { |
| 2324 if (operation->type() == ClipPathOperation::SHAPE) | 2325 if (operation->type() == ClipPathOperation::SHAPE) |
| 2325 return valueForBasicShape(style, toShapeClipPathOperation(operat
ion)->basicShape()); | 2326 return valueForBasicShape(style, toShapeClipPathOperation(operat
ion)->basicShape()); |
| 2326 if (operation->type() == ClipPathOperation::REFERENCE) | 2327 if (operation->type() == ClipPathOperation::REFERENCE) |
| 2327 return CSSPrimitiveValue::create(toReferenceClipPathOperation(op
eration)->url(), CSSPrimitiveValue::UnitType::URI); | 2328 return CSSStringValue::create(toReferenceClipPathOperation(opera
tion)->url(), CSSStringValue::SerializeAsURI); |
| 2328 } | 2329 } |
| 2329 return cssValuePool().createIdentifierValue(CSSValueNone); | 2330 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 2330 case CSSPropertyShapeMargin: | 2331 case CSSPropertyShapeMargin: |
| 2331 return cssValuePool().createValue(style.shapeMargin(), style); | 2332 return cssValuePool().createValue(style.shapeMargin(), style); |
| 2332 case CSSPropertyShapeImageThreshold: | 2333 case CSSPropertyShapeImageThreshold: |
| 2333 return cssValuePool().createValue(style.shapeImageThreshold(), CSSPrimit
iveValue::UnitType::Number); | 2334 return cssValuePool().createValue(style.shapeImageThreshold(), CSSPrimit
iveValue::UnitType::Number); |
| 2334 case CSSPropertyShapeOutside: | 2335 case CSSPropertyShapeOutside: |
| 2335 return valueForShape(style, style.shapeOutside()); | 2336 return valueForShape(style, style.shapeOutside()); |
| 2336 case CSSPropertyWebkitFilter: | 2337 case CSSPropertyWebkitFilter: |
| 2337 return valueForFilter(style); | 2338 return valueForFilter(style); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 case CSSPropertyAlignmentBaseline: | 2520 case CSSPropertyAlignmentBaseline: |
| 2520 return CSSPrimitiveValue::create(svgStyle.alignmentBaseline()); | 2521 return CSSPrimitiveValue::create(svgStyle.alignmentBaseline()); |
| 2521 case CSSPropertyDominantBaseline: | 2522 case CSSPropertyDominantBaseline: |
| 2522 return CSSPrimitiveValue::create(svgStyle.dominantBaseline()); | 2523 return CSSPrimitiveValue::create(svgStyle.dominantBaseline()); |
| 2523 case CSSPropertyTextAnchor: | 2524 case CSSPropertyTextAnchor: |
| 2524 return CSSPrimitiveValue::create(svgStyle.textAnchor()); | 2525 return CSSPrimitiveValue::create(svgStyle.textAnchor()); |
| 2525 case CSSPropertyWritingMode: | 2526 case CSSPropertyWritingMode: |
| 2526 return CSSPrimitiveValue::create(svgStyle.writingMode()); | 2527 return CSSPrimitiveValue::create(svgStyle.writingMode()); |
| 2527 case CSSPropertyClipPath: | 2528 case CSSPropertyClipPath: |
| 2528 if (!svgStyle.clipperResource().isEmpty()) | 2529 if (!svgStyle.clipperResource().isEmpty()) |
| 2529 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.clipperResource()), CSSPrimitiveValue::UnitType::URI); | 2530 return CSSStringValue::create(serializeAsFragmentIdentifier(svgStyle
.clipperResource()), CSSStringValue::SerializeAsURI); |
| 2530 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2531 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 2531 case CSSPropertyMask: | 2532 case CSSPropertyMask: |
| 2532 if (!svgStyle.maskerResource().isEmpty()) | 2533 if (!svgStyle.maskerResource().isEmpty()) |
| 2533 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.maskerResource()), CSSPrimitiveValue::UnitType::URI); | 2534 return CSSStringValue::create(serializeAsFragmentIdentifier(svgStyle
.maskerResource()), CSSStringValue::SerializeAsURI); |
| 2534 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2535 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 2535 case CSSPropertyFilter: | 2536 case CSSPropertyFilter: |
| 2536 if (!svgStyle.filterResource().isEmpty()) | 2537 if (!svgStyle.filterResource().isEmpty()) |
| 2537 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.filterResource()), CSSPrimitiveValue::UnitType::URI); | 2538 return CSSStringValue::create(serializeAsFragmentIdentifier(svgStyle
.filterResource()), CSSStringValue::SerializeAsURI); |
| 2538 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2539 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 2539 case CSSPropertyFloodColor: | 2540 case CSSPropertyFloodColor: |
| 2540 return currentColorOrValidColor(style, svgStyle.floodColor()); | 2541 return currentColorOrValidColor(style, svgStyle.floodColor()); |
| 2541 case CSSPropertyLightingColor: | 2542 case CSSPropertyLightingColor: |
| 2542 return currentColorOrValidColor(style, svgStyle.lightingColor()); | 2543 return currentColorOrValidColor(style, svgStyle.lightingColor()); |
| 2543 case CSSPropertyStopColor: | 2544 case CSSPropertyStopColor: |
| 2544 return currentColorOrValidColor(style, svgStyle.stopColor()); | 2545 return currentColorOrValidColor(style, svgStyle.stopColor()); |
| 2545 case CSSPropertyFill: | 2546 case CSSPropertyFill: |
| 2546 return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle.
fillPaintUri(), svgStyle.fillPaintColor(), style.color()); | 2547 return adjustSVGPaintForCurrentColor(svgStyle.fillPaintType(), svgStyle.
fillPaintUri(), svgStyle.fillPaintColor(), style.color()); |
| 2547 case CSSPropertyMarkerEnd: | 2548 case CSSPropertyMarkerEnd: |
| 2548 if (!svgStyle.markerEndResource().isEmpty()) | 2549 if (!svgStyle.markerEndResource().isEmpty()) |
| 2549 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerEndResource()), CSSPrimitiveValue::UnitType::URI); | 2550 return CSSStringValue::create(serializeAsFragmentIdentifier(svgStyle
.markerEndResource()), CSSStringValue::SerializeAsURI); |
| 2550 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2551 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 2551 case CSSPropertyMarkerMid: | 2552 case CSSPropertyMarkerMid: |
| 2552 if (!svgStyle.markerMidResource().isEmpty()) | 2553 if (!svgStyle.markerMidResource().isEmpty()) |
| 2553 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerMidResource()), CSSPrimitiveValue::UnitType::URI); | 2554 return CSSStringValue::create(serializeAsFragmentIdentifier(svgStyle
.markerMidResource()), CSSStringValue::SerializeAsURI); |
| 2554 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2555 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 2555 case CSSPropertyMarkerStart: | 2556 case CSSPropertyMarkerStart: |
| 2556 if (!svgStyle.markerStartResource().isEmpty()) | 2557 if (!svgStyle.markerStartResource().isEmpty()) |
| 2557 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerStartResource()), CSSPrimitiveValue::UnitType::URI); | 2558 return CSSStringValue::create(serializeAsFragmentIdentifier(svgStyle
.markerStartResource()), CSSStringValue::SerializeAsURI); |
| 2558 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2559 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 2559 case CSSPropertyStroke: | 2560 case CSSPropertyStroke: |
| 2560 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl
e.strokePaintUri(), svgStyle.strokePaintColor(), style.color()); | 2561 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl
e.strokePaintUri(), svgStyle.strokePaintColor(), style.color()); |
| 2561 case CSSPropertyStrokeDasharray: | 2562 case CSSPropertyStrokeDasharray: |
| 2562 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style)
; | 2563 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style)
; |
| 2563 case CSSPropertyStrokeDashoffset: | 2564 case CSSPropertyStrokeDashoffset: |
| 2564 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl
e); | 2565 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl
e); |
| 2565 case CSSPropertyStrokeWidth: | 2566 case CSSPropertyStrokeWidth: |
| 2566 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style); | 2567 return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style); |
| 2567 case CSSPropertyBaselineShift: { | 2568 case CSSPropertyBaselineShift: { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2673 case CSSPropertyAll: | 2674 case CSSPropertyAll: |
| 2674 return nullptr; | 2675 return nullptr; |
| 2675 default: | 2676 default: |
| 2676 break; | 2677 break; |
| 2677 } | 2678 } |
| 2678 ASSERT_NOT_REACHED(); | 2679 ASSERT_NOT_REACHED(); |
| 2679 return nullptr; | 2680 return nullptr; |
| 2680 } | 2681 } |
| 2681 | 2682 |
| 2682 } | 2683 } |
| OLD | NEW |