forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
deae7cc
commit a0d42c9
Showing
6 changed files
with
62 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Masking: Test clip-path property and shape function with padding-box</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-shapes-2/#funcdef-shape"> | ||
<link rel="match" href="reference/clip-path-path-001-ref.html"> | ||
<meta name="assert" content="The clip-path property takes the basic shape | ||
'shape()' for clipping. Test the usage of the reference box. On pass you | ||
should see a green square."> | ||
</head> | ||
<style> | ||
#rect { | ||
/* The size of the padding-box is 100x100. */ | ||
width: 120px; | ||
height: 120px; | ||
padding: 10px; | ||
border: 10px solid red; | ||
box-sizing: border-box; | ||
background-color: green; | ||
clip-path: shape(from 0px 0px, | ||
hline by 80px, vline by 80%, hline by -80%, close) | ||
padding-box; | ||
} | ||
</style> | ||
<body> | ||
<p>The test passes if there are a green filled rect.</p> | ||
<div id="rect"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Masking: Test clip-path property and shape function with content-box</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-shapes-2/#funcdef-shape"> | ||
<link rel="match" href="reference/clip-path-path-001-ref.html"> | ||
<meta name="assert" content="The clip-path property takes the basic shape | ||
'shape()' for clipping. Test the usage of the reference box. On pass you | ||
should see a green square."> | ||
</head> | ||
<style> | ||
#rect { | ||
width: 140px; | ||
height: 140px; | ||
padding: 10px; | ||
border: 10px solid red; | ||
box-sizing: border-box; | ||
background-color: green; | ||
/* The size of the content-box is 100x100. */ | ||
clip-path: shape(from -10px -10%, | ||
hline by 80px, vline by 80%, hline by -80%, close) | ||
content-box; | ||
} | ||
</style> | ||
<body> | ||
<p>The test passes if there are a green filled rect.</p> | ||
<div id="rect"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters