Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #17456 - asajeffrey:script-paint-worklets-size, r=emilio
Paint worklet size should agree with Chrome. <!-- Please describe your changes on the following line: --> Getting our implementation to agree with Chrome about the definition of the size parameter to a paint worklet. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #17376 - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17456) <!-- Reviewable:end -->
- Loading branch information
Showing
6 changed files
with
75 additions
and
2 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
3 changes: 3 additions & 0 deletions
3
tests/wpt/mozilla/meta/mozilla/worklets/test_paint_worklet_size.html.ini
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,3 @@ | ||
[test_paint_worklet_size.html] | ||
type: reftest | ||
expected: FAIL |
17 changes: 17 additions & 0 deletions
17
tests/wpt/mozilla/tests/mozilla/worklets/test_paint_worklet_size.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,17 @@ | ||
<!doctype html> | ||
<html class="reftest-wait"> | ||
<head> | ||
<meta charset=utf-8> | ||
<title>Test the size parameter of paint worklets</title> | ||
<link rel=match href=/_mozilla/mozilla/worklets/test_paint_worklet_ref.html> | ||
</head> | ||
<body> | ||
<div style="height: 100px; width: 200px; background: paint(test); | ||
margin: 10px; border: 3px solid blue; padding: 5px;"></div> | ||
</body> | ||
<script> | ||
window.paintWorklet | ||
.addModule("test_paint_worklet_size.js") | ||
.then(function() { document.documentElement.classList.remove("reftest-wait"); }); | ||
</script> | ||
</html> |
8 changes: 8 additions & 0 deletions
8
tests/wpt/mozilla/tests/mozilla/worklets/test_paint_worklet_size.js
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,8 @@ | ||
registerPaint("test", class { | ||
paint(ctx, size) { | ||
if ((size.width === 210) && (size.height === 110)) { | ||
ctx.fillStyle = "green"; | ||
ctx.fillRect(0, 0, size.width, size.height); | ||
} | ||
} | ||
}); |
7 changes: 7 additions & 0 deletions
7
tests/wpt/mozilla/tests/mozilla/worklets/test_paint_worklet_size_ref.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,7 @@ | ||
<!doctype html> | ||
<html> | ||
<body> | ||
<div style="height: 100px; width: 200px; background: green; | ||
margin: 10px; border: 3px solid blue; padding: 5px;"></div> | ||
</body> | ||
</html> |