Changeset 69937 in webkit


Ignore:
Timestamp:
Oct 17, 2010 6:22:44 PM (14 years ago)
Author:
jchaffraix@webkit.org
Message:

WebCore: 'transparent' should be a valid color
https://bugs.webkit.org/show_bug.cgi?id=45482

Reviewed by Andreas Kling.

Test: svg/animations/svg-animate-color-transparent.svg

Based on previous work by Jan Erik Hanssen <jhanssen@codeaurora.org>

  • platform/ColorData.gperf: Added 'transparent' to the list of colors.

Added the alpha to all the colors as it was needed to support the new color.

  • platform/graphics/Color.cpp:

(WebCore::Color::Color):
(WebCore::Color::setNamedColor): Avoid setting the alpha as now it is not
always 0xFF.

LayoutTests: Test for: 'transparent' should be a valid color
https://bugs.webkit.org/show_bug.cgi?id=45482

Reviewed by Andreas Kling.

Test that animation works with 'transparent' as they check the validity of the
color.

  • svg/animations/svg-animate-color-transparent-expected.txt: Added.
  • svg/animations/svg-animate-color-transparent.svg: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69936 r69937  
     12010-10-17  Julien Chaffraix  <jchaffraix@codeaurora.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        Test for: 'transparent' should be a valid color
     6        https://bugs.webkit.org/show_bug.cgi?id=45482
     7
     8        Test that animation works with 'transparent' as they check the validity of the
     9        color.
     10
     11        * svg/animations/svg-animate-color-transparent-expected.txt: Added.
     12        * svg/animations/svg-animate-color-transparent.svg: Added.
     13
    1142010-10-17  Justin Schuh  <jschuh@chromium.org>
    215
  • trunk/WebCore/ChangeLog

    r69936 r69937  
     12010-10-17  Julien Chaffraix  <jchaffraix@codeaurora.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        'transparent' should be a valid color
     6        https://bugs.webkit.org/show_bug.cgi?id=45482
     7
     8        Test: svg/animations/svg-animate-color-transparent.svg
     9
     10        Based on previous work by Jan Erik Hanssen  <jhanssen@codeaurora.org>
     11
     12        * platform/ColorData.gperf: Added 'transparent' to the list of colors.
     13        Added the alpha to all the colors as it was needed to support the new color.
     14
     15        * platform/graphics/Color.cpp:
     16        (WebCore::Color::Color):
     17        (WebCore::Color::setNamedColor): Avoid setting the alpha as now it is not
     18        always 0xFF.
     19
    1202010-10-17  Justin Schuh  <jschuh@chromium.org>
    221
  • trunk/WebCore/make-hash-tools.pl

    r68563 r69937  
    5757struct NamedColor {
    5858    const char* name;
    59     int RGBValue;
     59    unsigned ARGBValue;
    6060};
    6161
  • trunk/WebCore/platform/ColorData.gperf

    r68563 r69937  
    1111%enum
    1212%%
    13 aliceblue, 0xf0f8ff
    14 antiquewhite, 0xfaebd7
    15 aqua, 0x00ffff
    16 aquamarine, 0x7fffd4
    17 azure, 0xf0ffff
    18 beige, 0xf5f5dc
    19 bisque, 0xffe4c4
    20 black, 0x000000
    21 blanchedalmond, 0xffebcd
    22 blue, 0x0000ff
    23 blueviolet, 0x8a2be2
    24 brown, 0xa52a2a
    25 burlywood, 0xdeb887
    26 cadetblue, 0x5f9ea0
    27 chartreuse, 0x7fff00
    28 chocolate, 0xd2691e
    29 coral, 0xff7f50
    30 cornflowerblue, 0x6495ed
    31 cornsilk, 0xfff8dc
    32 crimson, 0xdc143c
    33 cyan, 0x00ffff
    34 darkblue, 0x00008b
    35 darkcyan, 0x008b8b
    36 darkgoldenrod, 0xb8860b
    37 darkgray, 0xa9a9a9
    38 darkgrey, 0xa9a9a9
    39 darkgreen, 0x006400
    40 darkkhaki, 0xbdb76b
    41 darkmagenta, 0x8b008b
    42 darkolivegreen, 0x556b2f
    43 darkorange, 0xff8c00
    44 darkorchid, 0x9932cc
    45 darkred, 0x8b0000
    46 darksalmon, 0xe9967a
    47 darkseagreen, 0x8fbc8f
    48 darkslateblue, 0x483d8b
    49 darkslategray, 0x2f4f4f
    50 darkslategrey, 0x2f4f4f
    51 darkturquoise, 0x00ced1
    52 darkviolet, 0x9400d3
    53 deeppink, 0xff1493
    54 deepskyblue, 0x00bfff
    55 dimgray, 0x696969
    56 dimgrey, 0x696969
    57 dodgerblue, 0x1e90ff
    58 firebrick, 0xb22222
    59 floralwhite, 0xfffaf0
    60 forestgreen, 0x228b22
    61 fuchsia, 0xff00ff
    62 gainsboro, 0xdcdcdc
    63 ghostwhite, 0xf8f8ff
    64 gold, 0xffd700
    65 goldenrod, 0xdaa520
    66 gray, 0x808080
    67 grey, 0x808080
    68 green, 0x008000
    69 greenyellow, 0xadff2f
    70 honeydew, 0xf0fff0
    71 hotpink, 0xff69b4
    72 indianred, 0xcd5c5c
    73 indigo, 0x4b0082
    74 ivory, 0xfffff0
    75 khaki, 0xf0e68c
    76 lavender, 0xe6e6fa
    77 lavenderblush, 0xfff0f5
    78 lawngreen, 0x7cfc00
    79 lemonchiffon, 0xfffacd
    80 lightblue, 0xadd8e6
    81 lightcoral, 0xf08080
    82 lightcyan, 0xe0ffff
    83 lightgoldenrodyellow, 0xfafad2
    84 lightgray, 0xd3d3d3
    85 lightgrey, 0xd3d3d3
    86 lightgreen, 0x90ee90
    87 lightpink, 0xffb6c1
    88 lightsalmon, 0xffa07a
    89 lightseagreen, 0x20b2aa
    90 lightskyblue, 0x87cefa
    91 lightslateblue, 0x8470ff
    92 lightslategray, 0x778899
    93 lightslategrey, 0x778899
    94 lightsteelblue, 0xb0c4de
    95 lightyellow, 0xffffe0
    96 lime, 0x00ff00
    97 limegreen, 0x32cd32
    98 linen, 0xfaf0e6
    99 magenta, 0xff00ff
    100 maroon, 0x800000
    101 mediumaquamarine, 0x66cdaa
    102 mediumblue, 0x0000cd
    103 mediumorchid, 0xba55d3
    104 mediumpurple, 0x9370d8
    105 mediumseagreen, 0x3cb371
    106 mediumslateblue, 0x7b68ee
    107 mediumspringgreen, 0x00fa9a
    108 mediumturquoise, 0x48d1cc
    109 mediumvioletred, 0xc71585
    110 midnightblue, 0x191970
    111 mintcream, 0xf5fffa
    112 mistyrose, 0xffe4e1
    113 moccasin, 0xffe4b5
    114 navajowhite, 0xffdead
    115 navy, 0x000080
    116 oldlace, 0xfdf5e6
    117 olive, 0x808000
    118 olivedrab, 0x6b8e23
    119 orange, 0xffa500
    120 orangered, 0xff4500
    121 orchid, 0xda70d6
    122 palegoldenrod, 0xeee8aa
    123 palegreen, 0x98fb98
    124 paleturquoise, 0xafeeee
    125 palevioletred, 0xd87093
    126 papayawhip, 0xffefd5
    127 peachpuff, 0xffdab9
    128 peru, 0xcd853f
    129 pink, 0xffc0cb
    130 plum, 0xdda0dd
    131 powderblue, 0xb0e0e6
    132 purple, 0x800080
    133 red, 0xff0000
    134 rosybrown, 0xbc8f8f
    135 royalblue, 0x4169e1
    136 saddlebrown, 0x8b4513
    137 salmon, 0xfa8072
    138 sandybrown, 0xf4a460
    139 seagreen, 0x2e8b57
    140 seashell, 0xfff5ee
    141 sienna, 0xa0522d
    142 silver, 0xc0c0c0
    143 skyblue, 0x87ceeb
    144 slateblue, 0x6a5acd
    145 slategray, 0x708090
    146 slategrey, 0x708090
    147 snow, 0xfffafa
    148 springgreen, 0x00ff7f
    149 steelblue, 0x4682b4
    150 tan, 0xd2b48c
    151 teal, 0x008080
    152 thistle, 0xd8bfd8
    153 tomato, 0xff6347
    154 turquoise, 0x40e0d0
    155 violet, 0xee82ee
    156 violetred, 0xd02090
    157 wheat, 0xf5deb3
    158 white, 0xffffff
    159 whitesmoke, 0xf5f5f5
    160 yellow, 0xffff00
    161 yellowgreen, 0x9acd32
     13aliceblue, 0xfff0f8ff
     14antiquewhite, 0xfffaebd7
     15aqua, 0xff00ffff
     16aquamarine, 0xff7fffd4
     17azure, 0xfff0ffff
     18beige, 0xfff5f5dc
     19bisque, 0xffffe4c4
     20black, 0xff000000
     21blanchedalmond, 0xffffebcd
     22blue, 0xff0000ff
     23blueviolet, 0xff8a2be2
     24brown, 0xffa52a2a
     25burlywood, 0xffdeb887
     26cadetblue, 0xff5f9ea0
     27chartreuse, 0xff7fff00
     28chocolate, 0xffd2691e
     29coral, 0xffff7f50
     30cornflowerblue, 0xff6495ed
     31cornsilk, 0xfffff8dc
     32crimson, 0xffdc143c
     33cyan, 0xff00ffff
     34darkblue, 0xff00008b
     35darkcyan, 0xff008b8b
     36darkgoldenrod, 0xffb8860b
     37darkgray, 0xffa9a9a9
     38darkgrey, 0xffa9a9a9
     39darkgreen, 0xff006400
     40darkkhaki, 0xffbdb76b
     41darkmagenta, 0xff8b008b
     42darkolivegreen, 0xff556b2f
     43darkorange, 0xffff8c00
     44darkorchid, 0xff9932cc
     45darkred, 0xff8b0000
     46darksalmon, 0xffe9967a
     47darkseagreen, 0xff8fbc8f
     48darkslateblue, 0xff483d8b
     49darkslategray, 0xff2f4f4f
     50darkslategrey, 0xff2f4f4f
     51darkturquoise, 0xff00ced1
     52darkviolet, 0xff9400d3
     53deeppink, 0xffff1493
     54deepskyblue, 0xff00bfff
     55dimgray, 0xff696969
     56dimgrey, 0xff696969
     57dodgerblue, 0xff1e90ff
     58firebrick, 0xffb22222
     59floralwhite, 0xfffffaf0
     60forestgreen, 0xff228b22
     61fuchsia, 0xffff00ff
     62gainsboro, 0xffdcdcdc
     63ghostwhite, 0xfff8f8ff
     64gold, 0xffffd700
     65goldenrod, 0xffdaa520
     66gray, 0xff808080
     67grey, 0xff808080
     68green, 0xff008000
     69greenyellow, 0xffadff2f
     70honeydew, 0xfff0fff0
     71hotpink, 0xffff69b4
     72indianred, 0xffcd5c5c
     73indigo, 0xff4b0082
     74ivory, 0xfffffff0
     75khaki, 0xfff0e68c
     76lavender, 0xffe6e6fa
     77lavenderblush, 0xfffff0f5
     78lawngreen, 0xff7cfc00
     79lemonchiffon, 0xfffffacd
     80lightblue, 0xffadd8e6
     81lightcoral, 0xfff08080
     82lightcyan, 0xffe0ffff
     83lightgoldenrodyellow, 0xfffafad2
     84lightgray, 0xffd3d3d3
     85lightgrey, 0xffd3d3d3
     86lightgreen, 0xff90ee90
     87lightpink, 0xffffb6c1
     88lightsalmon, 0xffffa07a
     89lightseagreen, 0xff20b2aa
     90lightskyblue, 0xff87cefa
     91lightslateblue, 0xff8470ff
     92lightslategray, 0xff778899
     93lightslategrey, 0xff778899
     94lightsteelblue, 0xffb0c4de
     95lightyellow, 0xffffffe0
     96lime, 0xff00ff00
     97limegreen, 0xff32cd32
     98linen, 0xfffaf0e6
     99magenta, 0xffff00ff
     100maroon, 0xff800000
     101mediumaquamarine, 0xff66cdaa
     102mediumblue, 0xff0000cd
     103mediumorchid, 0xffba55d3
     104mediumpurple, 0xff9370d8
     105mediumseagreen, 0xff3cb371
     106mediumslateblue, 0xff7b68ee
     107mediumspringgreen, 0xff00fa9a
     108mediumturquoise, 0xff48d1cc
     109mediumvioletred, 0xffc71585
     110midnightblue, 0xff191970
     111mintcream, 0xfff5fffa
     112mistyrose, 0xffffe4e1
     113moccasin, 0xffffe4b5
     114navajowhite, 0xffffdead
     115navy, 0xff000080
     116oldlace, 0xfffdf5e6
     117olive, 0xff808000
     118olivedrab, 0xff6b8e23
     119orange, 0xffffa500
     120orangered, 0xffff4500
     121orchid, 0xffda70d6
     122palegoldenrod, 0xffeee8aa
     123palegreen, 0xff98fb98
     124paleturquoise, 0xffafeeee
     125palevioletred, 0xffd87093
     126papayawhip, 0xffffefd5
     127peachpuff, 0xffffdab9
     128peru, 0xffcd853f
     129pink, 0xffffc0cb
     130plum, 0xffdda0dd
     131powderblue, 0xffb0e0e6
     132purple, 0xff800080
     133red, 0xffff0000
     134rosybrown, 0xffbc8f8f
     135royalblue, 0xff4169e1
     136saddlebrown, 0xff8b4513
     137salmon, 0xfffa8072
     138sandybrown, 0xfff4a460
     139seagreen, 0xff2e8b57
     140seashell, 0xfffff5ee
     141sienna, 0xffa0522d
     142silver, 0xffc0c0c0
     143skyblue, 0xff87ceeb
     144slateblue, 0xff6a5acd
     145slategray, 0xff708090
     146slategrey, 0xff708090
     147snow, 0xfffffafa
     148springgreen, 0xff00ff7f
     149steelblue, 0xff4682b4
     150tan, 0xffd2b48c
     151teal, 0xff008080
     152thistle, 0xffd8bfd8
     153tomato, 0xffff6347
     154transparent, 0x00000000
     155turquoise, 0xff40e0d0
     156violet, 0xffee82ee
     157violetred, 0xffd02090
     158wheat, 0xfff5deb3
     159white, 0xffffffff
     160whitesmoke, 0xfff5f5f5
     161yellow, 0xffffff00
     162yellowgreen, 0xff9acd32
  • trunk/WebCore/platform/graphics/Color.cpp

    r68521 r69937  
    176176    else {
    177177        const NamedColor* foundColor = findColor(name, strlen(name));
    178         m_color = foundColor ? foundColor->RGBValue : 0;
    179         m_color |= 0xFF000000;
     178        m_color = foundColor ? foundColor->ARGBValue : 0;
    180179        m_valid = foundColor;
    181180    }
     
    220219{
    221220    const NamedColor* foundColor = findNamedColor(name);
    222     m_color = foundColor ? foundColor->RGBValue : 0;
    223     m_color |= 0xFF000000;
     221    m_color = foundColor ? foundColor->ARGBValue : 0;
    224222    m_valid = foundColor;
    225223}
Note: See TracChangeset for help on using the changeset viewer.