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. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
8 * Copyright (C) 2015 Google Inc. All rights reserved. | 8 * Copyright (C) 2015 Google Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 | 1684 |
1685 return list; | 1685 return list; |
1686 } | 1686 } |
1687 | 1687 |
1688 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, | 1688 static CSSValue* adjustSVGPaintForCurrentColor(SVGPaintType paintType, |
1689 const String& url, | 1689 const String& url, |
1690 const Color& color, | 1690 const Color& color, |
1691 const Color& currentColor) { | 1691 const Color& currentColor) { |
1692 if (paintType >= SVG_PAINTTYPE_URI_NONE) { | 1692 if (paintType >= SVG_PAINTTYPE_URI_NONE) { |
1693 CSSValueList* values = CSSValueList::createSpaceSeparated(); | 1693 CSSValueList* values = CSSValueList::createSpaceSeparated(); |
1694 values->append(*CSSURIValue::create(url)); | 1694 values->append(*CSSURIValue::create(AtomicString(url))); |
1695 if (paintType == SVG_PAINTTYPE_URI_NONE) | 1695 if (paintType == SVG_PAINTTYPE_URI_NONE) |
1696 values->append(*CSSIdentifierValue::create(CSSValueNone)); | 1696 values->append(*CSSIdentifierValue::create(CSSValueNone)); |
1697 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) | 1697 else if (paintType == SVG_PAINTTYPE_URI_CURRENTCOLOR) |
1698 values->append(*CSSColorValue::create(currentColor.rgb())); | 1698 values->append(*CSSColorValue::create(currentColor.rgb())); |
1699 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) | 1699 else if (paintType == SVG_PAINTTYPE_URI_RGBCOLOR) |
1700 values->append(*CSSColorValue::create(color.rgb())); | 1700 values->append(*CSSColorValue::create(color.rgb())); |
1701 return values; | 1701 return values; |
1702 } | 1702 } |
1703 if (paintType == SVG_PAINTTYPE_NONE) | 1703 if (paintType == SVG_PAINTTYPE_NONE) |
1704 return CSSIdentifierValue::create(CSSValueNone); | 1704 return CSSIdentifierValue::create(CSSValueNone); |
1705 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) | 1705 if (paintType == SVG_PAINTTYPE_CURRENTCOLOR) |
1706 return CSSColorValue::create(currentColor.rgb()); | 1706 return CSSColorValue::create(currentColor.rgb()); |
1707 | 1707 |
1708 return CSSColorValue::create(color.rgb()); | 1708 return CSSColorValue::create(color.rgb()); |
1709 } | 1709 } |
1710 | 1710 |
1711 static inline String serializeAsFragmentIdentifier( | 1711 static inline AtomicString serializeAsFragmentIdentifier( |
1712 const AtomicString& resource) { | 1712 const AtomicString& resource) { |
1713 return "#" + resource; | 1713 return "#" + resource; |
1714 } | 1714 } |
1715 | 1715 |
1716 CSSValue* ComputedStyleCSSValueMapping::valueForShadowData( | 1716 CSSValue* ComputedStyleCSSValueMapping::valueForShadowData( |
1717 const ShadowData& shadow, | 1717 const ShadowData& shadow, |
1718 const ComputedStyle& style, | 1718 const ComputedStyle& style, |
1719 bool useSpread) { | 1719 bool useSpread) { |
1720 CSSPrimitiveValue* x = zoomAdjustedPixelValue(shadow.x(), style); | 1720 CSSPrimitiveValue* x = zoomAdjustedPixelValue(shadow.x(), style); |
1721 CSSPrimitiveValue* y = zoomAdjustedPixelValue(shadow.y(), style); | 1721 CSSPrimitiveValue* y = zoomAdjustedPixelValue(shadow.y(), style); |
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3189 return valueForContentData(style); | 3189 return valueForContentData(style); |
3190 case CSSPropertyCounterIncrement: | 3190 case CSSPropertyCounterIncrement: |
3191 return valueForCounterDirectives(style, propertyID); | 3191 return valueForCounterDirectives(style, propertyID); |
3192 case CSSPropertyCounterReset: | 3192 case CSSPropertyCounterReset: |
3193 return valueForCounterDirectives(style, propertyID); | 3193 return valueForCounterDirectives(style, propertyID); |
3194 case CSSPropertyClipPath: | 3194 case CSSPropertyClipPath: |
3195 if (ClipPathOperation* operation = style.clipPath()) { | 3195 if (ClipPathOperation* operation = style.clipPath()) { |
3196 if (operation->type() == ClipPathOperation::SHAPE) | 3196 if (operation->type() == ClipPathOperation::SHAPE) |
3197 return valueForBasicShape( | 3197 return valueForBasicShape( |
3198 style, toShapeClipPathOperation(operation)->basicShape()); | 3198 style, toShapeClipPathOperation(operation)->basicShape()); |
3199 if (operation->type() == ClipPathOperation::REFERENCE) | 3199 if (operation->type() == ClipPathOperation::REFERENCE) { |
3200 return CSSURIValue::create( | 3200 return CSSURIValue::create( |
3201 toReferenceClipPathOperation(operation)->url()); | 3201 AtomicString(toReferenceClipPathOperation(operation)->url())); |
| 3202 } |
3202 } | 3203 } |
3203 return CSSIdentifierValue::create(CSSValueNone); | 3204 return CSSIdentifierValue::create(CSSValueNone); |
3204 case CSSPropertyShapeMargin: | 3205 case CSSPropertyShapeMargin: |
3205 return CSSValue::create(style.shapeMargin(), style.effectiveZoom()); | 3206 return CSSValue::create(style.shapeMargin(), style.effectiveZoom()); |
3206 case CSSPropertyShapeImageThreshold: | 3207 case CSSPropertyShapeImageThreshold: |
3207 return CSSPrimitiveValue::create(style.shapeImageThreshold(), | 3208 return CSSPrimitiveValue::create(style.shapeImageThreshold(), |
3208 CSSPrimitiveValue::UnitType::Number); | 3209 CSSPrimitiveValue::UnitType::Number); |
3209 case CSSPropertyShapeOutside: | 3210 case CSSPropertyShapeOutside: |
3210 return valueForShape(style, style.shapeOutside()); | 3211 return valueForShape(style, style.shapeOutside()); |
3211 case CSSPropertyFilter: | 3212 case CSSPropertyFilter: |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3641 case CSSPropertyAll: | 3642 case CSSPropertyAll: |
3642 return nullptr; | 3643 return nullptr; |
3643 default: | 3644 default: |
3644 break; | 3645 break; |
3645 } | 3646 } |
3646 ASSERT_NOT_REACHED(); | 3647 ASSERT_NOT_REACHED(); |
3647 return nullptr; | 3648 return nullptr; |
3648 } | 3649 } |
3649 | 3650 |
3650 } // namespace blink | 3651 } // namespace blink |
OLD | NEW |