Bug 1257688 part 4: Add reftests for -webkit-box-ordinal-group inside of display:-webkit-box. r=mats
MozReview-Commit-ID: 3B8RmfApAkN
--- a/layout/reftests/webkit-box/reftest.list
+++ b/layout/reftests/webkit-box/reftest.list
@@ -14,12 +14,22 @@ fails == webkit-box-anon-flex-items-3.ht
# 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
+# Tests for "-webkit-box-ordinal-group"
+== webkit-box-ordinal-group-1.html webkit-box-ordinal-group-1-ref.html
+# XXXdholbert The following test fails because we accept "0" as a valid value
+# for -webkit-box-ordinal-group (unlike Chrome/Blink), because that's simply
+# how its aliased property (-moz-box-ordinal-group) behaves. This shouldn't
+# matter in practice; it could only cause trouble if sites accidentally depend
+# on the "0" value being rejected.
+fails == webkit-box-ordinal-group-2.html webkit-box-ordinal-group-2-ref.html
+== webkit-box-ordinal-group-3.html webkit-box-ordinal-group-3-ref.html
+
# Tests for "-webkit-box-pack" (main-axis alignment):
== webkit-box-pack-horiz-1a.html webkit-box-pack-horiz-1-ref.html
== webkit-box-pack-horiz-1b.html webkit-box-pack-horiz-1-ref.html
== webkit-box-pack-vert-1.html webkit-box-pack-vert-1-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-ordinal-group-1-ref.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html>
+<head>
+ <title>
+ CSS Reference
+ </title>
+ <style>
+ .box {
+ display: flex;
+ border: 1px solid black;
+ margin: 5px 20px;
+ float: left; /* For testing in "rows" */
+ }
+ br { clear: both; }
+
+ .box > * {
+ border: 1px dotted purple;
+ }
+ </style>
+</head>
+<body>
+ <!-- First row: initial value mixed with single specified values -->
+ <div class="box">
+ <div>*</div>
+ <div class="bogOne">1a</div>
+ <div>*</div>
+ <div class="bogOne">1b</div>
+ <div>*</div>
+ </div>
+
+ <div class="box">
+ <div>*</div>
+ <div>*</div>
+ <div>*</div>
+ <div class="bogTwo">2a</div>
+ <div class="bogTwo">2b</div>
+ </div>
+
+ <div class="box">
+ <div>*</div>
+ <div>*</div>
+ <div>*</div>
+ <div class="bogNine">9a</div>
+ <div class="bogNine">9b</div>
+ </div>
+
+ <br>
+
+ <!-- Second row: various mixes of specified values -->
+ <div class="box">
+ <div>*</div>
+ <div class="bogOne">1</div>
+ <div class="bogTwo">2</div>
+ <div class="bogNine">9</div>
+ </div>
+
+ <div class="box">
+ <div class="bogOne">1</div>
+ <div>*</div>
+ <div class="bogTwo">2</div>
+ <div class="bogNine">9</div>
+ </div>
+
+ <div class="box">
+ <div class="bogOne">1</div>
+ <div>*</div>
+ <div class="bogTwo">2a</div>
+ <div class="bogTwo">2b</div>
+ <div class="bogNine">9</div>
+ </div>
+
+ <div class="box">
+ <div class="bogOne">1</div>
+ <div class="bogTwo">2a</div>
+ <div class="bogTwo">2b</div>
+ <div class="bogNine">9a</div>
+ <div class="bogNine">9b</div>
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-ordinal-group-1.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html>
+<head>
+ <title>
+ CSS Test: -webkit-box-orient inside a -webkit-box
+ </title>
+ <style>
+ .box {
+ display: -webkit-box;
+ border: 1px solid black;
+ margin: 5px 20px;
+ float: left; /* For testing in "rows" */
+ }
+ br { clear: both; }
+
+ .box > * {
+ border: 1px dotted purple;
+ }
+
+ .bogOne { -webkit-box-ordinal-group: 1; }
+ .bogTwo { -webkit-box-ordinal-group: 2; }
+ .bogNine { -webkit-box-ordinal-group: 9; }
+ </style>
+</head>
+<body>
+ <!-- First row: initial value mixed with single specified values -->
+ <div class="box">
+ <div>*</div>
+ <div class="bogOne">1a</div>
+ <div>*</div>
+ <div class="bogOne">1b</div>
+ <div>*</div>
+ </div>
+
+ <div class="box">
+ <div>*</div>
+ <div class="bogTwo">2a</div>
+ <div>*</div>
+ <div class="bogTwo">2b</div>
+ <div>*</div>
+ </div>
+
+ <div class="box">
+ <div>*</div>
+ <div class="bogNine">9a</div>
+ <div>*</div>
+ <div class="bogNine">9b</div>
+ <div>*</div>
+ </div>
+
+ <br>
+
+ <!-- Second row: various mixes of specified values -->
+ <div class="box">
+ <div>*</div>
+ <div class="bogOne">1</div>
+ <div class="bogTwo">2</div>
+ <div class="bogNine">9</div>
+ </div>
+
+ <div class="box">
+ <div class="bogNine">9</div>
+ <div class="bogTwo">2</div>
+ <div class="bogOne">1</div>
+ <div>*</div>
+ </div>
+
+ <div class="box">
+ <div class="bogTwo">2a</div>
+ <div class="bogNine">9</div>
+ <div class="bogTwo">2b</div>
+ <div class="bogOne">1</div>
+ <div>*</div>
+ </div>
+
+ <div class="box">
+ <div class="bogTwo">2a</div>
+ <div class="bogNine">9a</div>
+ <div class="bogNine">9b</div>
+ <div class="bogTwo">2b</div>
+ <div class="bogOne">1</div>
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-ordinal-group-2-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html>
+<head>
+ <title>
+ CSS Reference
+ </title>
+ <style>
+ .box {
+ display: flex;
+ border: 1px solid black;
+ margin: 5px 20px;
+ }
+
+ .box > * {
+ border: 1px dotted purple;
+ }
+ </style>
+</head>
+<body>
+ <div class="box">
+ <div>1</div>
+ <div>0</div>
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-ordinal-group-2.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html>
+<head>
+ <title>
+ CSS Test: -webkit-box-orient:0 inside a -webkit-box
+ </title>
+ <style>
+ .box {
+ display: -webkit-box;
+ border: 1px solid black;
+ margin: 5px 20px;
+ }
+
+ .box > * {
+ border: 1px dotted purple;
+ }
+
+ .bogZero { -webkit-box-ordinal-group: 0; }
+ .bogOne { -webkit-box-ordinal-group: 1; }
+ </style>
+</head>
+<body>
+ <!-- -webkit-box-ordinal-group is strictly positive in Blink & WebKit. 0 is
+ rejected as an invalid value. So, the bogZero element below should
+ end up with the initial value (1) and should *not* be sorted out of its
+ DOM position in the final rendering. -->
+ <div class="box">
+ <div class="bogOne">1</div>
+ <div class="bogZero">0</div>
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-ordinal-group-3-ref.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html>
+<head>
+ <title>
+ CSS Reference
+ </title>
+ <style>
+ .box {
+ display: flex;
+ border: 1px solid black;
+ margin: 5px 20px;
+ float: left; /* For testing in "rows" */
+ }
+ br { clear: both; }
+
+ .box > * {
+ border: 1px dotted purple;
+ }
+ </style>
+</head>
+<body>
+ <div class="box">
+ <div>*</div>
+ <div>10</div>
+ <div>A</div>
+ </div>
+ <div class="box">
+ <div>*</div>
+ <div>10</div>
+ <div>B</div>
+ </div>
+ <div class="box">
+ <div>*</div>
+ <div>10</div>
+ <div>C</div>
+ </div>
+
+ <br>
+
+ <div class="box">
+ <div>*</div>
+ <div>10</div>
+ <div>D</div>
+ </div>
+ <div class="box">
+ <div>*</div>
+ <div>10</div>
+ <div>E</div>
+ </div>
+ <div class="box">
+ <div>*</div>
+ <div>10</div>
+ <div>F</div>
+ </div>
+
+ <br>
+
+ <div class="box">
+ <div>A</div>
+ <div>B</div>
+ </div>
+ <div class="box">
+ <div>A</div>
+ <div>C</div>
+ </div>
+ <div class="box">
+ <div>A</div>
+ <div>D</div>
+ </div>
+ <div class="box">
+ <div>A</div>
+ <div>E</div>
+ </div>
+ <div class="box">
+ <div>A</div>
+ <div>F</div>
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/webkit-box/webkit-box-ordinal-group-3.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html>
+<head>
+ <title>
+ CSS Test: -webkit-box-orient with huge values inside a -webkit-box
+ </title>
+ <style>
+ .box {
+ display: -webkit-box;
+ border: 1px solid black;
+ margin: 5px 20px;
+ float: left; /* For testing in "rows" */
+ }
+ br { clear: both; }
+
+ .box > * {
+ border: 1px dotted purple;
+ }
+
+ .bogTen { -webkit-box-ordinal-group: 10; }
+ .bogHugeA { -webkit-box-ordinal-group: 2147483646; /* 2^31 - 2 */ }
+ .bogHugeB {
+ /* NOTE: This is INT32_MAX, so we may not be able to distinguish this
+ from anything larger than it (if we represent it internally in a
+ 32-bit signed integer). However, it's still worth testing larger
+ values against e.g. 10 to be sure they don't overflow into
+ negative territory. */
+ -webkit-box-ordinal-group: 2147483647; /* 2^31 - 1 */ }
+
+ .bogHugeC { -webkit-box-ordinal-group: 4294967294; /* 2^32 - 2 */ }
+ .bogHugeD { -webkit-box-ordinal-group: 4294967295; /* 2^32 - 1 */ }
+ .bogHugeE { -webkit-box-ordinal-group: 4294967296; /* 2^32 */ }
+ .bogHugeF { -webkit-box-ordinal-group: 8589934592; /* 2^33 */ }
+ </style>
+</head>
+<body>
+ <!-- Test each huge value to see if it sorts after smaller values.
+ (The divs with huge values should sort to the right.) -->
+ <div class="box">
+ <div class="bogHugeA">A</div>
+ <div class="bogTen">10</div>
+ <div>*</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeB">B</div>
+ <div class="bogTen">10</div>
+ <div>*</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeC">C</div>
+ <div class="bogTen">10</div>
+ <div>*</div>
+ </div>
+
+ <br>
+
+ <div class="box">
+ <div class="bogHugeD">D</div>
+ <div class="bogTen">10</div>
+ <div>*</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeE">E</div>
+ <div class="bogTen">10</div>
+ <div>*</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeE">F</div>
+ <div class="bogTen">10</div>
+ <div>*</div>
+ </div>
+
+ <br>
+
+ <!-- Test that 'bogHugeA' sorts to the left of larger huge values. It's
+ less than INT32_MAX, so it's reasonable to expect that it can be
+ compared correctly against (possibly-clamped) larger values) -->
+ <div class="box">
+ <div class="bogHugeB">B</div>
+ <div class="bogHugeA">A</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeC">C</div>
+ <div class="bogHugeA">A</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeD">D</div>
+ <div class="bogHugeA">A</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeE">E</div>
+ <div class="bogHugeA">A</div>
+ </div>
+ <div class="box">
+ <div class="bogHugeF">F</div>
+ <div class="bogHugeA">A</div>
+ </div>
+</body>
+</html>