ladybird/Tests/LibWeb/TestConfig.ini
Lucas CHOLLET 6affbf78c2
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
LibGfx: Adjust matrices for XYZ -> sRGB conversions
TL;DR: There are two available sets of coefficients for the conversion
matrices from XYZ to sRGB. We switched from one set to the other, which
is what the WPT tests are expecting.

All RGB color spaces, like display-p3 or rec2020, are defined by their
three color chromacities and a white point. This is also the case for
the video color space Rec. 709, from which the sRGB color space is
derived. The sRGB specification is however a bit different.

In 1996, when formalizing the sRGB spec the authors published a draft
that is still available here [1]. In this document, they also provide
the matrix to convert from the XYZ color space to sRGB. This matrix can
be verified quite easily by using the usual math equations. But hold on,
here come the plot twist: at the time of publication, the spec contained
a different matrix than the one in the draft (the spec is obviously
behind a pay wall, but the numbers are also reported in this official
document [2]). This official matrix, is at a first glance simply a
wrongly rounded version of the one in the draft publication. It however
has some interesting properties: it can be inverted twice (so a
roundtrip) in 8 bits and not suffer from any errors from the
calculations.

So, we are here with two versions of the XYZ -> sRGB matrix, the one
from the spec, which is:
 - better for computations in 8 bits,
 - and official. This is the one that, by authority, we should use.
And a second version, that can be found in the draft, which:
 - makes sense, as directly derived from the chromacities,
 - is publicly available,
 - and (thus?) used in most places.

The old coefficients were the one from the spec, this commit change them
for the one derived from the mathematical formulae. The Python script to
compute these values is available at the end of the commit description.

More details about this subject can be found here [3].

[1] https://www.w3.org/Graphics/Color/sRGB.html
[2] https://color.org/chardata/rgb/sRGB.pdf
[3] https://photosauce.net/blog/post/making-a-minimal-srgb-icc-profile-part-3-choose-your-colors-carefully

The Python script:

```python
# http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html

from numpy.typing import NDArray
import numpy as np

### sRGB
# https://www.w3.org/TR/css-color-4/#predefined-sRGB
srgb_r_chromacity = np.array([0.640, 0.330])
srgb_g_chromacity = np.array([0.300, 0.600])
srgb_b_chromacity = np.array([0.150, 0.060])
##

## White points
white_point_d50 = np.array([0.345700, 0.358500])
white_point_d65 = np.array([0.312700, 0.329000])
#

r_chromacity = srgb_r_chromacity
g_chromacity = srgb_g_chromacity
b_chromacity = srgb_b_chromacity
white_point = white_point_d65

def tristmimulus_vector(chromacity: NDArray) -> NDArray:
    return np.array([
        chromacity[0] /chromacity[1],
        1,
        (1 - chromacity[0] - chromacity[1]) / chromacity[1]
    ])

tristmimulus_matrix = np.hstack((
    tristmimulus_vector(r_chromacity).reshape(3, 1),
    tristmimulus_vector(g_chromacity).reshape(3, 1),
    tristmimulus_vector(b_chromacity).reshape(3, 1),
))

scaling_factors = (np.linalg.inv(tristmimulus_matrix) @
                   tristmimulus_vector(white_point))

M = tristmimulus_matrix * scaling_factors

np.set_printoptions(formatter={'float_kind':'{:.6f}'.format})
xyz_65_to_srgb = np.linalg.inv(M)

# http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
# Let's convert from D50 to D65 using the Bradford method.
m_a = np.array([
    [0.8951000, 0.2664000, -0.1614000],
    [-0.7502000, 1.7135000, 0.0367000],
    [0.0389000, -0.0685000, 1.0296000]
])

cone_response_source = m_a @ tristmimulus_vector(white_point_d50)
cone_response_destination = m_a @ tristmimulus_vector(white_point_d65)

cone_response_ratio = cone_response_destination / cone_response_source
m = np.linalg.inv(m_a) @ np.diagflat(cone_response_ratio) @ m_a

D50_to_D65 = m
xyz_50_to_srgb = xyz_65_to_srgb @ D50_to_D65

print(xyz_50_to_srgb)
print(xyz_65_to_srgb)
```
2024-11-17 22:18:40 +01:00

