Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: Source/core/svg/SVGColor.cpp

Issue 183973036: Remove some SVG API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Retry Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/svg/SVGColor.h ('k') | Source/core/svg/SVGPaint.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGColor.h ('k') | Source/core/svg/SVGPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698