CSS: inline-block with a display:block <input> child element has a wrong baseline (HTML forms)

This commit is contained in:
janekptacijarabaci 2017-08-17 21:08:44 +02:00 • committed by Roy Tam
commit 67a10f51a0
20 changed files with 990 additions and 29 deletions

View file

@ -0,0 +1,91 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Reference: Testcase #1 for bug 1330962</title>
<style type="text/css">
@font-face {
src: url(../fonts/Ahem.ttf);
font-family: Ahem;
}
html,body {
color:black; background-color:white; font:16px/1 Ahem; padding:0; margin:0;
}
* { font:16px/1 Ahem; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-grid">
A<img class="block" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAEElEQVQoz2NgGAWjYBTAAAADEAABaJFtwwAAAABJRU5ErkJggg%3D%3D">
</div>
B
</div>
<div>
<div style="display:inline-grid">
A
<input type="image" class="block" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAEElEQVQoz2NgGAWjYBTAAAADEAABaJFtwwAAAABJRU5ErkJggg%3D%3D">
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><input type="text" value="text"></div>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><input type="text" value="text"></div>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><input type="text"></div>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><input class="no-theme" type="text" value="text"></div>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,92 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Testcase #1 for bug 1330962</title>
<style type="text/css">
@font-face {
src: url(../fonts/Ahem.ttf);
font-family: Ahem;
}
html,body {
color:black; background-color:white; font:16px/1 Ahem; padding:0; margin:0;
}
* { font:16px/1 Ahem; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A
<img class="block" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAEElEQVQoz2NgGAWjYBTAAAADEAABaJFtwwAAAABJRU5ErkJggg%3D%3D">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input type="image" class="block" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAEElEQVQoz2NgGAWjYBTAAAADEAABaJFtwwAAAABJRU5ErkJggg%3D%3D">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input class="block" type="text" value="text">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input class="block scroll" type="text" value="text">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input class="block" type="text">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input class="block no-theme" type="text" value="text">
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,100 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Reference: Testcase #2 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
color: black;
text-align: start;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A<div>
<div style="display:inline-block"><input type="button" value="button"></div></div>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><button>button</button></div>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><input class="no-theme" type="button" value="button"></div>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<button class="no-theme">button-first<div style="font-size:10px">button-last</div></button>
</div>
B
<div class="no-theme" style="display:inline-block">button-first<div style="font-size:10px">button-last</div></div>
</div>
<div>
<div style="display:inline-block">
A<br>
<button class="no-theme" style="display:inline-grid">button-first<x style="font-size:10px">button-last</x></button>
</div>
B
<div class="no-theme" style="display:inline-grid">button-first<x style="font-size:10px">button-last</x></div>
</div>
<div>
<div style="display:inline-grid">
A
<input type="checkbox" class="block" checked>
</div>
B
</div>
<div>
<div style="display:inline-grid">
A
<input type="radio" class="block" checked>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,100 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Testcase #2 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
color: black;
text-align: start;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A
<input class="block" type="button" value="button">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<button class="block">button</button>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input class="block no-theme" type="button" value="button">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<button class="block no-theme">button-first<div style="font-size:10px">button-last</div></button>
</div>
B
<button class="no-theme">button-first<div style="font-size:10px">button-last</div></button>
</div>
<div>
<div style="display:inline-block">
A
<button class="grid no-theme">button-first<x style="font-size:10px">button-last</x></button>
</div>
B
<button class="no-theme" style="display:inline-grid">button-first<x style="font-size:10px">button-last</x></button>
</div>
<div>
<div style="display:inline-block">
A
<input type="checkbox" class="block" checked>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input type="radio" class="block" checked>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,72 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Reference: Testcase #3 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-grid">
A
<textarea class="block">textarea</textarea>
</div>
B
</div>
<div>
<div style="display:inline-grid">
A
<textarea class="block no-theme">textarea</textarea>
</div>
B
</div>
<div>
<div style="display:inline-grid">
A
<textarea class="block no-theme no-scroll">textarea</textarea>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><fieldset style="display:inline">fieldset-first<br>fieldset-last</fieldset></div>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,73 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Testcase #3 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A
<textarea class="block">textarea</textarea>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<textarea class="block no-theme">textarea</textarea>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<textarea class="block no-theme no-scroll">textarea</textarea>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<fieldset class="block">fieldset-first<br>fieldset-last</fieldset>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,73 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Reference: Testcase #4 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A<br>
<div style="display:inline-block"><fieldset style="display:inline"><legend>legend</legend>
fieldset-first<br>fieldset-last</fieldset></div>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<fieldset style="display:inline-grid">grid-fieldset-first<x>grid-fieldset-last</x></fieldset>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<fieldset style="display:inline" class="no-theme">fieldset-first<br>fieldset-last</fieldset>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<fieldset style="display:inline" class="no-theme scroll">fieldset-first<br>fieldset-last</fieldset>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,74 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Testcase #4 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A
<fieldset class="block"><legend>legend</legend>
fieldset-first<br>fieldset-last</fieldset>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<fieldset class="grid"><x style="order:2">grid-fieldset-last</x>grid-fieldset-first</fieldset>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<fieldset class="block no-theme">fieldset-first<br>fieldset-last</fieldset>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<fieldset class="block no-theme scroll">fieldset-first<br>fieldset-last</fieldset>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,72 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Reference: Testcase #5 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A<br>
<input type="color">
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<input type="color" class="no-theme">
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<select><option>select</select>
</div>
B
</div>
<div>
<div style="display:inline-block">
A<br>
<select class="no-theme"><option>select</select>
</div>
B
</div>
</body>
</html>

View file

@ -0,0 +1,72 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Testcase #5 for bug 1330962</title>
<style type="text/css">
html,body {
color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
}
* { font:16px/1 monospace; }
.block { display: block; }
.grid { display: grid; }
.no-theme {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
padding: 20px 0;
border: none;
background: white;
}
.scroll {
overflow-y: scroll;
}
.no-scroll {
overflow: visible;
}
</style>
</head>
<body>
<div>
<div style="display:inline-block">
A
<input type="color" class="block">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<input type="color" class="block no-theme">
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<select class="block"><option>select</select>
</div>
B
</div>
<div>
<div style="display:inline-block">
A
<select class="block no-theme"><option>select</select>
</div>
B
</div>
</body>
</html>

View file

@ -1,4 +1,9 @@
fuzzy-if(skiaContent,1,10) HTTP(..) == text-control-baseline-1.html text-control-baseline-1-ref.html
fuzzy-if(cocoaWidget,16,64) fuzzy-if(Android,52,64) fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu),104,224) fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),57,400) == display-block-baselines-1.html display-block-baselines-1-ref.html # anti-aliasing issues
== display-block-baselines-2.html display-block-baselines-2-ref.html
== display-block-baselines-3.html display-block-baselines-3-ref.html
== display-block-baselines-4.html display-block-baselines-4-ref.html
fuzzy-if(Android,4,8) == display-block-baselines-5.html display-block-baselines-5-ref.html
# button element
include button/reftest.list