From a0d42c9727c8e02838fd341fe1c13681c489880c Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Tue, 19 Mar 2024 06:06:30 +0000 Subject: [PATCH] Render clip-path:shape(). Update clip-path-shape-003.html and clip-path-shape-004.html because 1. Per SVG2 spec, we don't accept comma among commands, so I remove them. 2. Basically, these two tests want to test the result of `shape()` should be identical to the result of `path()`. However, I noticed the original tests which put a `clip-path:path()` with `position:absolutely` may have a fuzzy result if the path has some curves there. This may be caused by anti-alias together with absoultely positioned element (note: perhaps there are some floating point calculation in layout for this, so the final rendering coordinates may have some fractions). Therefore, I drop the absolutely positioned element, and just test that if the result of `shape()` is identical to the result of `path()`. Also, add two more tests for different reference-boxes together with the usage of `shape()` (to make sure we resolve percentage values properly). Differential Revision: https://phabricator.services.mozilla.com/D202884 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1823463 gecko-commit: 27f7a56246fb95d10fb9df851d1b13cbdcfced87 gecko-reviewers: emilio --- .../clip-path/clip-path-shape-003.html | 11 ------- .../clip-path/clip-path-shape-004.html | 11 ------- .../clip-path/clip-path-shape-005.html | 29 +++++++++++++++++++ .../clip-path/clip-path-shape-006.html | 29 +++++++++++++++++++ .../reference/clip-path-shape-003-ref.html | 8 ++--- .../reference/clip-path-shape-004-ref.html | 8 ++--- 6 files changed, 62 insertions(+), 34 deletions(-) create mode 100644 css/css-masking/clip-path/clip-path-shape-005.html create mode 100644 css/css-masking/clip-path/clip-path-shape-006.html diff --git a/css/css-masking/clip-path/clip-path-shape-003.html b/css/css-masking/clip-path/clip-path-shape-003.html index 22e7d9aaf5374c9..ef03f85b28c5661 100644 --- a/css/css-masking/clip-path/clip-path-shape-003.html +++ b/css/css-masking/clip-path/clip-path-shape-003.html @@ -8,15 +8,6 @@ 'shape()' for clipping. Test curves."> -

You should see no red.

-
diff --git a/css/css-masking/clip-path/clip-path-shape-004.html b/css/css-masking/clip-path/clip-path-shape-004.html index 14e3ba6329d5ebc..1da9177de55a699 100644 --- a/css/css-masking/clip-path/clip-path-shape-004.html +++ b/css/css-masking/clip-path/clip-path-shape-004.html @@ -8,15 +8,6 @@ 'shape()' for clipping. Test arcs."> -

You should see no red.

-
diff --git a/css/css-masking/clip-path/clip-path-shape-005.html b/css/css-masking/clip-path/clip-path-shape-005.html new file mode 100644 index 000000000000000..44e358bb5979a2c --- /dev/null +++ b/css/css-masking/clip-path/clip-path-shape-005.html @@ -0,0 +1,29 @@ + + + + CSS Masking: Test clip-path property and shape function with padding-box + + + + + + +

The test passes if there are a green filled rect.

+
+ + diff --git a/css/css-masking/clip-path/clip-path-shape-006.html b/css/css-masking/clip-path/clip-path-shape-006.html new file mode 100644 index 000000000000000..7f6db73ebdc44a9 --- /dev/null +++ b/css/css-masking/clip-path/clip-path-shape-006.html @@ -0,0 +1,29 @@ + + + + CSS Masking: Test clip-path property and shape function with content-box + + + + + + +

The test passes if there are a green filled rect.

+
+ + diff --git a/css/css-masking/clip-path/reference/clip-path-shape-003-ref.html b/css/css-masking/clip-path/reference/clip-path-shape-003-ref.html index 46e098c4eb6489f..8d6173464c3c1db 100644 --- a/css/css-masking/clip-path/reference/clip-path-shape-003-ref.html +++ b/css/css-masking/clip-path/reference/clip-path-shape-003-ref.html @@ -5,18 +5,14 @@ -

You should see no red.

diff --git a/css/css-masking/clip-path/reference/clip-path-shape-004-ref.html b/css/css-masking/clip-path/reference/clip-path-shape-004-ref.html index ec8f9410795138f..b74e6abdd9e7c02 100644 --- a/css/css-masking/clip-path/reference/clip-path-shape-004-ref.html +++ b/css/css-masking/clip-path/reference/clip-path-shape-004-ref.html @@ -5,18 +5,14 @@ -

You should see no red.