OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 23 matching lines...) Expand all Loading... | |
34 , m_colorType(colorType) | 34 , m_colorType(colorType) |
35 { | 35 { |
36 } | 36 } |
37 | 37 |
38 SVGColor::SVGColor(ClassType classType, const SVGColorType& colorType) | 38 SVGColor::SVGColor(ClassType classType, const SVGColorType& colorType) |
39 : CSSValue(classType) | 39 : CSSValue(classType) |
40 , m_colorType(colorType) | 40 , m_colorType(colorType) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 PassRefPtrWillBeRawPtr<RGBColor> SVGColor::rgbColor() const | |
45 { | |
46 return RGBColor::create(m_color.rgb()); | |
47 } | |
48 | |
49 StyleColor SVGColor::colorFromRGBColorString(const String& colorString) | 44 StyleColor SVGColor::colorFromRGBColorString(const String& colorString) |
50 { | 45 { |
51 // FIXME: Rework css parser so it is more SVG aware. | 46 // FIXME: Rework css parser so it is more SVG aware. |
52 RGBA32 color; | 47 RGBA32 color; |
53 if (BisonCSSParser::parseColor(color, colorString.stripWhiteSpace())) | 48 if (BisonCSSParser::parseColor(color, colorString.stripWhiteSpace())) |
54 return StyleColor(color); | 49 return StyleColor(color); |
55 // FIXME: This branch catches the string currentColor, but we should error i f we have an illegal color value. | 50 // FIXME: This branch catches the string currentColor, but we should error i f we have an illegal color value. |
56 return StyleColor::currentColor(); | 51 return StyleColor::currentColor(); |
57 } | 52 } |
58 | 53 |
59 void SVGColor::setRGBColor(const String&, ExceptionState& exceptionState) | |
pdr.
2014/03/05 22:59:34
This this actually gone? This looks like a user-vi
| |
60 { | |
61 // The whole SVGColor interface is deprecated in SVG 1.1 (2nd edition). | |
62 // The setters are the most problematic part so we remove the support for th ose first. | |
63 exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessag es::readOnly()); | |
64 } | |
65 | |
66 void SVGColor::setRGBColorICCColor(const String&, const String&, ExceptionState& exceptionState) | |
67 { | |
68 exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessag es::readOnly()); | |
69 } | |
70 | |
71 void SVGColor::setColor(unsigned short, const String&, const String&, ExceptionS tate& exceptionState) | |
72 { | |
73 exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessag es::readOnly()); | |
74 } | |
75 | |
76 String SVGColor::customCSSText() const | 54 String SVGColor::customCSSText() const |
77 { | 55 { |
78 switch (m_colorType) { | 56 switch (m_colorType) { |
79 case SVG_COLORTYPE_UNKNOWN: | 57 case SVG_COLORTYPE_UNKNOWN: |
80 return String(); | 58 return String(); |
81 case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: | 59 case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: |
82 case SVG_COLORTYPE_RGBCOLOR: | 60 case SVG_COLORTYPE_RGBCOLOR: |
83 // FIXME: No ICC color support. | 61 // FIXME: No ICC color support. |
84 return m_color.serializedAsCSSComponentValue(); | 62 return m_color.serializedAsCSSComponentValue(); |
85 case SVG_COLORTYPE_CURRENTCOLOR: | 63 case SVG_COLORTYPE_CURRENTCOLOR: |
(...skipping 15 matching lines...) Expand all Loading... | |
101 { | 79 { |
102 return adoptRefWillBeRefCountedGarbageCollected(new SVGColor(SVGColorClass, *this)); | 80 return adoptRefWillBeRefCountedGarbageCollected(new SVGColor(SVGColorClass, *this)); |
103 } | 81 } |
104 | 82 |
105 bool SVGColor::equals(const SVGColor& other) const | 83 bool SVGColor::equals(const SVGColor& other) const |
106 { | 84 { |
107 return m_colorType == other.m_colorType && m_color == other.m_color; | 85 return m_colorType == other.m_colorType && m_color == other.m_color; |
108 } | 86 } |
109 | 87 |
110 } | 88 } |
OLD | NEW |