Bug 1236400 part 4: Add reftests to test how non-block-level content gets wrapped inside a -webkit-box. (no review)

MozReview-Commit-ID: 5vVgdEA14Y1
This commit is contained in:
Daniel Holbert 2016-03-24 09:55:12 -07:00
Родитель 2b7c7ca3d2
Коммит 81bad95275
7 изменённых файлов: 308 добавлений и 0 удалений

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

@ -2,6 +2,15 @@
# CSS properties. These tests require webkit prefix support to be enabled.
default-preferences pref(layout.css.prefixes.webkit,true)
# Tests for anonymous flex item formation inside of a "-webkit-box":
# Note: some of these tests are marked as failing, because we don't match
# WebKit/Blink on them. (The reference case represents the WebKit/Blink
# rendering.) We could probably make them pass by implementing some quirks, if
# it turns out that the web depends on WebKit/Blink's behavior in these cases.
== webkit-box-anon-flex-items-1.html webkit-box-anon-flex-items-1-ref.html
fails == webkit-box-anon-flex-items-2.html webkit-box-anon-flex-items-2-ref.html
fails == webkit-box-anon-flex-items-3.html webkit-box-anon-flex-items-3-ref.html
# Tests for "-webkit-box" & "-webkit-inline-box" as display values:
== webkit-display-values-1.html webkit-display-values-1-ref.html

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

