RFR: JDK-8292276 : Add named colors from CSS Color Module Level 4 [v39]

ScientificWare duke at openjdk.org
Fri Oct 13 08:36:42 UTC 2023


On Fri, 13 Oct 2023 07:50:17 GMT, ScientificWare <duke at openjdk.org> wrote:

>> This is referenced in Java Bug Database as
>> - [JDK-8292276 : Add named colors from CSS Color Module Level 4](https://bugs.java.com/bugdatabase/view_bug?bug_id=8292276)
>> 
>> This is tracked in JBS as 
>> - [JDK-8292276 : Add named colors from CSS Color Module Level 4](https://bugs.openjdk.java.net/browse/JDK-8292276)
>> 
>> Adds missing color names, defined by CSS Level 4, in CSS.java :
>> CSS Color Module Level 4
>> W3C Candidate Recommendation Snapshot, 5 July 2022
>> [7.1 Named Colors](https://www.w3.org/TR/css-color-4/#named-color)
>> 
>> Designed from : [ScientificWare JDK-8292276 : Add named colors from CSS Color Module Level 4](https://github.com/scientificware/jdk/issues/12)
>
> ScientificWare has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 59 commits:
> 
>  - Merge master
>  - CSS.java :
>    - Update source code declaration in documentation comments and specifications.
>    - Typo in an argument.
>  - MissingColorNames.java :
>    - Catches the Color Illegal Argument Exception and appends it to the result summary.
>    - Uncomments rgb tests.
>  - MissingColorNames.java :
>    - Rename the color which doesn't belong to CSS-COLOR-4 specification.
>  - Merge master
>  - MissingColorNames.java :
>    - Add a subset of RGB and RGBA tests.
>  - MissingColorNames.java :
>    - rename the list of string test.
>    
>    CSS.java :
>    - correct a wrong index.
>  - MissingColorNames.java : Adds a subset of hexadecimal tests.
>  - Merge scientificware-patch-003-CSS-add_4_8_digits_hex_coded_color
>    
>    # Conflicts:
>    #	src/java.desktop/share/classes/javax/swing/text/html/CSS.java
>  - Merge master
>  - ... and 49 more: https://git.openjdk.org/jdk/compare/1082c0e7...9898fedf

Test output before the patch.

Exception in thread "main" java.lang.RuntimeException: Failed.
          [aliceblue is not supported] 
          [antiquewhite is not supported] 
          [aquamarine is not supported] 
          [azure is not supported] 
          [beige is not supported] 
          [bisque is not supported] 
          [blanchedalmond is not supported] 
          [blueviolet is not supported] 
          [brown is not supported] 
          [burlywood is not supported] 
          [cadetblue is not supported] 
          [chartreuse is not supported] 
          [chocolate is not supported] 
          [coral is not supported] 
          [cornflowerblue is not supported] 
          [cornsilk is not supported] 
          [crimson is not supported] 
          [cyan is not supported] 
          [darkblue is not supported] 
          [darkcyan is not supported] 
          [darkgoldenrod is not supported] 
          [darkgray is not supported] 
          [darkgreen is not supported] 
          [darkgrey is not supported] 
          [darkkhaki is not supported] 
          [darkmagenta is not supported] 
          [darkolivegreen is not supported] 
          [darkorange is not supported] 
          [darkorchid is not supported] 
          [darkred is not supported] 
          [darksalmon is not supported] 
          [darkseagreen is not supported] 
          [darkslateblue is not supported] 
          [darkslategray is not supported] 
          [darkslategrey is not supported] 
          [darkturquoise is not supported] 
          [darkviolet is not supported] 
          [deeppink is not supported] 
          [deepskyblue is not supported] 
          [dimgray is not supported] 
          [dimgrey is not supported] 
          [dodgerblue is not supported] 
          [firebrick is not supported] 
          [floralwhite is not supported] 
          [forestgreen is not supported] 
          [gainsboro is not supported] 
          [ghostwhite is not supported] 
          [gold is not supported] 
          [goldenrod is not supported] 
          [greenyellow is not supported] 
          [grey is not supported] 
          [honeydew is not supported] 
          [hotpink is not supported] 
          [indianred is not supported] 
          [indigo is not supported] 
          [ivory is not supported] 
          [khaki is not supported] 
          [lavender is not supported] 
          [lavenderblush is not supported] 
          [lawngreen is not supported] 
          [lemonchiffon is not supported] 
          [lightblue is not supported] 
          [lightcoral is not supported] 
          [lightcyan is not supported] 
          [lightgoldenrodyellow is not supported] 
          [lightgray is not supported] 
          [lightgreen is not supported] 
          [lightgrey is not supported] 
          [lightpink is not supported] 
          [lightsalmon is not supported] 
          [lightseagreen is not supported] 
          [lightskyblue is not supported] 
          [lightslategray is not supported] 
          [lightslategrey is not supported] 
          [lightsteelblue is not supported] 
          [lightyellow is not supported] 
          [limegreen is not supported] 
          [linen is not supported] 
          [magenta is not supported] 
          [mediumaquamarine is not supported] 
          [mediumblue is not supported] 
          [mediumorchid is not supported] 
          [mediumpurple is not supported] 
          [mediumseagreen is not supported] 
          [mediumslateblue is not supported] 
          [mediumspringgreen is not supported] 
          [mediumturquoise is not supported] 
          [mediumvioletred is not supported] 
          [midnightblue is not supported] 
          [mintcream is not supported] 
          [mistyrose is not supported] 
          [moccasin is not supported] 
          [navajowhite is not supported] 
          [oldlace is not supported] 
          [olivedrab is not supported] 
       -> [ orange wrong RGB code ] expected ffffa500, returned ffff8000
          [orangered is not supported] 
          [orchid is not supported] 
          [palegoldenrod is not supported] 
          [palegreen is not supported] 
          [paleturquoise is not supported] 
          [palevioletred is not supported] 
          [papayawhip is not supported] 
          [peachpuff is not supported] 
          [peru is not supported] 
          [pink is not supported] 
          [plum is not supported] 
          [powderblue is not supported] 
          [rebeccapurple is not supported] 
          [rosybrown is not supported] 
          [royalblue is not supported] 
          [saddlebrown is not supported] 
          [salmon is not supported] 
          [sandybrown is not supported] 
          [seagreen is not supported] 
          [seashell is not supported] 
          [sienna is not supported] 
          [skyblue is not supported] 
          [slateblue is not supported] 
          [slategray is not supported] 
          [slategrey is not supported] 
          [snow is not supported] 
          [springgreen is not supported] 
          [steelblue is not supported] 
          [tan is not supported] 
          [thistle is not supported] 
          [tomato is not supported] 
          [transparent is not supported] 
          [turquoise is not supported] 
          [violet is not supported] 
          [wheat is not supported] 
          [whitesmoke is not supported] 
          [yellowgreen is not supported] 
          [#f should return null] 
          [#f0 should return null] 
       -> [ #f12a wrong RGB code ] expected aaff1122, returned ff00f12a
          [#f0f10 should return null] 
          [#f0f1092 should return null] 
       -> [ #ff1122aa wrong RGB code ] expected aaff1122, returned ffff1122
       -> [ #f0f10928 wrong RGB code ] expected 28f0f109, returned fff0f109
          [f0f10928 is not supported] 
          [#f0f109289 should return null] 
          [ffffffff is not supported] 
       -> [ rgb(12 24 200 / 82%) wrong RGB code ] expected d10c18c8, returned ff0c18c8
       -> [ rgb(12 24 200 / 0.82) wrong RGB code ] expected d10c18c8, returned ff0c18c8
       -> [ rgb(12 24 200 / -210) wrong RGB code ] expected 000c18c8, returned ff0c18c8
       -> [ rgb(15% 60% 49%) wrong RGB code ] expected ff26997d, returned ff26997c
       -> [ rgb(15% 60% 49% / 82%) wrong RGB code ] expected d126997d, returned ff26997c
       -> [ rgb(15%, 60%, 49% / 82%) wrong RGB code ] expected d126997d, returned ff26997c
       -> [ rgb(0.14  60% 52.3 / 0.98) wrong RGB code ] expected fa009934, returned ff009934
       -> [ rgb(none none none / none) wrong RGB code ] expected 00000000, returned ff000000
       -> [ rgb(none none none/none) wrong RGB code ] expected 00000000, returned ff000000
       -> [ rgb(none none 30) wrong RGB code ] expected ff00001e, returned ff1e0000
       -> [ rgb(none 20 none) wrong RGB code ] expected ff001400, returned ff140000
       -> [ rgb(10 50 13% / 50%) wrong RGB code ] expected 800a3221, returned ff0a3221
       -> [ rgb(10 50 13% // 50%) wrong RGB code ] expected ff000000, returned ff0a3221
       -> [ rgb(10 50,, 13% // 50%) wrong RGB code ] expected ff000000, returned ff0a3221
       -> [ rgb(10 50 ,, 13% // 50%) wrong RGB code ] expected ff000000, returned ff0a3221
       -> [ rgb(1.2e1 0.24e2 2e2) wrong RGB code ] expected ff0c18c8, returned ff010100
       -> [ rgb(1200e-2 2400e-2 200000e-3) wrong RGB code ] expected ff0c18c8, returned ffff00ff
       -> [ rgb(1200E-2 2400E-2 200000E-3) wrong RGB code ] expected ff0c18c8, returned ffff00ff
       -> [ rgb(120560.64646464632469823160676064670646798706406464098706464097970906464067e-4 2400E-2 200000e-3) wrong RGB code ] expected ff0c18c8, returned ffff00ff
       -> [ rgba(12 24 200) wrong RGB code ] expected ff0c18c8, returned c18c8
       -> [ rgba(12 24 200%) wrong RGB code ] expected ff0c18ff, returned c18ff
       -> [ rgba(-1 24 200%) wrong RGB code ] expected ff0018ff, returned 18ff
       -> [ rgba(300 24 28) wrong RGB code ] expected ffff181c, returned ff181c
       +> [ rgba(12 24 200 / 82%) illegal argument ] d10c18c8 Color parameter outside of expected range: Alpha
       -> [ rgba(12, 24, 200) wrong RGB code ] expected ff0c18c8, returned c18c8
       +> [ rgba(12, 24, 200, 210) illegal argument ] ff0c18c8 Color parameter outside of expected range: Alpha
       +> [ rgba(12, 24, 200 , 210) illegal argument ] ff0c18c8 Color parameter outside of expected range: Alpha
       +> [ rgba(12 , 24 , 200 , 210) illegal argument ] ff0c18c8 Color parameter outside of expected range: Alpha
       +> [ rgba(   12  ,      24 ,   200 ,             210  ) illegal argument ] ff0c18c8 Color parameter outside of expected range: Alpha
       +> [ rgba(12 ,24, 200 ,210) illegal argument ] ff0c18c8 Color parameter outside of expected range: Alpha
       +> [ rgba(12,24,200,210) illegal argument ] ff0c18c8 Color parameter outside of expected range: Alpha
       -> [ rgba(15% 60% 49%) wrong RGB code ] expected ff26997d, returned 26997d
       +> [ rgba(15% 60% 49% / 82%) illegal argument ] d126997d Color parameter outside of expected range: Alpha
       +> [ rgba(15%, 60%, 49% / 82%) illegal argument ] d126997d Color parameter outside of expected range: Alpha
       -> [ rgba(none none none) wrong RGB code ] expected ff000000, returned 0
       -> [ rgba(none none 30) wrong RGB code ] expected ff00001e, returned 1e0000
       -> [ rgba(none 20 none) wrong RGB code ] expected ff001400, returned 140000
       -> [ rgba(10 none none) wrong RGB code ] expected ff0a0000, returned a0000
       -> [ rgba(none none none) wrong RGB code ] expected ff000000, returned 0
       +> [ rgba(10 50 13% / 50%) illegal argument ] 800a3221 Color parameter outside of expected range: Alpha
       +> [ rgba(10 50 13% // 50%) illegal argument ] ff000000 Color parameter outside of expected range: Alpha
       +> [ rgba(10 50,, 13% // 50%) illegal argument ] ff000000 Color parameter outside of expected range: Alpha
       +> [ rgba(10 50 ,, 13% // 50%) illegal argument ] ff000000 Color parameter outside of expected range: Alpha
       +> [ rgba(1.2e1 0.24e2 2e2) illegal argument ] ff0c18c8 Color parameter outside of expected range: Alpha
       -> [ rgba(1200e-2 2400e-2 200000e-3) wrong RGB code ] expected ff0c18c8, returned ff00ff
       -> [ rgba(1200E-2 2400E-2 200000E-3) wrong RGB code ] expected ff0c18c8, returned ff00ff
       -> [ rgba(120560.64646464632469823160676064670646798706406464098706464097970906464067e-4 2400E-2 200000e-3) wrong RGB code ] expected ff0c18c8, returned ff00ff
        at MissingColorNames.main(MissingColorNames.java:67)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/9825#issuecomment-1761129993


More information about the client-libs-dev mailing list