Bug 1543477 - Make <input type=file> always clip its content. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D27452

--HG--
extra : rebase_source : 094158d39010feb0f84ca9efb137fe6f3e49648a
This commit is contained in:
Mats Palmgren 2019-04-14 03:01:00 +02:00
Родитель ee1194b0f1
Коммит 1285f6a884
6 изменённых файлов: 206 добавлений и 1 удалений

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

@ -0,0 +1,54 @@
<!doctype html>
<meta charset="utf-8">
<title>Reference: File input with CSS display</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<style>
input {
height: 3em;
}
.grid { display: block; }
.flex { display: block; }
.block { display: block; }
.table { display: block; }
.columns { display: block; }
.n { -webkit-appearance:none; appearance:none; }
</style>
<body>
<input type="file" class="grid">
<input type="file" class="flex">
<input type="file" class="block">
<input type="file" class="table">
<input type="file" class="columns">
A<input type="file">
<input type="file" class="inline">
<input type="file" class="inline-grid">
<input type="file" class="inline-flex">
<input type="file" class="inline-block">
<input type="file" class="inline-table">
<input type="file" class="inline-columns">
A<input disabled type="file">
<input disabled type="file" class="inline">
<input disabled type="file" class="inline-grid">
<input disabled type="file" class="inline-flex">
<input disabled type="file" class="inline-block">
<input disabled type="file" class="inline-table">
<input disabled type="file" class="inline-columns">
A<input type="file" class="n">
<input type="file" class="n inline">
<input type="file" class="n inline-grid">
<input type="file" class="n inline-flex">
<input type="file" class="n inline-block">
<input type="file" class="n inline-table">
<input type="file" class="n inline-columns">
A<input disabled type="file" class="n">
<input disabled type="file" class="n inline">
<input disabled type="file" class="n inline-grid">
<input disabled type="file" class="n inline-flex">
<input disabled type="file" class="n inline-block">
<input disabled type="file" class="n inline-table">
<input disabled type="file" class="n inline-columns">
</body>

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

@ -0,0 +1,64 @@
<!doctype html>
<meta charset="utf-8">
<title>Test: File input with CSS display</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#widgets">
<link rel="help" href="https://github.com/whatwg/html/issues/4082">
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow">
<link rel="match" href="css-overflow-ref.html">
<style>
input {
height: 3em;
}
.inline { display: inline }
.inline-grid { display: inline-grid; grid: 500px/500px; align-items: end; }
.inline-flex { display: inline-flex; flex-flow: column; align-items: end; }
.inline-block { display: inline-block }
.inline-table { display: inline-table }
.inline-columns { display: inline-block; column-width: 500px; column-rule: 10px solid; }
.grid { display: grid; grid: 500px/500px; align-items: end; }
.flex { display: flex; flex-flow: column; align-items: end; }
.block { display: block }
.table { display: table }
.columns { display: block; column-width: 500px; column-rule: 10px solid; }
.n { -webkit-appearance:none; appearance:none; }
</style>
<body>
<input type="file" class="grid">
<input type="file" class="flex">
<input type="file" class="block">
<input type="file" class="table">
<input type="file" class="columns">
A<input type="file">
<input type="file" class="inline">
<input type="file" class="inline-grid">
<input type="file" class="inline-flex">
<input type="file" class="inline-block">
<input type="file" class="inline-table">
<input type="file" class="inline-columns">
A<input disabled type="file">
<input disabled type="file" class="inline">
<input disabled type="file" class="inline-grid">
<input disabled type="file" class="inline-flex">
<input disabled type="file" class="inline-block">
<input disabled type="file" class="inline-table">
<input disabled type="file" class="inline-columns">
A<input type="file" class="n">
<input type="file" class="n inline">
<input type="file" class="n inline-grid">
<input type="file" class="n inline-flex">
<input type="file" class="n inline-block">
<input type="file" class="n inline-table">
<input type="file" class="n inline-columns">
A<input disabled type="file" class="n">
<input disabled type="file" class="n inline">
<input disabled type="file" class="n inline-grid">
<input disabled type="file" class="n inline-flex">
<input disabled type="file" class="n inline-block">
<input disabled type="file" class="n inline-table">
<input disabled type="file" class="n inline-columns">
</body>

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

@ -0,0 +1,39 @@
<!doctype html>
<meta charset="utf-8">
<title>Reference: File input with CSS overflow</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<style>
input {
display: inline-block;
width: 100px;
height: 30px;
font-size: 48px;
overflow: visible;
}
.n { -webkit-appearance:none; appearance:none; }
</style>
<body>
A<input type="file">
<input type="file" class="ov">
<input type="file" class="oh">
<input type="file" class="os">
<input type="file" class="oa">
A<input disabled type="file">
<input disabled type="file" class="ov">
<input disabled type="file" class="oh">
<input disabled type="file" class="os">
<input disabled type="file" class="oa">
A<input type="file" class="n">
<input type="file" class="n ov">
<input type="file" class="n oh">
<input type="file" class="n os">
<input type="file" class="n oa">
A<input disabled type="file" class="n">
<input disabled type="file" class="n ov">
<input disabled type="file" class="n oh">
<input disabled type="file" class="n os">
<input disabled type="file" class="n oa">
</body>

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

@ -0,0 +1,46 @@
<!doctype html>
<meta charset="utf-8">
<title>Test: File input with CSS overflow</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#widgets">
<link rel="help" href="https://github.com/whatwg/html/issues/4082">
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow">
<link rel="match" href="css-overflow-ref.html">
<style>
input {
display: inline-block;
width: 100px;
height: 30px;
font-size: 48px;
}
.ov { overflow: visible; }
.oh { overflow: hidden; }
.os { overflow: scroll; }
.oa { overflow: auto; }
.n { -webkit-appearance:none; appearance:none; }
</style>
<body>
A<input type="file">
<input type="file" class="ov">
<input type="file" class="oh">
<input type="file" class="os">
<input type="file" class="oa">
A<input disabled type="file">
<input disabled type="file" class="ov">
<input disabled type="file" class="oh">
<input disabled type="file" class="os">
<input disabled type="file" class="oa">
A<input type="file" class="n">
<input type="file" class="n ov">
<input type="file" class="n oh">
<input type="file" class="n os">
<input type="file" class="n oa">
A<input disabled type="file" class="n">
<input disabled type="file" class="n ov">
<input disabled type="file" class="n oh">
<input disabled type="file" class="n os">
<input disabled type="file" class="n oa">
</body>

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

@ -7,3 +7,5 @@ fuzzy-if(gtkWidget,0-1,0-10) fails-if(Android) == style.html style-ref.xul
fails-if(Android) == color-inherit.html color-inherit-ref.html
fuzzy-if(Android,0-2,0-2) fails-if(webrender&&!cocoaWidget) == dynamic-max-width.html dynamic-max-width-ref.html # bug 1496542 for webrender.
== label-min-inline-size.html label-min-inline-size-ref.html
== css-overflow.html css-overflow-ref.html
== css-display.html css-display-ref.html

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

@ -467,7 +467,7 @@ input[type="image"]:-moz-focusring {
input[type="file"] {
display: inline-block;
white-space: nowrap !important;
overflow: hidden;
overflow: hidden !important;
overflow-clip-box: padding-box;
color: unset;