RFR: JDK-8292276 : Add named colors from CSS Color Module Level 4 [v39]
Phil Race
prr at openjdk.org
Mon Oct 23 16:32:52 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
Hmm ..
I'm seeing the test fail
% java MissingColorNames
Exception in thread "main" java.lang.RuntimeException: Failed.
-> [ 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:70)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/9825#issuecomment-1775572909
More information about the client-libs-dev
mailing list