Bug 1236400 part 4: Add reftests to test how non-block-level content gets wrapped inside a -webkit-box. (no review)
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 24 Mar 2016 09:55:12 -0700
changeset 290333 02096dbc3c67c6fcb453a0fc3455f64245b7bc46
parent 290332 cfab09cee9d9b6e66d1ec46cdc094b02d7c855b1
child 290334 683aaa4535341d93c35ceca74141be83252bafbb
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1236400
milestone48.0a1
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
layout/reftests/webkit-box/reftest.list
layout/reftests/webkit-box/webkit-box-anon-flex-items-1-ref.html
layout/reftests/webkit-box/webkit-box-anon-flex-items-1.html
layout/reftests/webkit-box/webkit-box-anon-flex-items-2-ref.html
layout/reftests/webkit-box/webkit-box-anon-flex-items-2.html
layout/reftests/webkit-box/webkit-box-anon-flex-items-3-ref.html
layout/reftests/webkit-box/webkit-box-anon-flex-items-3.html
--- a/layout/reftests/webkit-box/reftest.list
+++ b/layout/reftests/webkit-box/reftest.list
@@ -1,12 +1,21 @@
 # This directory contains tests for "display: -webkit-box" and associated
 # 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
 
 # Tests for "-webkit-box-align" (cross-axis alignment):
 == webkit-box-align-horiz-1a.html webkit-box-align-horiz-1-ref.html
 == webkit-box-align-horiz-1b.html webkit-box-align-horiz-1-ref.html
 == webkit-box-align-vert-1.html webkit-box-align-vert-1-ref.html
 
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-anon-flex-items-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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-anon-flex-items-1.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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-anon-flex-items-2-ref.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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-anon-flex-items-2.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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-anon-flex-items-3-ref.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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-anon-flex-items-3.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>