164 lines
10 KiB
INI

[Skipped]
; Consistently hang on macOS, see #1306
Text/input/HTML/cross-origin-window-properties.html
Text/input/HTML/DedicatedWorkerGlobalScope-instanceof.html
Text/input/window-scrollTo.html
; Flaky on CI
Ref/input/css-keyframe-fill-forwards.html
Ref/input/unicode-range.html
Text/input/Crypto/SubtleCrypto-exportKey.html
Text/input/Crypto/SubtleCrypto-generateKey.html
Text/input/wpt-import/css/css-flexbox/text-as-flexitem-size-001.html
; Animation tests are flaky
Text/input/css/cubic-bezier-infinite-slope-crash.html
Text/input/css/transition-basics.html
; Flaky on CI, see #19
Text/input/WebAnimations/misc/DocumentTimeline.html
; Worker tests are flaky on CI
Text/input/Worker/Worker-blob.html
Text/input/Worker/Worker-close-after-postMessage.html
Text/input/Worker/Worker-crypto.html
Text/input/Worker/Worker-echo.html
Text/input/Worker/Worker-importScripts.html
Text/input/Worker/Worker-location.html
Text/input/Worker/Worker-module.html
Text/input/Worker/Worker-performance.html
Text/input/Worker/Worker-postMessage-transfer.html
; Too slow for GCC CI
Text/input/wpt-import/css/css-flexbox/abspos/position-absolute-001.html
; Skipped due to assertion failures
Text/input/wpt-import/html/syntax/parsing/html5lib_entities01.html
Text/input/wpt-import/html/syntax/parsing/html5lib_innerHTML_tests_innerHTML_1.html
Text/input/wpt-import/html/syntax/parsing/html5lib_plain-text-unsafe.html
Text/input/wpt-import/html/syntax/parsing/html5lib_template.html
Text/input/wpt-import/html/syntax/parsing/html5lib_tests1.html
Text/input/wpt-import/html/syntax/parsing/html5lib_tests10.html
Text/input/wpt-import/html/syntax/parsing/html5lib_tests15.html
Text/input/wpt-import/html/syntax/parsing/html5lib_tests16.html
Text/input/wpt-import/html/syntax/parsing/html5lib_tests19.html
Text/input/wpt-import/html/syntax/parsing/html5lib_tests20.html
Text/input/wpt-import/html/syntax/parsing/html5lib_tests5.html
Text/input/wpt-import/html/syntax/parsing/html5lib_webkit01.html
Text/input/wpt-import/html/syntax/parsing/named-character-references.html
Text/input/wpt-import/html/syntax/parsing/support/no-doctype-name-eof.html
Text/input/wpt-import/html/syntax/parsing/support/no-doctype-name-line.html
Text/input/wpt-import/html/syntax/parsing/support/no-doctype-name-space.html
; Unknown, imported as skipped in #2148
Text/input/wpt-import/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html
Text/input/wpt-import/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html
Text/input/wpt-import/html/infrastructure/safe-passing-of-structured-data/resources/iframe-resizable-arraybuffer-helper.html
Text/input/wpt-import/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html
; Flaky, apparently due to font loading
Text/input/wpt-import/css/css-flexbox/flex-item-compressible-001.html
; WPT ref-tests that currently fail
Ref/input/wpt-import/css/css-nesting/host-nesting-003.html
Ref/input/wpt-import/css/css-nesting/host-nesting-004.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-bfc-002r.xht
Ref/input/wpt-import/css/CSS2/floats/float-nowrap-3.html
Ref/input/wpt-import/css/CSS2/floats/overflow-scroll-float-paint-order.html
Ref/input/wpt-import/css/CSS2/floats/zero-width-floats-positioning.tentative.html
Ref/input/wpt-import/css/CSS2/floats/floats-zero-height-wrap-001.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht
Ref/input/wpt-import/css/CSS2/floats/floats-zero-height-wrap-002.xht
Ref/input/wpt-import/css/CSS2/floats/float-nowrap-2.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-001.html
Ref/input/wpt-import/css/CSS2/floats/remove-block-between-inline-and-float.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-bfc-003r.xht
Ref/input/wpt-import/css/CSS2/floats/float-nowrap-9.html
Ref/input/wpt-import/css/CSS2/floats/floats-placement-vertical-001c.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-outside-001.xht
Ref/input/wpt-import/css/CSS2/floats/new-fc-separates-from-float.html
Ref/input/wpt-import/css/CSS2/floats/float-nowrap-5.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-inline-003r.xht
Ref/input/wpt-import/css/CSS2/floats/floats-rule3-outside-right-001.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-010.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-008.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-inline-002r.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-003-left-table.xht
Ref/input/wpt-import/css/CSS2/floats/float-no-content-beside-001.html
Ref/input/wpt-import/css/CSS2/floats/float-nowrap-8.html
Ref/input/wpt-import/css/CSS2/floats/new-fc-relayout.html
Ref/input/wpt-import/css/CSS2/floats/floats-placement-004.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-004.html
Ref/input/wpt-import/css/CSS2/floats/float-nowrap-7.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-inline-003l.xht
Ref/input/wpt-import/css/CSS2/floats/new-fc-separates-from-float-2.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-002.tentative.html
Ref/input/wpt-import/css/CSS2/floats/new-fc-separates-from-float-3.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-006.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-003-right-table.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-003.tentative.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-005.html
Ref/input/wpt-import/css/CSS2/floats/float-nowrap-6.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-007.xht
Ref/input/wpt-import/css/CSS2/floats/floats-placement-005.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-005.xht
Ref/input/wpt-import/css/CSS2/floats/floats-rule3-outside-left-001.xht
Ref/input/wpt-import/css/CSS2/floats/floats-line-wrap-shifted-001.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-004.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-bfc-002l.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-002-right-table.xht
Ref/input/wpt-import/css/CSS2/floats/zero-width-floats.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-006.tentative.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-002-right-overflow.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-009.tentative.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-008.tentative.html
Ref/input/wpt-import/css/CSS2/floats/overhanging-float-paint-order.html
Ref/input/wpt-import/css/CSS2/floats/float-with-absolutely-positioned-child-with-static-inset.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-with-margin-001a.tentative.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-bfc-001-right-overflow.xht
Ref/input/wpt-import/css/CSS2/floats/floats-placement-003.html
Ref/input/wpt-import/css/CSS2/floats/floats-wrap-top-below-bfc-003l.xht
; WPT crash tests are not supported yet - and probably should go in a separate directory
Text/input/wpt-import/css/css-nesting/delete-other-rule-crash.html
Text/input/wpt-import/css/css-nesting/implicit-parent-insertion-crash.html
Text/input/wpt-import/css/css-nesting/pseudo-part-crash.html
Text/input/wpt-import/css/css-nesting/pseudo-where-crash.html
; Imported animation tests are extra slow
; https://github.com/LadybirdBrowser/ladybird/issues/2238
Text/input/wpt-import/css/css-backgrounds/animations/background-color-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/background-color-transition-colormix.html
Text/input/wpt-import/css/css-backgrounds/animations/background-image-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/background-position-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/background-position-origin-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/background-position-x-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/background-position-y-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/background-size-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/border-bottom-left-radius-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-bottom-right-radius-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-bottom-width-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-color-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-outset-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-outset-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-slice-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-slice-interpolation-stability.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-slice-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-source-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-width-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-image-width-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/border-left-width-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-radius-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/border-right-width-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-top-left-radius-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-top-right-radius-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-top-width-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/border-width-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/box-shadow-composition.html
Text/input/wpt-import/css/css-backgrounds/animations/box-shadow-interpolation.html
Text/input/wpt-import/css/css-backgrounds/animations/discrete-no-interpolation.html
; https://github.com/LadybirdBrowser/ladybird/issues/2314
Text/input/test-http-test-server.html