Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-text] Rework some tests to avoid anti aliasing issues #13510

Merged
merged 1 commit into from
Dec 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
body { background: white; }
div {
padding-left: 50px;
font-family: Ahem;
}
span {
display: inline-block;
width: 10px;
height: 10px;
background: green;
}
</style>

<div>X</div>
<p>Test passes if there is a green square below and no red.
<div><span></span></div>
19 changes: 17 additions & 2 deletions css/css-text/text-indent/text-indent-percentage-002.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,32 @@
<meta name="assert" content="Percentages in text-indent refer to width of the element's content box">
<style>
body { background: white; }
section { position: absolute; }
section, div {
border-right: 10px solid white;
margin-right: 10px;
padding-right: 10px;
font-family: Ahem;
}
div {
box-sizing: border-box;
width: 120px;
}
span {
display: inline-block;
width: 10px;
height: 10px;
background: green;
}
.ref span {
background: red;
/* the next two lines are to avoid antialiasing artifacts causing a tiny about of red to be visible */
box-sizing: border-box;
border: 1px solid white;
}
.test div { text-indent: 50%; }
.ref div { text-indent: 50px; }
</style>

<section class=test><div>X</div></section>
<p>Test passes if there is a green square below and no red.
<section class=ref><div><span></span></div></section>
<section class=test><div><span></span></div></section>
19 changes: 17 additions & 2 deletions css/css-text/text-indent/text-indent-percentage-003.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,32 @@
<meta name="assert" content="Percentages in text-indent refer to width of the element's content box">
<style>
body { background: white; }
section { position: absolute; }
section, div {
border-right: 10px solid white;
margin-right: 10px;
padding-right: 10px;
font-family: Ahem;
}
div {
box-sizing: border-box;
width: 120px;
}
span {
display: inline-block;
width: 10px;
height: 10px;
background: green;
}
.ref span {
background: red;
/* the next two lines are to avoid antialiasing artifacts causing a tiny about of red to be visible */
box-sizing: border-box;
border: 1px solid white;
}
.test div { text-indent: 50%; overflow: hidden; } /* overflow:hidden should not make any difference, but it does in some browsers */
.ref div { text-indent: 50px; }
</style>

<section class=test><div>X</div></section>
<p>Test passes if there is a green square below and no red.
<section class=ref><div><span></span></div></section>
<section class=test><div><span></span></div></section>
18 changes: 17 additions & 1 deletion css/css-text/text-indent/text-indent-percentage-004.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<meta name="assert" content="Percentages in text-indent refer to width of the element's content box, when used in a calc expression">
<style>
body { background: white; }
section { position: absolute; }
section, div {
border-right: 10px solid white;
margin-right: 10px;
Expand All @@ -19,7 +20,22 @@
box-sizing: border-box;
width: 120px;
}
span {
display: inline-block;
width: 10px;
height: 10px;
background: green;
}
.ref span {
background: red;
/* the next two lines are to avoid antialiasing artifacts causing a tiny about of red to be visible */
box-sizing: border-box;
border: 1px solid white;
}
.test div { text-indent: calc(25px + 25%); }
.ref div { text-indent: 50px; }
</style>

<section class=test><div>X</div></section>
<p>Test passes if there is a green square below and no red.
<section class=ref><div><span></span></div></section>
<section class=test><div><span></span></div></section>