@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<title>
Reference Case
</title>
<style>
.container {
display: flex;
justify-content: space-between;
width: 300px;
border: 1px solid black;
font: 10px sans-serif;
margin-bottom: 10px;
}
.container > * {
background: lightgray;
}
.fakeAnonWrapper {
background: none;
}
.fakeAnonWrapper > * {
background: lightgray;
}
.table {
display: table;
}
</style>
</head>
<body>
<!-- We use an explicit div (with class "fakeAnonWrapper") here, to match the
anonymous div that the testcase is expected to generate around contiguous
runs of inline content. -->
<div class="container">
<div class="fakeAnonWrapper">
a
<i>i</i><img src="bogus"><img src="bogus" alt="alt">
<canvas height="5" width="5"></canvas>
<video height="5" width="5"></video>
<div style="display:inline-block">ib</div>
<div style="display:inline-table">it</div>
z
</div>
<div>block</div>
<div>block</div>
</div>
<div class="container">
<div>block</div>
<div class="fakeAnonWrapper">
a
<i>i</i><img src="bogus"><img src="bogus" alt="alt">
<canvas height="5" width="5"></canvas>
<video height="5" width="5"></video>
<div style="display:inline-block">ib</div>
<div style="display:inline-table">it</div>
z
</div>
<div>block</div>
</div>
<div class="container">
<div>block</div>
<div>block</div>
<div class="fakeAnonWrapper">
a
<i>i</i><img src="bogus"><img src="bogus" alt="alt">
<canvas height="5" width="5"></canvas>
<video height="5" width="5"></video>
<div style="display:inline-block">ib</div>
<div style="display:inline-table">it</div>
z
</div>
</div>
<!-- We use explicit divs here for each anonymous wrapper-box that the testcase
is expected to produce (with class "fakeAnonWrapper", and also "table" if
it's expected to be a table wrapper) -->
<div class="container">
<div class="fakeAnonWrapper">a</div>
<div class="fakeAnonWrapper table">
<div style="display: table-cell">tc</div>
<div style="display: table-cell">tc</div>
</div>
<div class="fakeAnonWrapper">b</div>
<div class="fakeAnonWrapper table">
<div style="display: table-row">tr</div>
<div style="display: table-cell">tc</div>
</div>
<div class="fakeAnonWrapper">c</div>
<div class="fakeAnonWrapper table">
<div style="display: table-row">tr</div>
<div style="display: table-row-group">trg</div>
</div>
<div class="fakeAnonWrapper">d</div>
<table><tbody><tr><td>t</td></tr></tbody></table>
<div class="fakeAnonWrapper">e</div>
</div>
</body>
</html>

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

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<title>
Test for contiguous inline content getting wrapped in a single block,
inside of -webkit-box.
</title>
<style>
.container {
display: -webkit-box;
-webkit-box-pack: justify;
justify-content: space-between; /* XXX remove when bug 1231682 is fixed */
width: 300px;
border: 1px solid black;
font: 10px sans-serif;
margin-bottom: 10px;
}
.container > * {
background: lightgray;
}
</style>
</head>
<body>
<!-- The following containers each have a bunch of contiguous inline-level
content. In each case, all of the inline content ("a" through "z") should
get wrapped into a single anonymous block. -->
<div class="container">
a
<i>i</i><img src="bogus"><img src="bogus" alt="alt">
<canvas height="5" width="5"></canvas>
<video height="5" width="5"></video>
<div style="display:inline-block">ib</div>
<div style="display:inline-table">it</div>
z
<div>block</div>
<div>block</div>
</div>
<div class="container">
<div>block</div>
a
<i>i</i><img src="bogus"><img src="bogus" alt="alt">
<canvas height="5" width="5"></canvas>
<video height="5" width="5"></video>
<div style="display:inline-block">ib</div>
<div style="display:inline-table">it</div>
z
<div>block</div>
</div>
<div class="container">
<div>block</div>
<div>block</div>
a
<i>i</i><img src="bogus"><img src="bogus" alt="alt">
<canvas height="5" width="5"></canvas>
<video height="5" width="5"></video>
<div style="display:inline-block">ib</div>
<div style="display:inline-table">it</div>
z
</div>
<!-- This container tests how flex items are formed when table parts are placed
directly inside of a -webkit-box, alongside inline-level content.
(Table-fixup should produce an anonymous table around each contiguous run
of table-parts, and we should get an anonymous block around each piece of
raw text.) -->
<div class="container">
a
<div style="display: table-cell">tc</div>
<div style="display: table-cell">tc</div>
b
<div style="display: table-row">tr</div>
<div style="display: table-cell">tc</div>
c
<div style="display: table-row">tr</div>
<div style="display: table-row-group">trg</div>
d
<table><tbody><tr><td>t</td></tr></tbody></table>
e
</div>
</body>
</html>

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

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>
Reference Case
</title>
<style>
.container {
display: flex;
justify-content: space-between;
width: 300px;
border: 1px solid black;
font: 10px sans-serif;
}
span {
background: lightgray;
}
</style>
</head>
<body>
<!-- We use an explicit div here, to match the anonymous div that the testcase
is expected to generate around contiguous runs of inline content. -->
<div class="container">
<div>
raw text
<span>start</span>
</div>
<div>BLOCK</div>
<div>
<span>end</span>
raw text
</div>
</div>
</body>
</html>

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

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>
Test for how block-in-inline splits behave inside of -webkit-box.
</title>
<style>
.container {
display: -webkit-box;
-webkit-box-pack: justify;
justify-content: space-between; /* XXX remove when bug 1231682 is fixed */
width: 300px;
border: 1px solid black;
font: 10px sans-serif;
}
.container > * {
background: lightgray;
}
</style>
</head>
<body>
<div class="container">
raw text
<span>start<div>BLOCK</div>end</span>
raw text
</div>
</body>
</html>

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

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>
Reference Case
</title>
<style>
.container {
display: flex;
justify-content: space-between;
width: 300px;
border: 1px solid black;
}
.wspWrapper {
white-space: pre;
}
</style>
</head>
<body>
<!-- We use an explicit div here, to match the anonymous div that the testcase
is expected to generate around the whitespace. -->
<div class="container">
<div>a</div>
<div class="wspWrapper"> </div>
<div>b</div>
<div>c</div>
</div>
</body>
</html>

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

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>
Test for whether whitespace gets wrapped in an anonymous box,
inside of -webkit-box.
</title>
<style>
.container {
display: -webkit-box;
-webkit-box-pack: justify;
justify-content: space-between; /* XXX remove when bug 1231682 is fixed */
width: 300px;
border: 1px solid black;
white-space: pre;
}
</style>
</head>
<body>
<!-- Note the space characters between the first and second divs here: -->
<div class="container"><div>a</div> <div>b</div><div>c</div></div>
</body>
</html>