-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BlinkGenPropertyTrees] Filter effects should be clipped
According to the spec, filtering should apply before clipping (https://drafts.fxtf.org/css-masking-1/#placement): "...effects are applied to the element in order: filter effects, clipping, masking and opacity." This patch fixes clip-path order with BlinkGenPropertyTrees (BGPT) which exposed the issue of filter and clip order. Testcases have been added showing the fixed behavior with BGPT, and the non-BGPT results have been marked as failing. NOTRY=true Bug: 906154, 907175 Change-Id: I5e9c7dbb7c694afc623fbc3bb2c7f2f8cc458195 Reviewed-on: https://chromium-review.googlesource.com/c/1344217 Commit-Queue: Philip Rogers <[email protected]> Reviewed-by: Xianzhu Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#609847}
- Loading branch information
1 parent
6d8673b
commit 36d62b4
Showing
6 changed files
with
124 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Clip-path should be applied after filtering</title> | ||
<link rel="author" title="Philip Rogers" href="mailto:[email protected]"> | ||
|
||
<div> | ||
<p>Expected: A green box.<br> | ||
There should be no red visible.<br> | ||
There should be a crisp, clipped edge around the green box (no blurring).</p> | ||
</div> | ||
|
||
<style> | ||
#testcase { | ||
position: absolute; | ||
width: 200px; | ||
height: 200px; | ||
background: green; | ||
will-change: transform; | ||
} | ||
</style> | ||
<div id="testcase"></div> |
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,25 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Clip-path should be applied after filtering</title> | ||
<link rel="author" title="Philip Rogers" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#placement"> | ||
<link rel="match" href="clip-path-filter-order-ref.html"> | ||
|
||
<div> | ||
<p>Expected: A green box.<br> | ||
There should be no red visible.<br> | ||
There should be a crisp, clipped edge around the green box (no blurring).</p> | ||
</div> | ||
|
||
<style> | ||
#testcase { | ||
position: absolute; | ||
width: 400px; | ||
height: 400px; | ||
background: green; | ||
will-change: transform; | ||
filter: drop-shadow(16px 16px 20px red); | ||
clip-path: inset(0px 200px 200px 0px); | ||
} | ||
</style> | ||
<div id="testcase"></div> |
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,21 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Clip should be applied after filtering</title> | ||
<link rel="author" title="Philip Rogers" href="mailto:[email protected]"> | ||
|
||
<div> | ||
<p>Expected: A green box.<br> | ||
There should be no red visible.<br> | ||
There should be a crisp, clipped edge around the green box (no blurring).</p> | ||
</div> | ||
|
||
<style> | ||
#testcase { | ||
position: absolute; | ||
width: 200px; | ||
height: 200px; | ||
background: green; | ||
will-change: transform; | ||
} | ||
</style> | ||
<div id="testcase"></div> |
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,25 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Clip should be applied after filtering</title> | ||
<link rel="author" title="Philip Rogers" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#placement"> | ||
<link rel="match" href="clip-filter-order-ref.html"> | ||
|
||
<div> | ||
<p>Expected: A green box.<br> | ||
There should be no red visible.<br> | ||
There should be a crisp, clipped edge around the green box (no blurring).</p> | ||
</div> | ||
|
||
<style> | ||
#testcase { | ||
position: absolute; | ||
width: 400px; | ||
height: 400px; | ||
background: green; | ||
will-change: transform; | ||
filter: drop-shadow(16px 16px 20px red); | ||
clip: rect(0px, 200px, 200px, 0px); | ||
} | ||
</style> | ||
<div id="testcase"></div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.