Bug 1821793 part 2: Use 0 margin and Ahem font in WPT clip-path-polygon-013.html, to make its computations less likely to produce fractional-pixel sizes with fuzzy failures. r=emilio

The standard WPT viewport is 800px wide, which (as a multiple of 100) can
conveniently resolve whole-number percentages without creating a fractional
size.  But the default body-margins reduce it by 16px, to 784, which is less of
a round-number percent basis.

This was producing some fractional-pixel sizes in this test, which were causing
a fuzzy failure, due to antialiasing differences between how "width" and
"clip-path" handle fractional pixel sizes.

So, this patch just removes those margins, to give us 800px as our percent
basis, which avoids fractional-pixel sizes in this test.

Similarly: this patch also makes us use the Ahem font so that the test's "ex"
units will resolve to a predictable value, instead of whatever
potentially-fractional-value the default font would yield.

Differential Revision: https://phabricator.services.mozilla.com/D172917
This commit is contained in:
Daniel Holbert 2023-03-18 20:27:38 +00:00
Родитель d4051b7a68
Коммит fc511c104c
3 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -1,2 +0,0 @@
[clip-path-polygon-013.html]
expected: FAIL

Просмотреть файл

@ -10,13 +10,19 @@
polygon coordinates. The test passes if you see a multiple green and blue
stripe pairs. For each pair, the blue and green stripe must be of same
length.">
<meta name="flags" content="ahem">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
body {
margin: 0;
}
div {
width: 100%;
height: 20px;
background-color: green;
padding: 0;
margin: 0;
font: 20px/1 Ahem;
}
div:nth-child(odd) {
margin-bottom: 5px;
@ -43,4 +49,4 @@ div:nth-child(odd) {
<div style="clip-path: polygon(0 0, 30ex 0, 30ex 20px, 0 20px)"></div>
<div style="width: 30ex"></div>
</body>
</html>
</html>

Просмотреть файл

@ -3,12 +3,18 @@
<head>
<title>CSS Masking: Reftest reference</title>
<link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com">
<meta name="flags" content="ahem">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
body {
margin: 0;
}
div {
height: 20px;
background-color: green;
padding: 0;
margin: 0;
font: 20px/1 Ahem;
}
div:nth-child(odd) {
margin-bottom: 5px;
@ -35,4 +41,4 @@ div:nth-child(odd) {
<div style="width: 30ex"></div>
<div style="width: 30ex"></div>
</body>
</html>
</html>