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 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 return CSSPrimitiveValue::create(90.0f, CSSPrimitiveValue::CSS_DEG); | 1113 return CSSPrimitiveValue::create(90.0f, CSSPrimitiveValue::CSS_DEG); |
1114 case GO_180DEG: | 1114 case GO_180DEG: |
1115 return CSSPrimitiveValue::create(180.0f, CSSPrimitiveValue::CSS_DEG); | 1115 return CSSPrimitiveValue::create(180.0f, CSSPrimitiveValue::CSS_DEG); |
1116 case GO_270DEG: | 1116 case GO_270DEG: |
1117 return CSSPrimitiveValue::create(270.0f, CSSPrimitiveValue::CSS_DEG); | 1117 return CSSPrimitiveValue::create(270.0f, CSSPrimitiveValue::CSS_DEG); |
1118 default: | 1118 default: |
1119 return nullptr; | 1119 return nullptr; |
1120 } | 1120 } |
1121 } | 1121 } |
1122 | 1122 |
1123 static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(PassRefPtr
WillBeRawPtr<SVGLengthList> passDashes) | 1123 static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGD
ashArray& dashes, const LayoutStyle& style) |
1124 { | 1124 { |
1125 RefPtrWillBeRawPtr<SVGLengthList> dashes = passDashes; | 1125 if (dashes.isEmpty()) |
1126 | |
1127 if (dashes->isEmpty()) | |
1128 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1126 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
1129 | 1127 |
1130 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 1128 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
1131 SVGLengthList::ConstIterator it = dashes->begin(); | 1129 for (const Length& dashLength : dashes.vector()) |
1132 SVGLengthList::ConstIterator itEnd = dashes->end(); | 1130 list->append(zoomAdjustedPixelValueForLength(dashLength, style)); |
1133 for (; it != itEnd; ++it) | |
1134 list->append(SVGLength::toCSSPrimitiveValue(*it)); | |
1135 | 1131 |
1136 return list.release(); | 1132 return list.release(); |
1137 } | 1133 } |
1138 | 1134 |
1139 static PassRefPtrWillBeRawPtr<CSSValue> paintOrderToCSSValueList(EPaintOrder pai
ntorder) | 1135 static PassRefPtrWillBeRawPtr<CSSValue> paintOrderToCSSValueList(EPaintOrder pai
ntorder) |
1140 { | 1136 { |
1141 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1137 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1142 do { | 1138 do { |
1143 EPaintOrderType paintOrderType = (EPaintOrderType)(paintorder & ((1 << k
PaintOrderBitwidth) - 1)); | 1139 EPaintOrderType paintOrderType = (EPaintOrderType)(paintorder & ((1 << k
PaintOrderBitwidth) - 1)); |
1144 switch (paintOrderType) { | 1140 switch (paintOrderType) { |
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 if (!svgStyle.markerMidResource().isEmpty()) | 2507 if (!svgStyle.markerMidResource().isEmpty()) |
2512 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerMidResource()), CSSPrimitiveValue::CSS_URI); | 2508 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerMidResource()), CSSPrimitiveValue::CSS_URI); |
2513 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2509 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2514 case CSSPropertyMarkerStart: | 2510 case CSSPropertyMarkerStart: |
2515 if (!svgStyle.markerStartResource().isEmpty()) | 2511 if (!svgStyle.markerStartResource().isEmpty()) |
2516 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerStartResource()), CSSPrimitiveValue::CSS_URI); | 2512 return CSSPrimitiveValue::create(serializeAsFragmentIdentifier(svgSt
yle.markerStartResource()), CSSPrimitiveValue::CSS_URI); |
2517 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2513 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
2518 case CSSPropertyStroke: | 2514 case CSSPropertyStroke: |
2519 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl
e.strokePaintUri(), svgStyle.strokePaintColor(), style.color()); | 2515 return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyl
e.strokePaintUri(), svgStyle.strokePaintColor(), style.color()); |
2520 case CSSPropertyStrokeDasharray: | 2516 case CSSPropertyStrokeDasharray: |
2521 return strokeDashArrayToCSSValueList(svgStyle.strokeDashArray()); | 2517 return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style)
; |
2522 case CSSPropertyStrokeDashoffset: | 2518 case CSSPropertyStrokeDashoffset: |
2523 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl
e); | 2519 return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), styl
e); |
2524 case CSSPropertyStrokeWidth: | 2520 case CSSPropertyStrokeWidth: |
2525 return SVGLength::toCSSPrimitiveValue(svgStyle.strokeWidth()); | 2521 return SVGLength::toCSSPrimitiveValue(svgStyle.strokeWidth()); |
2526 case CSSPropertyBaselineShift: { | 2522 case CSSPropertyBaselineShift: { |
2527 switch (svgStyle.baselineShift()) { | 2523 switch (svgStyle.baselineShift()) { |
2528 case BS_SUPER: | 2524 case BS_SUPER: |
2529 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); | 2525 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); |
2530 case BS_SUB: | 2526 case BS_SUB: |
2531 return CSSPrimitiveValue::createIdentifier(CSSValueSub); | 2527 return CSSPrimitiveValue::createIdentifier(CSSValueSub); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); | 2562 return zoomAdjustedPixelValueForLength(svgStyle.ry(), style); |
2567 | 2563 |
2568 case CSSPropertyAll: | 2564 case CSSPropertyAll: |
2569 return nullptr; | 2565 return nullptr; |
2570 } | 2566 } |
2571 ASSERT_NOT_REACHED(); | 2567 ASSERT_NOT_REACHED(); |
2572 return nullptr; | 2568 return nullptr; |
2573 } | 2569 } |
2574 | 2570 |
2575 } | 2571 } |
OLD | NEW |