summaryrefslogtreecommitdiffstats
path: root/layout/reftests/box-properties
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/box-properties')
-rw-r--r--layout/reftests/box-properties/CSS21-t100301-ref.xhtml23
-rw-r--r--layout/reftests/box-properties/CSS21-t100301.xhtml76
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-in-170px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-in-334px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-in-340px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-in-344px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-in-350px.pngbin0 -> 89 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-in-458px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-outside-170px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-outside-334px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-outside-340px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-outside-344px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-outside-350px.pngbin0 -> 89 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-green-outside-458px.pngbin0 -> 90 bytes
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-make-images.html55
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-ref.xhtml26
-rw-r--r--layout/reftests/box-properties/CSS21-t100303-simple.xhtml202
-rw-r--r--layout/reftests/box-properties/CSS21-t100303.xhtml191
-rw-r--r--layout/reftests/box-properties/CSS21-t100801-vertical-align-ref.xhtml27
-rw-r--r--layout/reftests/box-properties/CSS21-t100801-vertical-align.xhtml247
-rw-r--r--layout/reftests/box-properties/abspos-non-replaced-width-offset-margin-ref.html456
-rw-r--r--layout/reftests/box-properties/abspos-non-replaced-width-offset-margin.html488
-rw-r--r--layout/reftests/box-properties/abspos-replaced-width-offset-margin-narrow.pngbin0 -> 73 bytes
-rw-r--r--layout/reftests/box-properties/abspos-replaced-width-offset-margin-ref.html604
-rw-r--r--layout/reftests/box-properties/abspos-replaced-width-offset-margin-wide.pngbin0 -> 82 bytes
-rw-r--r--layout/reftests/box-properties/abspos-replaced-width-offset-margin.html612
-rw-r--r--layout/reftests/box-properties/box-sizing-1-ref.html64
-rw-r--r--layout/reftests/box-properties/box-sizing-1.html64
-rw-r--r--layout/reftests/box-properties/box-sizing-2-ref.html56
-rw-r--r--layout/reftests/box-properties/box-sizing-2.html59
-rw-r--r--layout/reftests/box-properties/box-sizing-3.html64
-rw-r--r--layout/reftests/box-properties/box-sizing-4-ref.html66
-rw-r--r--layout/reftests/box-properties/box-sizing-4.html76
-rw-r--r--layout/reftests/box-properties/box-sizing-minmax-height-ref.html57
-rw-r--r--layout/reftests/box-properties/box-sizing-minmax-height.html70
-rw-r--r--layout/reftests/box-properties/box-sizing-minmax-width-ref.html68
-rw-r--r--layout/reftests/box-properties/box-sizing-minmax-width.html83
-rw-r--r--layout/reftests/box-properties/box-sizing-mozbox-minmax-height-ref.html47
-rw-r--r--layout/reftests/box-properties/box-sizing-mozbox-minmax-height.html43
-rw-r--r--layout/reftests/box-properties/clip-auto-ref.html4
-rw-r--r--layout/reftests/box-properties/clip-auto.html6
-rw-r--r--layout/reftests/box-properties/clip-rect-auto-ref.html4
-rw-r--r--layout/reftests/box-properties/clip-rect-auto.html6
-rw-r--r--layout/reftests/box-properties/max-height-1-ref.html46
-rw-r--r--layout/reftests/box-properties/max-height-1.html46
-rw-r--r--layout/reftests/box-properties/max-width-1-ref.html46
-rw-r--r--layout/reftests/box-properties/max-width-1.html46
-rw-r--r--layout/reftests/box-properties/min-height-1-ref.html43
-rw-r--r--layout/reftests/box-properties/min-height-1.html43
-rw-r--r--layout/reftests/box-properties/min-width-1-ref.html43
-rw-r--r--layout/reftests/box-properties/min-width-1.html43
-rw-r--r--layout/reftests/box-properties/minmax-width-special-values-block-intrinsic-ref.html75
-rw-r--r--layout/reftests/box-properties/minmax-width-special-values-block-intrinsic.html75
-rw-r--r--layout/reftests/box-properties/outline-radius-percent-1-ref.html27
-rw-r--r--layout/reftests/box-properties/outline-radius-percent-1.html27
-rw-r--r--layout/reftests/box-properties/reftest-stylo.list37
-rw-r--r--layout/reftests/box-properties/reftest.list30
-rw-r--r--layout/reftests/box-properties/width-rounding-ref.html207
-rw-r--r--layout/reftests/box-properties/width-rounding.html210
-rw-r--r--layout/reftests/box-properties/width-special-values-block-intrinsic-ref.html43
-rw-r--r--layout/reftests/box-properties/width-special-values-block-intrinsic.html43
-rw-r--r--layout/reftests/box-properties/width-special-values-block-ref.html49
-rw-r--r--layout/reftests/box-properties/width-special-values-block.html54
-rw-r--r--layout/reftests/box-properties/width-special-values-cell-auto-ref.html86
-rw-r--r--layout/reftests/box-properties/width-special-values-cell-auto.html86
-rw-r--r--layout/reftests/box-properties/width-special-values-cell-fixed-ref.html66
-rw-r--r--layout/reftests/box-properties/width-special-values-cell-fixed.html67
-rw-r--r--layout/reftests/box-properties/width-special-values-float-intrinsic.html48
-rw-r--r--layout/reftests/box-properties/width-special-values-float.html56
-rw-r--r--layout/reftests/box-properties/width-special-values-image-block-ref.html42
-rw-r--r--layout/reftests/box-properties/width-special-values-image-block.html45
-rw-r--r--layout/reftests/box-properties/width-special-values-image-ref.html41
-rw-r--r--layout/reftests/box-properties/width-special-values-image.html44
73 files changed, 5658 insertions, 0 deletions
diff --git a/layout/reftests/box-properties/CSS21-t100301-ref.xhtml b/layout/reftests/box-properties/CSS21-t100301-ref.xhtml
new file mode 100644
index 000000000..18d1c2181
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100301-ref.xhtml
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS 2.1 Test Suite: Inline, non-replaced elements (reference)</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-width" />
+ <meta name="flags" content="ahem" />
+ <style type="text/css"><![CDATA[
+
+ html { background: white; }
+
+ body {
+ width: 100px; height: 100px;
+ border: 10px solid lime; background: green;
+ }
+
+
+ ]]></style>
+ </head>
+ <body>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/CSS21-t100301.xhtml b/layout/reftests/box-properties/CSS21-t100301.xhtml
new file mode 100644
index 000000000..e9d61cac8
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100301.xhtml
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS 2.1 Test Suite: Inline, non-replaced elements</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-width" />
+ <meta name="flags" content="ahem" />
+ <style type="text/css"><![CDATA[
+
+ @font-face {
+ src: url(../fonts/Ahem.ttf);
+ font-family: Ahem;
+ }
+
+ html { background: white; }
+
+ body {
+ width: 100px; height: 100px;
+ border: 10px solid lime; background: red;
+ font: 20px/1 Ahem;
+ }
+
+ span { background: red; color: green; }
+
+ .X::before, .space::before { background:green; color:transparent; }
+ .X::before { content:"X"; }
+ .space::before { content:" "; }
+
+ ]]></style>
+ </head>
+ <body>
+
+ <!-- First row -->
+ <!-- The width property does not apply -->
+ <!-- check padding-left and border-right too -->
+ <span style="width: 1px"><span class="X"></span></span
+ ><span style="width: 200px"><span class="X"></span></span
+ ><span style="width: 10px; padding-left: 10px;background:green"><span class="X"></span></span
+ ><span style="border-right: 10px solid green; width: 40px"><span class="X"></span></span>
+
+ <!-- Second row -->
+ <!-- auto values for margin-left and margin-right are zero -->
+ <span style="background:green"
+ ><span style="margin-right: auto"><span class="X"></span></span
+ ><span style="margin-left: 5px"><span class="X"></span></span
+ ><span style="margin-left:auto;background:green"><span class="space"></span></span
+ ><span style="margin-right: 15px"><span class="X"></span></span
+ ></span>
+
+ <!-- Third row -->
+ <!-- auto values for left and right are 0, and other values don't
+ do anything either, unless we have position:relative -->
+ <span style="left: auto"><span class="X"></span></span
+ ><span style="left:8px"><span class="X"></span></span
+ ><span style="right:73px"><span class="X"></span></span
+ ><span style="right:auto"><span class="X"></span></span
+ ><span style="background:transparent;color:red"><span class="X"></span><span style="position:relative;right:20px"><span class="X"></span></span></span>
+
+ <!-- Fourth row -->
+ <!-- toss in some negative and adjacent margins -->
+ <span style="margin-right: -5px;color:red;background:red"><span class="X"></span></span
+ ><span style="margin-left: -15px"><span class="X"></span></span
+ ><span style="background:green"
+ ><span style="margin-right:25px"><span class="X"></span></span
+ ><span style="margin-left: 15px"><span class="X"></span></span
+ ></span>
+
+ <!-- Fifth row -->
+ <!-- border and padding and margin -->
+ <span style="margin-left:15px; margin-right:348px"
+ ><span style="background: green; margin-left:-15px; border-left: 15px solid; padding-left: 25px;padding-right: 8px;border-right:32px solid;"><span class="X"></span></span
+ ></span>
+
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-in-170px.png b/layout/reftests/box-properties/CSS21-t100303-green-in-170px.png
new file mode 100644
index 000000000..fdb486978
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-in-170px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-in-334px.png b/layout/reftests/box-properties/CSS21-t100303-green-in-334px.png
new file mode 100644
index 000000000..d4809b364
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-in-334px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-in-340px.png b/layout/reftests/box-properties/CSS21-t100303-green-in-340px.png
new file mode 100644
index 000000000..300a54fa1
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-in-340px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-in-344px.png b/layout/reftests/box-properties/CSS21-t100303-green-in-344px.png
new file mode 100644
index 000000000..5eec68371
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-in-344px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-in-350px.png b/layout/reftests/box-properties/CSS21-t100303-green-in-350px.png
new file mode 100644
index 000000000..6e1a1021f
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-in-350px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-in-458px.png b/layout/reftests/box-properties/CSS21-t100303-green-in-458px.png
new file mode 100644
index 000000000..6cb5c2254
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-in-458px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-outside-170px.png b/layout/reftests/box-properties/CSS21-t100303-green-outside-170px.png
new file mode 100644
index 000000000..f52d6def0
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-outside-170px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-outside-334px.png b/layout/reftests/box-properties/CSS21-t100303-green-outside-334px.png
new file mode 100644
index 000000000..8aae25ca2
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-outside-334px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-outside-340px.png b/layout/reftests/box-properties/CSS21-t100303-green-outside-340px.png
new file mode 100644
index 000000000..613bfe782
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-outside-340px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-outside-344px.png b/layout/reftests/box-properties/CSS21-t100303-green-outside-344px.png
new file mode 100644
index 000000000..434ef98fa
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-outside-344px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-outside-350px.png b/layout/reftests/box-properties/CSS21-t100303-green-outside-350px.png
new file mode 100644
index 000000000..dd98e5944
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-outside-350px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-green-outside-458px.png b/layout/reftests/box-properties/CSS21-t100303-green-outside-458px.png
new file mode 100644
index 000000000..f3dc66a6e
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-green-outside-458px.png
Binary files differ
diff --git a/layout/reftests/box-properties/CSS21-t100303-make-images.html b/layout/reftests/box-properties/CSS21-t100303-make-images.html
new file mode 100644
index 000000000..c397e26af
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-make-images.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Script-Type" content="text/javascript">
+ <script type="text/javascript">
+
+ var gWidth = 1024;
+ var gHeight = 1;
+ var gBarriers = [ 170, 334, 340, 344, 350, 458 ];
+
+ var gColors = [ "green", "red" ];
+
+ function append_url(filename, contents_url) {
+ var p = document.createElement("p");
+ var a = document.createElement("a");
+ a.href = contents_url;
+ var t = document.createTextNode("CSS21-t100303-" + filename);
+ a.appendChild(t);
+ p.appendChild(a);
+ document.body.appendChild(p);
+ }
+
+ function run() {
+ var canvas = document.getElementById("canvas");
+ var cx = canvas.getContext("2d");
+ for (var i in gBarriers) {
+ var barrier = gBarriers[i];
+
+ cx.fillStyle = gColors[1];
+ cx.fillRect(0, 0, gWidth, gHeight);
+ cx.fillStyle = gColors[0];
+ cx.fillRect(0, 0, barrier, gHeight);
+ append_url(gColors[0] + "-in-" + barrier + "px.png",
+ canvas.toDataURL("image/png"));
+
+ cx.fillStyle = gColors[0];
+ cx.fillRect(0, 0, gWidth, gHeight);
+ cx.fillStyle = gColors[1];
+ cx.fillRect(0, 0, barrier, gHeight);
+ append_url(gColors[0] + "-outside-" + barrier + "px.png",
+ canvas.toDataURL("image/png"));
+ }
+ }
+
+ </script>
+</head>
+<body onload="run()">
+
+<canvas width="1024" height="1" id="canvas"></canvas>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/CSS21-t100303-ref.xhtml b/layout/reftests/box-properties/CSS21-t100303-ref.xhtml
new file mode 100644
index 000000000..aff2b921e
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-ref.xhtml
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS 2.1 Test Suite: Block-level, non-replaced elements in normal flow</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth" />
+ <meta name="flags" content="" />
+ <style type="text/css"><![CDATA[
+
+ body { direction: ltr; }
+
+ body > div {
+ margin-left: 3px;
+ width: 669px;
+ height: 96px;
+ background: green;
+ }
+ ]]></style>
+ </head>
+ <body>
+
+ <div></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/CSS21-t100303-simple.xhtml b/layout/reftests/box-properties/CSS21-t100303-simple.xhtml
new file mode 100644
index 000000000..94afe061a
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303-simple.xhtml
@@ -0,0 +1,202 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS 2.1 Test Suite: Block-level, non-replaced elements in normal flow</title>
+ <!--
+
+ THIS IS NOT THE FULL TEST. IT HAS BEEN MODIFIED TO WORK
+ AROUND THE FOLLOWING BUG:
+ https://bugzilla.mozilla.org/show_bug.cgi?id=423306
+ BY MAKING THE INTERMEDIATE ELEMENT NOT HAVE CHANGING 'direction'
+
+ -->
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth" />
+ <meta name="flags" content="" />
+ <style type="text/css"><![CDATA[
+
+ body { direction: ltr; }
+ div { height: 1px; }
+
+ /* containing block */
+ body > div {
+ margin: 0 17px 0 3px;
+ border: medium solid transparent;
+ border-width: 0 154px 0 157px;
+ padding: 0 6px 0 2px;
+ width: 350px;
+ }
+ /* parent that is not containing block */
+ /* COMMENTED OUT PER WORKAROUND DESCRIBED AT TOP */
+ /* body > div > div { display: inline; } */
+ /* test element */
+ body > div > div > div {
+ margin: 0 10px 0 6px;
+ border: medium solid transparent;
+ border-width: 0 12px 0 5px;
+ padding: 0 17px 0 9px;
+ }
+
+ /* COMMENTED OUT PER WORKAROUND DESCRIBED AT TOP */
+ body > div, /* body > div > div, */ body > div > div > div { direction: ltr; }
+ body > div.trtl > div > div { direction: rtl; }
+ /* COMMENTED OUT PER WORKAROUND DESCRIBED AT TOP */
+ /* body > div.prtl > div { direction: rtl; } */
+ body > div.cbrtl { direction: rtl; }
+ body > div.mlauto > div > div { margin-left: auto; }
+ body > div.mrauto > div > div { margin-right: auto; }
+
+ body > div.wauto > div > div { width: auto; }
+ body > div.wnarrow > div > div { width: 127px; }
+ body > div.wwide > div > div { width: 415px; }
+
+ /*
+ * make a background on the containing block that is red
+ * everywhere except where the test should draw its background
+ */
+ body > div.wnarrow { background-image: url(CSS21-t100303-green-outside-170px.png); }
+ body > div.wwide { background-image: url(CSS21-t100303-green-outside-458px.png); }
+ body > div.wauto { background-image: url(CSS21-t100303-green-outside-334px.png); }
+ body > div.wauto.mlauto { background-image: url(CSS21-t100303-green-outside-340px.png); }
+ body > div.wauto.mrauto { background-image: url(CSS21-t100303-green-outside-344px.png); }
+ body > div.wauto.mlauto.mrauto { background-image: url(CSS21-t100303-green-outside-350px.png); }
+
+ /*
+ * The only results in the markup rather than using selectors
+ * are whether the div ends up aligned to the left edge (atl),
+ * the right edge (atr), or centered (atc). Things with auto
+ * widths always count as atl, to make the style rules simpler
+ * (though they abut both edges).
+ */
+ body > div.atl { background-position: 8px 0; }
+ body > div.atl.mlauto { background-position: 2px 0; }
+
+ body > div.atr.wnarrow { background-position: 172px 0; }
+ body > div.atr.wnarrow.mrauto { background-position: 182px 0; }
+ body > div.atr.wwide { background-position: -116px 0; }
+ body > div.atr.wwide.mrauto { background-position: -106px 0; }
+
+ /* Can only be atc when mlauto and mrauto and wnarrow. */
+ body > div.atc.wnarrow { background-position: 92px 0; }
+
+ /*
+ * make a background on the test div that is green only within
+ * its desired width and red elsewhere
+ */
+ body > div.wnarrow > div > div { background-image: url(CSS21-t100303-green-in-170px.png); }
+ body > div.wwide > div > div { background-image: url(CSS21-t100303-green-in-458px.png); }
+ body > div.wauto > div > div { background-image: url(CSS21-t100303-green-in-334px.png); }
+ body > div.wauto.mlauto > div > div { background-image: url(CSS21-t100303-green-in-340px.png); }
+ body > div.wauto.mrauto > div > div { background-image: url(CSS21-t100303-green-in-344px.png); }
+ body > div.wauto.mlauto.mrauto > div > div { background-image: url(CSS21-t100303-green-in-350px.png); }
+ /* move position to border-edge */
+ body > div > div > div { background-position: -5px 0; }
+
+ /* for debugging */
+ /* body > div { background: transparent ! important; } */
+ /* body > div > div > div { background: orange ! important; } */
+
+ ]]></style>
+ </head>
+ <body>
+
+ <div class="atl wauto"><div><div></div></div></div>
+ <div class="atl wauto trtl"><div><div></div></div></div>
+ <div class="atl wauto prtl"><div><div></div></div></div>
+ <div class="atl wauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto"><div><div></div></div></div>
+ <div class="atl wauto mlauto trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto prtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto"><div><div></div></div></div>
+ <div class="atl wauto mrauto trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow"><div><div></div></div></div>
+ <div class="atl wnarrow trtl"><div><div></div></div></div>
+ <div class="atl wnarrow prtl"><div><div></div></div></div>
+ <div class="atl wnarrow prtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto prtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto prtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto prtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide"><div><div></div></div></div>
+ <div class="atl wwide trtl"><div><div></div></div></div>
+ <div class="atl wwide prtl"><div><div></div></div></div>
+ <div class="atl wwide prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide mlauto"><div><div></div></div></div>
+ <div class="atl wwide mlauto trtl"><div><div></div></div></div>
+ <div class="atl wwide mlauto prtl"><div><div></div></div></div>
+ <div class="atl wwide mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto"><div><div></div></div></div>
+ <div class="atl wwide mrauto trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto prtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto prtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/CSS21-t100303.xhtml b/layout/reftests/box-properties/CSS21-t100303.xhtml
new file mode 100644
index 000000000..463dd7ced
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100303.xhtml
@@ -0,0 +1,191 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS 2.1 Test Suite: Block-level, non-replaced elements in normal flow</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth" />
+ <meta name="flags" content="" />
+ <style type="text/css"><![CDATA[
+
+ body { direction: ltr; }
+ div { height: 1px; }
+
+ /* containing block */
+ body > div {
+ margin: 0 17px 0 3px;
+ border: medium solid transparent;
+ border-width: 0 154px 0 157px;
+ padding: 0 6px 0 2px;
+ width: 350px;
+ }
+ /* parent that is not containing block */
+ body > div > div { display: inline; }
+ /* test element */
+ body > div > div > div {
+ margin: 0 10px 0 6px;
+ border: medium solid transparent;
+ border-width: 0 12px 0 5px;
+ padding: 0 17px 0 9px;
+ }
+
+ body > div, body > div > div, body > div > div > div { direction: ltr; }
+ body > div.trtl > div > div { direction: rtl; }
+ body > div.prtl > div { direction: rtl; }
+ body > div.cbrtl { direction: rtl; }
+ body > div.mlauto > div > div { margin-left: auto; }
+ body > div.mrauto > div > div { margin-right: auto; }
+
+ body > div.wauto > div > div { width: auto; }
+ body > div.wnarrow > div > div { width: 127px; }
+ body > div.wwide > div > div { width: 415px; }
+
+ /*
+ * make a background on the containing block that is red
+ * everywhere except where the test should draw its background
+ */
+ body > div.wnarrow { background-image: url(CSS21-t100303-green-outside-170px.png); }
+ body > div.wwide { background-image: url(CSS21-t100303-green-outside-458px.png); }
+ body > div.wauto { background-image: url(CSS21-t100303-green-outside-334px.png); }
+ body > div.wauto.mlauto { background-image: url(CSS21-t100303-green-outside-340px.png); }
+ body > div.wauto.mrauto { background-image: url(CSS21-t100303-green-outside-344px.png); }
+ body > div.wauto.mlauto.mrauto { background-image: url(CSS21-t100303-green-outside-350px.png); }
+
+ /*
+ * The only results in the markup rather than using selectors
+ * are whether the div ends up aligned to the left edge (atl),
+ * the right edge (atr), or centered (atc). Things with auto
+ * widths always count as atl, to make the style rules simpler
+ * (though they abut both edges).
+ */
+ body > div.atl { background-position: 8px 0; }
+ body > div.atl.mlauto { background-position: 2px 0; }
+
+ body > div.atr.wnarrow { background-position: 172px 0; }
+ body > div.atr.wnarrow.mrauto { background-position: 182px 0; }
+ body > div.atr.wwide { background-position: -116px 0; }
+ body > div.atr.wwide.mrauto { background-position: -106px 0; }
+
+ /* Can only be atc when mlauto and mrauto and wnarrow. */
+ body > div.atc.wnarrow { background-position: 92px 0; }
+
+ /*
+ * make a background on the test div that is green only within
+ * its desired width and red elsewhere
+ */
+ body > div.wnarrow > div > div { background-image: url(CSS21-t100303-green-in-170px.png); }
+ body > div.wwide > div > div { background-image: url(CSS21-t100303-green-in-458px.png); }
+ body > div.wauto > div > div { background-image: url(CSS21-t100303-green-in-334px.png); }
+ body > div.wauto.mlauto > div > div { background-image: url(CSS21-t100303-green-in-340px.png); }
+ body > div.wauto.mrauto > div > div { background-image: url(CSS21-t100303-green-in-344px.png); }
+ body > div.wauto.mlauto.mrauto > div > div { background-image: url(CSS21-t100303-green-in-350px.png); }
+ /* move position to border-edge */
+ body > div > div > div { background-position: -5px 0; }
+
+ /* for debugging */
+ /* body > div { background: transparent ! important; } */
+ /* body > div > div > div { background: orange ! important; } */
+
+ ]]></style>
+ </head>
+ <body>
+
+ <div class="atl wauto"><div><div></div></div></div>
+ <div class="atl wauto trtl"><div><div></div></div></div>
+ <div class="atl wauto prtl"><div><div></div></div></div>
+ <div class="atl wauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto"><div><div></div></div></div>
+ <div class="atl wauto mlauto trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto prtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto"><div><div></div></div></div>
+ <div class="atl wauto mrauto trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wauto mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow"><div><div></div></div></div>
+ <div class="atl wnarrow trtl"><div><div></div></div></div>
+ <div class="atl wnarrow prtl"><div><div></div></div></div>
+ <div class="atl wnarrow prtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wnarrow cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto prtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wnarrow mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto prtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto prtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atl wnarrow mrauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto prtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atc wnarrow mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide"><div><div></div></div></div>
+ <div class="atl wwide trtl"><div><div></div></div></div>
+ <div class="atl wwide prtl"><div><div></div></div></div>
+ <div class="atl wwide prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide mlauto"><div><div></div></div></div>
+ <div class="atl wwide mlauto trtl"><div><div></div></div></div>
+ <div class="atl wwide mlauto prtl"><div><div></div></div></div>
+ <div class="atl wwide mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide mlauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto"><div><div></div></div></div>
+ <div class="atl wwide mrauto trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto prtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto cbrtl prtl trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto trtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto prtl"><div><div></div></div></div>
+ <div class="atl wwide mrauto mlauto prtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl trtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl prtl"><div><div></div></div></div>
+ <div class="atr wwide mrauto mlauto cbrtl prtl trtl"><div><div></div></div></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/CSS21-t100801-vertical-align-ref.xhtml b/layout/reftests/box-properties/CSS21-t100801-vertical-align-ref.xhtml
new file mode 100644
index 000000000..8e11729e0
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100801-vertical-align-ref.xhtml
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS 2.1 Test Suite: vertical-align (on an inline-block) (reference)</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth" />
+ <meta name="flags" content="" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <style type="text/css"><![CDATA[
+
+ body { width: 500px; height: 500px; margin: 0; position: relative; }
+ body > div {
+ position: absolute;
+ height: 50px; width: 40px;
+ top: 100px; left: 0;
+ background: green;
+ }
+
+ ]]></style>
+ </head>
+ <body>
+
+<div></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/CSS21-t100801-vertical-align.xhtml b/layout/reftests/box-properties/CSS21-t100801-vertical-align.xhtml
new file mode 100644
index 000000000..34ee8c788
--- /dev/null
+++ b/layout/reftests/box-properties/CSS21-t100801-vertical-align.xhtml
@@ -0,0 +1,247 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS 2.1 Test Suite: vertical-align (on an inline-block)</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth" />
+ <meta name="flags" content="" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <style type="text/css"><![CDATA[
+
+ body { width: 500px; height: 500px; margin: 0; position: relative; }
+ body > div { position: absolute; width: 500px; }
+
+ b { display:inline-block; height: 50px; width: 1px; background:green; }
+
+ ]]></style>
+ </head>
+ <body>
+
+<!--
+
+ The basic structure of this test is that each passing item will create
+ a box 1 pixel wide and 50px tall (stretching from 100px to 150px from
+ the top of the page). Together these items will line up to form a
+ rectangle.
+
+ This test only tests the 'top', 'bottom', 'text-top', 'text-bottom',
+ 'baseline', <length>, and <percentage> values of 'vertical-align'. It
+ does not test 'sub', 'super', or 'middle', and it does not test
+ anything relative to actual font metrics.
+
+ -->
+
+<!-- vertical-align: top -->
+
+<div style="top: 100px; left: 0;">
+ <b style="vertical-align:top"></b>
+</div>
+
+<div style="top: 100px; left: 1px;">
+ <b style="vertical-align:top"></b>
+ <span style="visibility:hidden; font-size: 10px;">text</span>
+</div>
+
+<div style="top: 100px; left: 2px;">
+ <b style="vertical-align:top"></b>
+ <span style="visibility:hidden; font-size: 100px;">text</span>
+</div>
+
+<div style="top: 100px; right: 496px; text-align: right;">
+ <span style="visibility:hidden; font-size: 10px;">text</span>
+ <b style="vertical-align:top"></b>
+</div>
+
+<div style="top: 100px; right: 495px; text-align: right;">
+ <span style="visibility:hidden; font-size: 100px;">text</span>
+ <b style="vertical-align:top"></b>
+</div>
+
+<!-- Test behavior of the rest of the line when there's a single loose
+ subtree with vertical-align: top. This isn't required by the spec, but
+ test it anyway. -->
+
+<div style="top: 100px; left: 5px;">
+ <b style="vertical-align:baseline"></b>
+ <span style="visibility:hidden; vertical-align: top; font-size: 100px;">text</span>
+</div>
+
+<div style="top: 100px; left: 6px;">
+ <b style="vertical-align:baseline"></b>
+ <span style="visibility:hidden; vertical-align: top; font-size: 10px;">text</span>
+</div>
+
+<div style="top: 100px; right: 492px; text-align: right;">
+ <span style="visibility:hidden; vertical-align: top; font-size: 100px;">text</span>
+ <b style="vertical-align:baseline"></b>
+</div>
+
+<div style="top: 100px; right: 491px; text-align: right;">
+ <span style="visibility:hidden; vertical-align: top; font-size: 10px;">text</span>
+ <b style="vertical-align:baseline"></b>
+</div>
+
+<!-- Test that we align the loose subtree, not just the box (118501) -->
+
+<div style="top: 100px; left: 9px;">
+ <span style="font-size: 10px; vertical-align: top"><b></b></span>
+</div>
+
+<div style="top: 100px; left: 10px;">
+ <span style="font-size: 100px; vertical-align: top; line-height: 0;"><b style="vertical-align:text-top"></b></span>
+</div>
+
+<!-- vertical-align: bottom -->
+
+<div style="bottom: 350px; left: 11px;">
+ <b style="vertical-align:bottom"></b>
+</div>
+
+<div style="bottom: 350px; left: 12px;">
+ <b style="vertical-align:bottom"></b>
+ <span style="visibility:hidden; font-size: 10px;">text</span>
+</div>
+
+<div style="bottom: 350px; left: 13px;">
+ <b style="vertical-align:bottom"></b>
+ <span style="visibility:hidden; font-size: 100px;">text</span>
+</div>
+
+<div style="bottom: 350px; right: 485px; text-align: right;">
+ <span style="visibility:hidden; font-size: 10px;">text</span>
+ <b style="vertical-align:bottom"></b>
+</div>
+
+<div style="bottom: 350px; right: 484px; text-align: right;">
+ <span style="visibility:hidden; font-size: 100px;">text</span>
+ <b style="vertical-align:bottom"></b>
+</div>
+
+<!-- Test behavior of the rest of the line when there's a single loose
+ subtree with vertical-align: bottom. This isn't required by the spec, but
+ test it anyway. -->
+
+<div style="bottom: 350px; left: 16px;">
+ <b style="vertical-align:text-top"></b>
+ <span style="visibility:hidden; vertical-align: bottom; font-size: 100px;">text</span>
+</div>
+
+<div style="bottom: 350px; left: 17px;">
+ <b style="vertical-align:text-top"></b>
+ <span style="visibility:hidden; vertical-align: bottom; font-size: 10px;">text</span>
+</div>
+
+<div style="bottom: 350px; right: 481px; text-align: right;">
+ <span style="visibility:hidden; vertical-align: bottom; font-size: 100px;">text</span>
+ <b style="vertical-align:text-top"></b>
+</div>
+
+<div style="bottom: 350px; right: 480px; text-align: right;">
+ <span style="visibility:hidden; vertical-align: bottom; font-size: 10px;">text</span>
+ <b style="vertical-align:text-top"></b>
+</div>
+
+<!-- Test that we align the loose subtree, not just the box (118501) -->
+
+<div style="bottom: 350px; left: 20px;">
+ <span style="font-size: 10px; vertical-align: bottom"><b style="vertical-align:text-top"></b></span>
+</div>
+
+<div style="bottom: 350px; left: 21px;">
+ <span style="font-size: 100px; vertical-align: bottom; line-height: 0;"><b style="vertical-align:text-bottom"></b></span>
+</div>
+
+<!-- test top and bottom nested within other things -->
+
+<div style="top: 100px; left: 22px;">
+ <span style="font-size: 100px; vertical-align: text-top">
+ <span style="font-size: 10px; vertical-align: text-bottom">
+ <b style="vertical-align:top"></b>
+ </span>
+ </span>
+</div>
+
+<div style="bottom: 350px; left: 23px;">
+ <span style="font-size: 100px; vertical-align: text-bottom">
+ <span style="font-size: 10px; vertical-align: text-top">
+ <b style="vertical-align:bottom"></b>
+ </span>
+ </span>
+</div>
+
+<!-- test top and bottom within the same box -->
+
+<div style="top: 100px; left: 24px;">
+ <b style="vertical-align:top"></b
+ ><b style="vertical-align:bottom"></b>
+</div>
+
+<div style="bottom: 350px; left: 26px; font-size: 10px">
+ <b style="vertical-align:bottom"></b
+ ><b style="vertical-align:top"></b
+ ><b style="vertical-align: -10px"></b>
+</div>
+
+<div style="top: 100px; left: 29px; font-size: 10px">
+ <b style="vertical-align: -10px"></b
+ ><b style="vertical-align:top"></b
+ ><b style="vertical-align:bottom"></b>
+</div>
+
+<!-- test vertical-align: length -->
+
+<div style="top: 100px; left: 32px; font-size: 10px">
+ <b style="vertical-align: baseline; height: 40px"></b
+ ><b style="vertical-align: 20px; height: 20px"></b
+ ><b style="vertical-align: -10px; height: 10px; margin-left: -2px"></b
+ ><b style="vertical-align: -10px; height: 30px"></b>
+</div>
+
+<!-- test vertical-align: percentage -->
+
+<div style="top: 100px; left: 34px; font-size: 10px; line-height: 10px;">
+ <b style="vertical-align: baseline; height: 40px"></b
+ ><b style="vertical-align: 200%; height: 20px"></b
+ ><b style="vertical-align: -25%; height: 10px; margin-left: -2px; line-height: 40px;"></b
+ ><b style="vertical-align: -100%; height: 30px;line-height:10px"></b>
+</div>
+
+<!-- test vertical-align: text-top -->
+
+<div style="top: 100px; left: 36px; font-size: 10px; line-height: 2px;">
+ <!-- we're testing:
+ 1) that the top of the first b's background is even with the top of
+ the span's background, which is likewise even with the top of the
+ line box (thanks to the b's contribution)
+ 2) that the second b (which serves to fill the area under the span)
+ is aligned relative to its parent, not to the line box
+ -->
+ <span style="background:green"
+ ><b style="vertical-align: text-top"></b
+ ><span style="vertical-align: -8px"
+ ><b style="vertical-align: text-top; height: 42px"></b
+ ></span
+ ></span>
+</div>
+
+<!-- test vertical-align: text-bottom -->
+
+<div style="bottom: 350px; left: 38px; font-size: 10px; line-height: 2px;">
+ <!-- we're testing:
+ 1) that the bottom of the first b's background is even with the bottom of
+ the span's background, which is likewise even with the bottom of the
+ line box (thanks to the b's contribution)
+ 2) that the second b (which serves to fill the area under the span)
+ is aligned relative to its parent, not to the line box
+ -->
+ <span style="background:green"
+ ><b style="vertical-align: text-bottom"></b
+ ><span style="vertical-align: 8px"
+ ><b style="vertical-align: text-bottom; height: 42px"></b
+ ></span
+ ></span>
+</div>
+
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/abspos-non-replaced-width-offset-margin-ref.html b/layout/reftests/box-properties/abspos-non-replaced-width-offset-margin-ref.html
new file mode 100644
index 000000000..f48fc4263
--- /dev/null
+++ b/layout/reftests/box-properties/abspos-non-replaced-width-offset-margin-ref.html
@@ -0,0 +1,456 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html401/strict.dtd">
+<html>
+<head>
+<title>Test, CSS 2.1, section 10.3.7</title>
+<style type="text/css">
+
+html, body { margin: 0; padding: 0; border: none; }
+div { height: 1px; background: navy; margin-right: 19px; }
+
+</style>
+</head>
+<body>
+
+<!-- ***** NARROW WIDTH ***** -->
+
+<!-- nothing auto -->
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<!-- only left auto -->
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<!-- only right auto -->
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<!-- left and right auto -->
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<!-- only margin-left auto -->
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<!-- left and margin-left auto -->
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<div style="margin-left: 496px; width: 177px;"></div>
+<!-- right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<!-- left and right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<div style="margin-left: 454px; width: 177px;"></div>
+<!-- only margin-right auto -->
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<!-- left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<!-- right and margin-right auto -->
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<div style="margin-left: 70px; width: 177px;"></div>
+<!-- left and right and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 167px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+<!-- margin-left and margin-right auto -->
+<div style="margin-left: 284px; width: 177px;"></div>
+<div style="margin-left: 284px; width: 177px;"></div>
+<div style="margin-left: 284px; width: 177px;"></div>
+<div style="margin-left: 284px; width: 177px;"></div>
+<div style="margin-left: 284px; width: 177px;"></div>
+<div style="margin-left: 284px; width: 177px;"></div>
+<div style="margin-left: 284px; width: 177px;"></div>
+<div style="margin-left: 284px; width: 177px;"></div>
+<!-- left and margin-left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<div style="margin-left: 515px; width: 177px;"></div>
+<!-- right and margin-left and margin-right auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<div style="margin-left: 53px; width: 177px;"></div>
+<!-- left and right and margin-left and margin-right auto (margin-left and margin-right like 0) -->
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 150px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+<div style="margin-left: 473px; width: 177px;"></div>
+
+<!-- AUTO WIDTH -->
+
+<!-- nothing auto -->
+<div style="margin-left: 70px; width: 603px;"></div>
+<div style="margin-left: 70px; width: 603px;"></div>
+<div style="margin-left: 70px; width: 603px;"></div>
+<div style="margin-left: 70px; width: 603px;"></div>
+<div style="margin-left: 70px; width: 603px;"></div>
+<div style="margin-left: 70px; width: 603px;"></div>
+<div style="margin-left: 70px; width: 603px;"></div>
+<div style="margin-left: 70px; width: 603px;"></div>
+<!-- only left auto -->
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<!-- only right auto -->
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<!-- left and right auto -->
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<!-- only margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 620px;"></div>
+<div style="margin-left: 53px; width: 620px;"></div>
+<div style="margin-left: 53px; width: 620px;"></div>
+<div style="margin-left: 53px; width: 620px;"></div>
+<div style="margin-left: 53px; width: 620px;"></div>
+<div style="margin-left: 53px; width: 620px;"></div>
+<div style="margin-left: 53px; width: 620px;"></div>
+<div style="margin-left: 53px; width: 620px;"></div>
+<!-- left and margin-left auto -->
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<div style="margin-left: 577px; width: 96px;"></div>
+<!-- right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<!-- left and right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<div style="margin-left: 535px; width: 96px;"></div>
+<!-- only margin-right auto (margin-right like 0) -->
+<div style="margin-left: 70px; width: 622px;"></div>
+<div style="margin-left: 70px; width: 622px;"></div>
+<div style="margin-left: 70px; width: 622px;"></div>
+<div style="margin-left: 70px; width: 622px;"></div>
+<div style="margin-left: 70px; width: 622px;"></div>
+<div style="margin-left: 70px; width: 622px;"></div>
+<div style="margin-left: 70px; width: 622px;"></div>
+<div style="margin-left: 70px; width: 622px;"></div>
+<!-- left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<!-- right and margin-right auto -->
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<div style="margin-left: 70px; width: 96px;"></div>
+<!-- left and right and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 167px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+<!-- margin-left and margin-right auto (both like 0) -->
+<div style="margin-left: 53px; width: 639px;"></div>
+<div style="margin-left: 53px; width: 639px;"></div>
+<div style="margin-left: 53px; width: 639px;"></div>
+<div style="margin-left: 53px; width: 639px;"></div>
+<div style="margin-left: 53px; width: 639px;"></div>
+<div style="margin-left: 53px; width: 639px;"></div>
+<div style="margin-left: 53px; width: 639px;"></div>
+<div style="margin-left: 53px; width: 639px;"></div>
+<!-- left and margin-left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<div style="margin-left: 596px; width: 96px;"></div>
+<!-- right and margin-left and margin-right auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<div style="margin-left: 53px; width: 96px;"></div>
+<!-- left and right and margin-left and margin-right auto (margin-left and margin-right like 0) -->
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 150px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+<div style="margin-left: 554px; width: 96px;"></div>
+
+<!-- ***** WIDE WIDTH ***** -->
+
+<!-- nothing auto -->
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<!-- only left auto -->
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<!-- only right auto -->
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<!-- left and right auto -->
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<!-- only margin-left auto -->
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<!-- left and margin-left auto -->
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<div style="margin-left: -11px; width: 684px;"></div>
+<!-- right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<!-- left and right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<div style="margin-left: -53px; width: 684px;"></div>
+<!-- only margin-right auto -->
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<!-- left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<!-- right and margin-right auto -->
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<div style="margin-left: 70px; width: 684px;"></div>
+<!-- left and right and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: 167px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+<!-- margin-left and margin-right auto (alternately like 0) -->
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<!-- left and margin-left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<div style="margin-left: 8px; width: 684px;"></div>
+<!-- right and margin-left and margin-right auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<div style="margin-left: 53px; width: 684px;"></div>
+<!-- left and right and margin-left and margin-right auto (margin-left and margin-right like 0) -->
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: 150px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+<div style="margin-left: -34px; width: 684px;"></div>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/abspos-non-replaced-width-offset-margin.html b/layout/reftests/box-properties/abspos-non-replaced-width-offset-margin.html
new file mode 100644
index 000000000..2f67f9fd1
--- /dev/null
+++ b/layout/reftests/box-properties/abspos-non-replaced-width-offset-margin.html
@@ -0,0 +1,488 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html401/strict.dtd">
+<html>
+<head>
+<title>Test, CSS 2.1, section 10.3.7</title>
+<style type="text/css">
+
+div { height: 1px; direction: ltr; }
+
+/*
+ * Every case here has three divs nested inside of each other. The
+ * innermost div (absolutely positioned) is the testcase (and has
+ * color). The middle div's content edge establishes the containing
+ * block it would have if it were statically positioned. The outermost
+ * div is actually its containing block.
+ *
+ * the abs pos containing block runs from 50px to 700px from the left edge
+ * the static pos containing block runs from 150px to 650px from the left edge
+ */
+
+/* totals for html and body: 21px on the left, 34px on the right */
+html, body { border: transparent medium solid; }
+html { margin: 0 3px 0 2px; padding: 0 4px 0 3px; border-width: 0 3px 0 8px; }
+body { margin: 0 6px 0 3px; padding: 0 7px 0 1px; border-width: 0 11px 0 4px; }
+
+body > div {
+ position: relative;
+
+ top: 0;
+ left: 4px;
+
+ margin-left: 16px;
+ border-left: 9px solid transparent;
+ /* sum of above items (29px), plus 21px above, is 50px */
+ padding-left: 40px;
+
+ width: 595px;
+
+ padding-right: 15px;
+ /* sum of above items (650px), plus 50px above, is 700px */
+
+ border-right: 27px solid transparent;
+ margin-right: 13px;
+}
+
+body > div > div {
+ /* padding-left above: 40px */
+ margin-left: 7px;
+ border-left: 29px solid transparent;
+ padding-left: 24px;
+ /* sum of above items (100px), plus 50px above, is 150px */
+
+ /* padding-right above: 15px */
+ padding-right: 14px;
+ border-right: 3px solid transparent;
+ margin-right: 18px;
+ /* sum of above items (50px), subtracted from 700px, is 650px */
+}
+
+body > div > div > div {
+ background: navy;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+
+ /* specify everything; we'll put the autos as overrides below */
+ left: 3px;
+ margin-left: 17px;
+ border-left: 6px solid transparent;
+ padding-left: 1px;
+ padding-right: 9px;
+ border-right: 8px solid transparent;
+ margin-right: 19px;
+ right: 8px;
+}
+
+/* and give it 72px of intrinsic width for the case where it has width:auto */
+body > div > div > div > div {
+ width: 72px;
+}
+
+/* now we want to test all 128 combinations of presence of the following */
+
+body > div.adir { direction: rtl; }
+body > div.sdir > div { direction: rtl; }
+body > div.edir > div > div { direction: rtl; }
+body > div.ol > div > div { left: auto; }
+body > div.or > div > div { right: auto; }
+body > div.ml > div > div { margin-left: auto; }
+body > div.mr > div > div { margin-right: auto; }
+
+/* combined with each of these three */
+body > div.narrowwidth > div > div { width: 153px; }
+body > div.autowidth > div > div { width: auto; }
+body > div.widewidth > div > div { width: 660px; }
+
+</style>
+</head>
+<body>
+
+<div class="narrowwidth"><div><div><div></div></div></div></div>
+<div class="narrowwidth adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or"><div><div><div></div></div></div></div>
+<div class="narrowwidth or adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth ml or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol edir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol edir adir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="narrowwidth mr ml or ol edir sdir adir"><div><div><div></div></div></div></div>
+
+<div class="autowidth"><div><div><div></div></div></div></div>
+<div class="autowidth adir"><div><div><div></div></div></div></div>
+<div class="autowidth sdir"><div><div><div></div></div></div></div>
+<div class="autowidth sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth edir"><div><div><div></div></div></div></div>
+<div class="autowidth edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ol"><div><div><div></div></div></div></div>
+<div class="autowidth ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth or"><div><div><div></div></div></div></div>
+<div class="autowidth or adir"><div><div><div></div></div></div></div>
+<div class="autowidth or sdir"><div><div><div></div></div></div></div>
+<div class="autowidth or sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth or edir"><div><div><div></div></div></div></div>
+<div class="autowidth or edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth or edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth or ol"><div><div><div></div></div></div></div>
+<div class="autowidth or ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth or ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth or ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth or ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml"><div><div><div></div></div></div></div>
+<div class="autowidth ml adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml edir"><div><div><div></div></div></div></div>
+<div class="autowidth ml edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or"><div><div><div></div></div></div></div>
+<div class="autowidth ml or adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or edir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth ml or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr"><div><div><div></div></div></div></div>
+<div class="autowidth mr adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or"><div><div><div></div></div></div></div>
+<div class="autowidth mr or adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol edir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol edir adir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="autowidth mr ml or ol edir sdir adir"><div><div><div></div></div></div></div>
+
+<div class="widewidth"><div><div><div></div></div></div></div>
+<div class="widewidth adir"><div><div><div></div></div></div></div>
+<div class="widewidth sdir"><div><div><div></div></div></div></div>
+<div class="widewidth sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth edir"><div><div><div></div></div></div></div>
+<div class="widewidth edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ol"><div><div><div></div></div></div></div>
+<div class="widewidth ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth or"><div><div><div></div></div></div></div>
+<div class="widewidth or adir"><div><div><div></div></div></div></div>
+<div class="widewidth or sdir"><div><div><div></div></div></div></div>
+<div class="widewidth or sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth or edir"><div><div><div></div></div></div></div>
+<div class="widewidth or edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth or edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth or ol"><div><div><div></div></div></div></div>
+<div class="widewidth or ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth or ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth or ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth or ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml"><div><div><div></div></div></div></div>
+<div class="widewidth ml adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml edir"><div><div><div></div></div></div></div>
+<div class="widewidth ml edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or"><div><div><div></div></div></div></div>
+<div class="widewidth ml or adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or edir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth ml or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr"><div><div><div></div></div></div></div>
+<div class="widewidth mr adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or"><div><div><div></div></div></div></div>
+<div class="widewidth mr or adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr or ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml ol edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or edir sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol sdir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol edir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol edir adir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol edir sdir"><div><div><div></div></div></div></div>
+<div class="widewidth mr ml or ol edir sdir adir"><div><div><div></div></div></div></div>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/abspos-replaced-width-offset-margin-narrow.png b/layout/reftests/box-properties/abspos-replaced-width-offset-margin-narrow.png
new file mode 100644
index 000000000..b36c5f4f9
--- /dev/null
+++ b/layout/reftests/box-properties/abspos-replaced-width-offset-margin-narrow.png
Binary files differ
diff --git a/layout/reftests/box-properties/abspos-replaced-width-offset-margin-ref.html b/layout/reftests/box-properties/abspos-replaced-width-offset-margin-ref.html
new file mode 100644
index 000000000..38aed2c96
--- /dev/null
+++ b/layout/reftests/box-properties/abspos-replaced-width-offset-margin-ref.html
@@ -0,0 +1,604 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html401/strict.dtd">
+<html>
+<head>
+<title>Test, CSS 2.1, section 10.3.8</title>
+<style type="text/css">
+
+html, body { margin: 0; padding: 0; border: none; }
+div { height: 1px; background: blue;
+ border-left: 7px solid navy; border-right: 17px solid navy; margin-right: 19px; }
+
+</style>
+</head>
+<body>
+
+<!-- ***** WIDE WIDTH ***** -->
+
+<!-- nothing auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- only left auto -->
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- only right auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<!-- left and right auto -->
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<!-- only margin-left auto -->
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- left and margin-left auto -->
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<!-- left and right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<!-- only margin-right auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<!-- left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<!-- right and margin-right auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<!-- left and right and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<!-- margin-left and margin-right auto (alternately like 0) -->
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<!-- left and margin-left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<!-- right and margin-left and margin-right auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<!-- left and right and margin-left and margin-right auto (margin-left and margin-right like 0) -->
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+
+<!-- ***** NARROW WIDTH ***** -->
+
+<!-- nothing auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- only left auto -->
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- only right auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<!-- left and right auto -->
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<!-- only margin-left auto -->
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- left and margin-left auto -->
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<!-- left and right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<!-- only margin-right auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<!-- left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<!-- right and margin-right auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<!-- left and right and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<!-- margin-left and margin-right auto -->
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<!-- left and margin-left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<!-- right and margin-left and margin-right auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<!-- left and right and margin-left and margin-right auto (margin-left and margin-right like 0) -->
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+
+<!-- ***** NARROW WIDTH ***** -->
+
+<!-- nothing auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- only left auto -->
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- only right auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<!-- left and right auto -->
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<!-- only margin-left auto -->
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- left and margin-left auto -->
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<div style="margin-left: 496px; width: 153px;"></div>
+<!-- right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<!-- left and right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<div style="margin-left: 454px; width: 153px;"></div>
+<!-- only margin-right auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<!-- left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<!-- right and margin-right auto -->
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<div style="margin-left: 70px; width: 153px;"></div>
+<!-- left and right and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 167px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<!-- margin-left and margin-right auto -->
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<div style="margin-left: 284px; width: 153px;"></div>
+<!-- left and margin-left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<div style="margin-left: 515px; width: 153px;"></div>
+<!-- right and margin-left and margin-right auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<div style="margin-left: 53px; width: 153px;"></div>
+<!-- left and right and margin-left and margin-right auto (margin-left and margin-right like 0) -->
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 150px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+<div style="margin-left: 473px; width: 153px;"></div>
+
+<!-- ***** WIDE WIDTH ***** -->
+
+<!-- nothing auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- only left auto -->
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- only right auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<!-- left and right auto -->
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<!-- only margin-left auto -->
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- left and margin-left auto -->
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<div style="margin-left: -11px; width: 660px;"></div>
+<!-- right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<!-- left and right and margin-left auto (margin-left like 0) -->
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<div style="margin-left: -53px; width: 660px;"></div>
+<!-- only margin-right auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<!-- left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<!-- right and margin-right auto -->
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<div style="margin-left: 70px; width: 660px;"></div>
+<!-- left and right and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: 167px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<!-- margin-left and margin-right auto (alternately like 0) -->
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<!-- left and margin-left and margin-right auto (margin-right like 0) -->
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<div style="margin-left: 8px; width: 660px;"></div>
+<!-- right and margin-left and margin-right auto (margin-left like 0) -->
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<div style="margin-left: 53px; width: 660px;"></div>
+<!-- left and right and margin-left and margin-right auto (margin-left and margin-right like 0) -->
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: 150px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+<div style="margin-left: -34px; width: 660px;"></div>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/abspos-replaced-width-offset-margin-wide.png b/layout/reftests/box-properties/abspos-replaced-width-offset-margin-wide.png
new file mode 100644
index 000000000..ef3fce2dc
--- /dev/null
+++ b/layout/reftests/box-properties/abspos-replaced-width-offset-margin-wide.png
Binary files differ
diff --git a/layout/reftests/box-properties/abspos-replaced-width-offset-margin.html b/layout/reftests/box-properties/abspos-replaced-width-offset-margin.html
new file mode 100644
index 000000000..a8417dad4
--- /dev/null
+++ b/layout/reftests/box-properties/abspos-replaced-width-offset-margin.html
@@ -0,0 +1,612 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html401/strict.dtd">
+<html>
+<head>
+<title>Test, CSS 2.1, section 10.3.8</title>
+<style type="text/css">
+
+div { height: 1px; direction: ltr; }
+
+/*
+ * Every case here has two divs and an image nested inside of each other. The
+ * innermost div (absolutely positioned) is the testcase (and has
+ * color). The middle div's content edge establishes the containing
+ * block it would have if it were statically positioned. The outermost
+ * div is actually its containing block.
+ *
+ * the abs pos containing block runs from 50px to 700px from the left edge
+ * the static pos containing block runs from 150px to 650px from the left edge
+ */
+
+/* totals for html and body: 21px on the left, 34px on the right */
+html, body { border: transparent medium solid; }
+html { margin: 0 3px 0 2px; padding: 0 4px 0 3px; border-width: 0 3px 0 8px; }
+body { margin: 0 6px 0 3px; padding: 0 7px 0 1px; border-width: 0 11px 0 4px; }
+
+body > div {
+ position: relative;
+
+ top: 0;
+ left: 4px;
+
+ margin-left: 16px;
+ border-left: 9px solid transparent;
+ /* sum of above items (29px), plus 21px above, is 50px */
+ padding-left: 40px;
+
+ width: 595px;
+
+ padding-right: 15px;
+ /* sum of above items (650px), plus 50px above, is 700px */
+
+ border-right: 27px solid transparent;
+ margin-right: 13px;
+}
+
+body > div > div {
+ /* padding-left above: 40px */
+ margin-left: 7px;
+ border-left: 29px solid transparent;
+ padding-left: 24px;
+ /* sum of above items (100px), plus 50px above, is 150px */
+
+ /* padding-right above: 15px */
+ padding-right: 14px;
+ border-right: 3px solid transparent;
+ margin-right: 18px;
+ /* sum of above items (50px), subtracted from 700px, is 650px */
+}
+
+body > div > div > img {
+ background: navy;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+
+ /* specify everything; we'll put the autos as overrides below */
+ left: 3px;
+ margin-left: 17px;
+ border-left: 6px solid transparent;
+ padding-left: 1px;
+ padding-right: 9px;
+ border-right: 8px solid transparent;
+ margin-right: 19px;
+ right: 8px;
+}
+
+/* now we want to test all 128 combinations of presence of the following */
+
+body > div.adir { direction: rtl; }
+body > div.sdir > div { direction: rtl; }
+body > div.edir > div > img { direction: rtl; }
+body > div.ol > div > img { left: auto; }
+body > div.or > div > img { right: auto; }
+body > div.ml > div > img { margin-left: auto; }
+body > div.mr > div > img { margin-right: auto; }
+
+/* combined with each of these three (as appropriate for narrow/wide images) */
+body > div.narrowwidth > div > img { width: 153px; height: 1px; }
+body > div.autowidth > div > img { width: auto; }
+body > div.widewidth > div > img { width: 660px; height: 1px; }
+
+</style>
+</head>
+<body>
+
+<div class="autowidth"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="autowidth mr ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+
+<div class="narrowwidth"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+<div class="narrowwidth mr ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-wide.png"></div></div>
+
+<div class="autowidth"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="autowidth mr ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+
+<div class="widewidth"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol edir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol edir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol edir sdir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+<div class="widewidth mr ml or ol edir sdir adir"><div><img alt="" src="abspos-replaced-width-offset-margin-narrow.png"></div></div>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-1-ref.html b/layout/reftests/box-properties/box-sizing-1-ref.html
new file mode 100644
index 000000000..42aee1771
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-1-ref.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>test of box-sizing</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+ table { border-spacing: 0; margin: 0; }
+ td { border: 1px solid; padding: 1px; }
+
+ td > div { width: 100px; }
+
+ td > div > div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ margin-bottom: 1px;
+
+ float: left;
+ clear: left;
+ }
+
+ </style>
+</head>
+<body>
+
+<table><tr>
+
+<td id="bscontent"><div>
+
+<!-- box-sizing: content-box -->
+<div style="width: 37px">A B</div>
+<div style="width: auto">A B</div>
+<div style="width: auto">A<br>B</div>
+<div style="width: auto">A B</div>
+<div style="width: 37px">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60px">A B</div>
+
+</div></td>
+
+<td id="bsborder"><div>
+<!-- box-sizing: border-box -->
+<div style="width: 37px">A B</div>
+<div style="width: auto">A B</div>
+<div style="width: auto">A<br>B</div>
+<div style="width: auto">A B</div>
+<div style="width: 37px">A B</div>
+<div style="width: 20px">A B</div>
+<div style="width: 30px">A B</div>
+
+</div></td>
+
+</tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-1.html b/layout/reftests/box-properties/box-sizing-1.html
new file mode 100644
index 000000000..83c9c1d01
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-1.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>test of box-sizing</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+ table { border-spacing: 0; margin: 0; }
+ td { border: 1px solid; padding: 1px; }
+
+ td > div { width: 100px; }
+
+ td#bscontent > div > div { box-sizing: content-box; }
+ td#bsborder > div > div { box-sizing: border-box; }
+
+ td > div > div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ margin-bottom: 1px;
+ }
+
+ </style>
+</head>
+<body>
+
+<table><tr>
+
+<td id="bscontent"><div>
+
+<!-- box-sizing: content-box -->
+<div style="width: auto">A B</div>
+<div style="width: -moz-max-content">A B</div>
+<div style="width: -moz-min-content">A B</div>
+<div style="width: -moz-fit-content">A B</div>
+<div style="width: -moz-available">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60%">A B</div>
+
+</div></td>
+
+<td id="bsborder"><div>
+<!-- box-sizing: border-box -->
+<div style="width: auto">A B</div>
+<div style="width: -moz-max-content">A B</div>
+<div style="width: -moz-min-content">A B</div>
+<div style="width: -moz-fit-content">A B</div>
+<div style="width: -moz-available">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60%">A B</div>
+
+</div></td>
+
+</tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-2-ref.html b/layout/reftests/box-properties/box-sizing-2-ref.html
new file mode 100644
index 000000000..b11313ed4
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-2-ref.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>test of box-sizing</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+ table { border-spacing: 0; margin: 0; }
+ td { border: 1px solid; padding: 1px solid; }
+
+ td td > div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ }
+
+ </style>
+</head>
+<body>
+
+<table><tr>
+
+<td id="bscontent">
+
+<!-- box-sizing: content-box -->
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div>A<br>B</div></td></tr></table>
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div style="width: 150px">A B</div></td></tr></table>
+
+</td>
+
+<td id="bsborder">
+<!-- box-sizing: border-box -->
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div>A<br>B</div></td></tr></table>
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div>A B</div></td></tr></table>
+<table><tr><td><div style="width: 120px">A B</div></td></tr></table>
+
+</td>
+
+</tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-2.html b/layout/reftests/box-properties/box-sizing-2.html
new file mode 100644
index 000000000..d61d8184f
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-2.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>test of box-sizing</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+ table { border-spacing: 0; margin: 0; }
+ td { border: 1px solid; padding: 1px solid; }
+
+ td#bscontent td > div { box-sizing: content-box; }
+ td#bsborder td > div { box-sizing: border-box; }
+
+ td td > div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ }
+
+ </style>
+</head>
+<body>
+
+<table><tr>
+
+<td id="bscontent">
+
+<!-- box-sizing: content-box -->
+<table><tr><td><div style="width: auto">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-max-content">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-min-content">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-fit-content">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-available">A B</div></td></tr></table>
+<table><tr><td><div style="width: 150px">A B</div></td></tr></table>
+
+</td>
+
+<td id="bsborder">
+<!-- box-sizing: border-box -->
+<table><tr><td><div style="width: auto">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-max-content">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-min-content">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-fit-content">A B</div></td></tr></table>
+<table><tr><td><div style="width: -moz-available">A B</div></td></tr></table>
+<table><tr><td><div style="width: 150px">A B</div></td></tr></table>
+
+</td>
+
+</tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-3.html b/layout/reftests/box-properties/box-sizing-3.html
new file mode 100644
index 000000000..dd4391d4c
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-3.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>test of box-sizing</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+ table { border-spacing: 0; margin: 0; }
+ td { border: 1px solid; padding: 1px solid; }
+
+ td > div { width: 100px; }
+
+ td#bscontent > div > div { box-sizing: content-box; }
+ td#bsborder > div > div { box-sizing: border-box; }
+
+ td > div > div {
+ margin-left: 1%;
+ border-left: 2px solid;
+ padding-left: 4%;
+ padding-right: 8%;
+ border-right: 16px solid;
+ margin-right: 32%;
+
+ background: yellow;
+ margin-bottom: 1px;
+ }
+
+ </style>
+</head>
+<body>
+
+<table><tr>
+
+<td id="bscontent"><div>
+
+<!-- box-sizing: content-box -->
+<div style="width: auto">A B</div>
+<div style="width: -moz-max-content">A B</div>
+<div style="width: -moz-min-content">A B</div>
+<div style="width: -moz-fit-content">A B</div>
+<div style="width: -moz-available">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60%">A B</div>
+
+</div></td>
+
+<td id="bsborder"><div>
+<!-- box-sizing: border-box -->
+<div style="width: auto">A B</div>
+<div style="width: -moz-max-content">A B</div>
+<div style="width: -moz-min-content">A B</div>
+<div style="width: -moz-fit-content">A B</div>
+<div style="width: -moz-available">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60%">A B</div>
+
+</div></td>
+
+</tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-4-ref.html b/layout/reftests/box-properties/box-sizing-4-ref.html
new file mode 100644
index 000000000..b2a149dbe
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-4-ref.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>test of box-sizing</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+ table { border-spacing: 0; margin: 0 100px; }
+ td { border: 1px solid; padding: 1px solid; }
+
+ td > div { width: 100px; }
+
+ td > div > div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ margin-bottom: 10px;
+ float: right;
+ clear: right;
+ text-align: right;
+ height: 40px;
+ right: 0;
+ }
+
+ </style>
+</head>
+<body>
+
+<table><tr>
+
+<td id="bscontent"><div>
+
+<!-- box-sizing: content-box -->
+<div>A B</div>
+<div>A B</div>
+<div>A<br>B</div>
+<div>A B</div>
+<div style="width: 37px">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60px">A B</div>
+
+</div></td>
+
+<td id="bsborder"><div>
+<!-- box-sizing: border-box -->
+<div>A B</div>
+<div>A B</div>
+<div>A<br>B</div>
+<div>A B</div>
+<div style="width: 37px">A B</div>
+<div style="width: 20px">A B</div>
+<div style="width: 30px">A B</div>
+
+</div></td>
+
+</tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-4.html b/layout/reftests/box-properties/box-sizing-4.html
new file mode 100644
index 000000000..f02eb1292
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-4.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>test of box-sizing</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+ table { border-spacing: 0; margin: 0 100px; }
+ td { border: 1px solid; padding: 1px solid; }
+
+ td > div { width: 100px; height: 350px;
+ direction: rtl; position: relative; }
+
+ td#bscontent > div > div { box-sizing: content-box; }
+ td#bsborder > div > div { box-sizing: border-box; }
+
+ td > div > div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ margin-bottom: 10px;
+ position: absolute;
+ height: 40px;
+ right: 0;
+ }
+
+ td > div > div { top: 0px; }
+ td > div > div + div { top: 50px; }
+ td > div > div + div + div { top: 100px; }
+ td > div > div + div + div + div { top: 150px; }
+ td > div > div + div + div + div + div { top: 200px; }
+ td > div > div + div + div + div + div + div { top: 250px; }
+ td > div > div + div + div + div + div + div + div { top: 300px; }
+
+ </style>
+</head>
+<body>
+
+<table><tr>
+
+<td id="bscontent"><div>
+
+<!-- box-sizing: content-box -->
+<div style="width: auto">A B</div>
+<div style="width: -moz-max-content">A B</div>
+<div style="width: -moz-min-content">A B</div>
+<div style="width: -moz-fit-content">A B</div>
+<div style="width: -moz-available">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60%">A B</div>
+
+</div></td>
+
+<td id="bsborder"><div>
+<!-- box-sizing: border-box -->
+<div style="width: auto">A B</div>
+<div style="width: -moz-max-content">A B</div>
+<div style="width: -moz-min-content">A B</div>
+<div style="width: -moz-fit-content">A B</div>
+<div style="width: -moz-available">A B</div>
+<div style="width: 50px">A B</div>
+<div style="width: 60%">A B</div>
+
+</div></td>
+
+</tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-minmax-height-ref.html b/layout/reftests/box-properties/box-sizing-minmax-height-ref.html
new file mode 100644
index 000000000..ec9027039
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-minmax-height-ref.html
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML>
+<html><head>
+ <title>min-/max-height testcase for bug 308801</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+
+ .test1 {
+ height:35px;
+ border:1px solid black;
+ }
+
+ .test2 {
+ height:37px;
+ background:black;
+ }
+
+ .test3 {
+ height:21px;
+ border:8px solid black;
+ }
+
+ p { height:43px; margin:0; padding:0; }
+ </style>
+</head>
+<body>
+
+<div class="box min test1"></div>
+
+<br><div class="box min test2"></div>
+
+<br><div class="box min test3"></div>
+
+<br><div class="box max test1"><p></div>
+
+<br><div class="box max test2"><p></div>
+
+<br><div class="box max test3"><p></div>
+
+<br><!-- overflow:hidden -->
+
+<div class="hidden box min test1"></div>
+
+<br><div class="hidden box min test2"></div>
+
+<br><div class="hidden box min test3"></div>
+
+<br><div class="hidden box max test1"><p></div>
+
+<br><div class="hidden box max test2"><p></div>
+
+<br><div class="hidden box max test3"><p></div>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-minmax-height.html b/layout/reftests/box-properties/box-sizing-minmax-height.html
new file mode 100644
index 000000000..2a745fca0
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-minmax-height.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<html><head>
+ <title>min-/max-height testcase for bug 308801</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+
+ div {
+ margin:0;
+ padding:0;
+ }
+
+ .min { min-height:37px; }
+ .max { max-height:37px; }
+ .hidden { overflow:hidden; }
+
+ .box {
+ box-sizing: border-box;
+ }
+
+ .test1 {
+ border:1px solid black;
+ }
+
+ .test2 {
+ padding:3px;
+ background:black;
+ }
+
+ .test3 {
+ border:8px solid black;
+ padding:5px;
+ }
+
+ p { height:43px; margin:0; padding:0; }
+
+ </style>
+</head>
+<body>
+
+<div class="box min test1"></div>
+
+<br><div class="box min test2"></div>
+
+<br><div class="box min test3"></div>
+
+<br><div class="box max test1"><p></div>
+
+<br><div class="box max test2"><p></div>
+
+<br><div class="box max test3"><p></div>
+
+<br><!-- overflow:hidden -->
+
+<div class="hidden box min test1"></div>
+
+<br><div class="hidden box min test2"></div>
+
+<br><div class="hidden box min test3"></div>
+
+<br><div class="hidden box max test1"><p></div>
+
+<br><div class="hidden box max test2"><p></div>
+
+<br><div class="hidden box max test3"><p></div>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-minmax-width-ref.html b/layout/reftests/box-properties/box-sizing-minmax-width-ref.html
new file mode 100644
index 000000000..f962ace1f
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-minmax-width-ref.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<html><head>
+ <title>min-/max-width testcase for bug 308801</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:16px;
+ }
+
+ .test1, .test2 {
+ width:100px;
+ height:20px;
+ background:black;
+ }
+
+ .test3 {
+ width:30px;
+ border:10px solid black;
+ padding:25px;
+ }
+br { margin-top:13px; }
+ </style>
+</head>
+<body>
+
+<div style="float:left"><div class="box min test1"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="box min test2"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="box min test3"></div></div>
+
+<br clear="all">
+<br clear="all">
+<div class="box max test1"></div>
+
+<br clear="all">
+<div class="box max test2"></div>
+
+<br clear="all">
+<div class="box max test3"></div>
+
+<br clear="all">
+<!-- overflow:hidden -->
+
+<div style="float:left"><div class="hidden box min test1"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="hidden box min test2"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="hidden box min test3"></div></div>
+
+<br clear="all">
+<br clear="all">
+<div class="hidden box max test1"></div>
+
+<br clear="all">
+<div class="hidden box max test2"></div>
+
+<br clear="all">
+<div class="hidden box max test3"></div>
+
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-minmax-width.html b/layout/reftests/box-properties/box-sizing-minmax-width.html
new file mode 100644
index 000000000..d5ec53110
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-minmax-width.html
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML>
+<html><head>
+ <title>min-/max-width testcase for bug 308801</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:16px;
+ }
+
+ div {
+ margin:0;
+ padding:0;
+ }
+
+ .min { min-width:100px; }
+ .max { max-width:100px; }
+ .hidden { overflow:hidden; }
+
+ .box {
+ box-sizing: border-box;
+ }
+
+ .test1 {
+ border:10px solid black;
+ }
+
+ .test2 {
+ padding:10px;
+ background:black;
+ }
+
+ .test3 {
+ border:10px solid black;
+ padding:25px;
+ }
+br { margin-top:13px; }
+ </style>
+</head>
+<body>
+
+<div style="float:left"><div class="box min test1"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="box min test2"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="box min test3"></div></div>
+
+<br clear="all">
+<br clear="all">
+<div class="box max test1"></div>
+
+<br clear="all">
+<div class="box max test2"></div>
+
+<br clear="all">
+<div class="box max test3"></div>
+
+<br clear="all">
+<!-- overflow:hidden -->
+
+<div style="float:left"><div class="hidden box min test1"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="hidden box min test2"></div></div>
+
+<br clear="all">
+<div style="float:left"><div class="hidden box min test3"></div></div>
+
+<br clear="all">
+<br clear="all">
+<div class="hidden box max test1"></div>
+
+<br clear="all">
+<div class="hidden box max test2"></div>
+
+<br clear="all">
+<div class="hidden box max test3"></div>
+
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-mozbox-minmax-height-ref.html b/layout/reftests/box-properties/box-sizing-mozbox-minmax-height-ref.html
new file mode 100644
index 000000000..71b19db8c
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-mozbox-minmax-height-ref.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 789824</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:24px; padding:0; margin:0;
+ }
+
+div { padding:5px; }
+
+hbox {
+ display:-moz-box;
+ border-top:3px solid;
+ border-bottom:2px solid;
+ padding-bottom:4px;
+ background:lime;
+
+ box-sizing:content-box;
+}
+
+.cb {
+ background:pink;
+ box-sizing:border-box;
+}
+
+.pb {
+ background:cyan;
+}
+
+ </style>
+</head>
+<body>
+
+
+<div><hbox style="height:11px;">border-box 20px</hbox></div>
+<div><hbox style="height:41px;">border-box 50px</hbox></div>
+<div><hbox style="height:11px;">border-box 20px</hbox></div>
+
+<div><hbox class="cb" style="height:29px;">content-box 20px</hbox></div>
+<div><hbox class="cb" style="height:59px;">content-box 50px</hbox></div>
+<div><hbox class="cb" style="height:29px;">content-box 20px</hbox></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/box-sizing-mozbox-minmax-height.html b/layout/reftests/box-properties/box-sizing-mozbox-minmax-height.html
new file mode 100644
index 000000000..df4d8c503
--- /dev/null
+++ b/layout/reftests/box-properties/box-sizing-mozbox-minmax-height.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 789824</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:24px; padding:0; margin:0;
+ }
+
+div { padding:5px; }
+
+hbox {
+ display:-moz-box;
+ border-top:3px solid;
+ border-bottom:2px solid;
+ padding-bottom:4px;
+ height:auto;
+ box-sizing:border-box;
+ background:lime;
+}
+
+.cb {
+ box-sizing:content-box;
+ background:pink;
+}
+
+ </style>
+</head>
+<body>
+
+
+<div><hbox style="height:20px;">border-box 20px</hbox></div>
+<div><hbox style="min-height:50px;">border-box 50px</hbox></div>
+<div><hbox style="max-height:20px;">border-box 20px</hbox></div>
+
+<div><hbox class="cb" style="height:20px;">content-box 20px</hbox></div>
+<div><hbox class="cb" style="min-height:50px;">content-box 50px</hbox></div>
+<div><hbox class="cb" style="max-height:20px;">content-box 20px</hbox></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/clip-auto-ref.html b/layout/reftests/box-properties/clip-auto-ref.html
new file mode 100644
index 000000000..625d3c321
--- /dev/null
+++ b/layout/reftests/box-properties/clip-auto-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE HTML>
+<title>test for 'clip: auto'</title>
+<div style="position: absolute; top: 0px; left: 0px; width: 300px; height: 300px; background: blue">
+</div>
diff --git a/layout/reftests/box-properties/clip-auto.html b/layout/reftests/box-properties/clip-auto.html
new file mode 100644
index 000000000..06cb49f12
--- /dev/null
+++ b/layout/reftests/box-properties/clip-auto.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<title>test for 'clip: auto'</title>
+<div style="position: absolute; top: 100px; left: 100px; width: 100px; height: 100px; clip: auto">
+ <div style="width: 300px; height: 300px; margin: -100px; background: blue">
+ </div>
+</div>
diff --git a/layout/reftests/box-properties/clip-rect-auto-ref.html b/layout/reftests/box-properties/clip-rect-auto-ref.html
new file mode 100644
index 000000000..4f486809a
--- /dev/null
+++ b/layout/reftests/box-properties/clip-rect-auto-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE HTML>
+<title>test for 'clip: auto'</title>
+<div style="position: absolute; top: 100px; left: 100px; width: 100px; height: 100px; background: blue">
+</div>
diff --git a/layout/reftests/box-properties/clip-rect-auto.html b/layout/reftests/box-properties/clip-rect-auto.html
new file mode 100644
index 000000000..a47472bef
--- /dev/null
+++ b/layout/reftests/box-properties/clip-rect-auto.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<title>test for 'clip: auto'</title>
+<div style="position: absolute; top: 100px; left: 100px; width: 100px; height: 100px; clip: rect(auto,auto,auto,auto)">
+ <div style="width: 300px; height: 300px; margin: -100px; background: blue">
+ </div>
+</div>
diff --git a/layout/reftests/box-properties/max-height-1-ref.html b/layout/reftests/box-properties/max-height-1-ref.html
new file mode 100644
index 000000000..0b955cd01
--- /dev/null
+++ b/layout/reftests/box-properties/max-height-1-ref.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { height: 20px}
+ </style>
+ </head>
+ <body>
+ <div style="height: 10px; max-height: 15px;"></div>
+ <div style="height: 10px; max-height: 5px;"></div>
+ <div style="height: 10px; max-height: 5px; min-height: 2px"></div>
+ <div style="height: 10px; max-height: 5px; min-height: 15px"></div>
+ <div style="max-height: 5px; min-height: 15px"></div>
+ <div>
+ <div style="height: 50%;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; max-height: 15px;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; max-height: 5px;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; max-height: 75%;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; max-height: 10%;"></div>
+ </div>
+ <div style="padding: 10px 0;">
+ <div style="height: 50%; max-height: 75%;"></div>
+ </div>
+ <div style="padding: 10px 0;">
+ <div style="height: 50%; max-height: 10%;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 50%; max-height: 75%;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 50%; max-height: 10%;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/max-height-1.html b/layout/reftests/box-properties/max-height-1.html
new file mode 100644
index 000000000..b0c6f737e
--- /dev/null
+++ b/layout/reftests/box-properties/max-height-1.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { height: 20px; }
+ </style>
+ </head>
+ <body>
+ <div style="height: 10px;"></div>
+ <div style="height: 5px;"></div>
+ <div style="height: 5px;"></div>
+ <div style="height: 15px;"></div>
+ <div style="height: 15px;"></div>
+ <div>
+ <div style="height: 10px;"></div>
+ </div>
+ <div>
+ <div style="height: 10px;"></div>
+ </div>
+ <div>
+ <div style="height: 5px;"></div>
+ </div>
+ <div>
+ <div style="height: 10px;"></div>
+ </div>
+ <div>
+ <div style="height: 2px;"></div>
+ </div>
+ <div style="padding: 10px 0;">
+ <div style="height: 10px;"></div>
+ </div>
+ <div style="padding: 10px 0;">
+ <div style="height: 2px;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 10px;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 2px;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/max-width-1-ref.html b/layout/reftests/box-properties/max-width-1-ref.html
new file mode 100644
index 000000000..916b24ccf
--- /dev/null
+++ b/layout/reftests/box-properties/max-width-1-ref.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black; height: 10px;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { width: 400px; }
+ </style>
+ </head>
+ <body>
+ <div style="width: 100px;"></div>
+ <div style="width: 50px;"></div>
+ <div style="width: 50px;"></div>
+ <div style="width: 150px;"></div>
+ <div style="width: 150px;"></div>
+ <div>
+ <div style="width: 200px;"></div>
+ </div>
+ <div>
+ <div style="width: 200px;"></div>
+ </div>
+ <div>
+ <div style="width: 100px;"></div>
+ </div>
+ <div>
+ <div style="width: 200px;"></div>
+ </div>
+ <div>
+ <div style="width: 40px;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 200px;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 40px;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 200px;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 40px;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/max-width-1.html b/layout/reftests/box-properties/max-width-1.html
new file mode 100644
index 000000000..423e84b27
--- /dev/null
+++ b/layout/reftests/box-properties/max-width-1.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black; height: 10px;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { width: 400px; }
+ </style>
+ </head>
+ <body>
+ <div style="width: 100px; max-width: 150px;"></div>
+ <div style="width: 100px; max-width: 50px;"></div>
+ <div style="width: 100px; max-width: 50px; min-width: 20px"></div>
+ <div style="width: 100px; max-width: 50px; min-width: 150px"></div>
+ <div style="max-width: 50px; min-width: 150px"></div>
+ <div>
+ <div style="width: 50%;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; max-width: 300px;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; max-width: 100px;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; max-width: 75%;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; max-width: 10%;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 50%; max-width: 75%;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 50%; max-width: 10%;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 50%; max-width: 75%;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 50%; max-width: 10%;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/min-height-1-ref.html b/layout/reftests/box-properties/min-height-1-ref.html
new file mode 100644
index 000000000..a0f8fa5d7
--- /dev/null
+++ b/layout/reftests/box-properties/min-height-1-ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { height: 20px; }
+ </style>
+ </head>
+ <body>
+ <div style="height: 10px;"></div>
+ <div style="height: 15px;"></div>
+ <div>
+ <div style="height: 10px;"></div>
+ </div>
+ <div>
+ <div style="height: 10px;"></div>
+ </div>
+ <div>
+ <div style="height: 15px;"></div>
+ </div>
+ <div>
+ <div style="height: 10px;"></div>
+ </div>
+ <div>
+ <div style="height: 15px;"></div>
+ </div>
+ <div style="padding: 10px 0;">
+ <div style="height: 10px;"></div>
+ </div>
+ <div style="padding: 10px 0;">
+ <div style="height: 15px;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 10px;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 15px;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/min-height-1.html b/layout/reftests/box-properties/min-height-1.html
new file mode 100644
index 000000000..cc17951fd
--- /dev/null
+++ b/layout/reftests/box-properties/min-height-1.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { height: 20px; }
+ </style>
+ </head>
+ <body>
+ <div style="height: 10px; min-height: 5px;"></div>
+ <div style="height: 10px; min-height: 15px;"></div>
+ <div>
+ <div style="height: 50%;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; min-height: 5px;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; min-height: 15px;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; min-height: 10%;"></div>
+ </div>
+ <div>
+ <div style="height: 50%; min-height: 75%;"></div>
+ </div>
+ <div style="padding: 10px 0">
+ <div style="height: 50%; min-height: 10%;"></div>
+ </div>
+ <div style="padding: 10px 0;">
+ <div style="height: 50%; min-height: 75%;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 50%; min-height: 10%;"></div>
+ </div>
+ <div style="border-width: 10px 0; border-style: solid;
+ border-color: transparent;">
+ <div style="height: 50%; min-height: 75%;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/min-width-1-ref.html b/layout/reftests/box-properties/min-width-1-ref.html
new file mode 100644
index 000000000..0af8138fa
--- /dev/null
+++ b/layout/reftests/box-properties/min-width-1-ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black; height: 10px;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { width: 400px; }
+ </style>
+ </head>
+ <body>
+ <div style="width: 100px;"></div>
+ <div style="width: 150px;"></div>
+ <div>
+ <div style="width: 200px;"></div>
+ </div>
+ <div>
+ <div style="width: 200px;"></div>
+ </div>
+ <div>
+ <div style="width: 300px;"></div>
+ </div>
+ <div>
+ <div style="width: 200px;"></div>
+ </div>
+ <div>
+ <div style="width: 300px;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 200px;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 300px;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 200px;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 300px;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/min-width-1.html b/layout/reftests/box-properties/min-width-1.html
new file mode 100644
index 000000000..e7624c254
--- /dev/null
+++ b/layout/reftests/box-properties/min-width-1.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div:empty { background: yellow; border: 1px solid black; height: 10px;
+ padding: 0; margin: 0; }
+ body > div:not(:empty) { width: 400px; }
+ </style>
+ </head>
+ <body>
+ <div style="width: 100px; min-width: 50px;"></div>
+ <div style="width: 100px; min-width: 150px;"></div>
+ <div>
+ <div style="width: 50%;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; min-width: 100px;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; min-width: 300px;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; min-width: 10%;"></div>
+ </div>
+ <div>
+ <div style="width: 50%; min-width: 75%;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 50%; min-width: 10%;"></div>
+ </div>
+ <div style="padding: 0 100px;">
+ <div style="width: 50%; min-width: 75%;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 50%; min-width: 10%;"></div>
+ </div>
+ <div style="border-width: 0 100px; border-style: solid;
+ border-color: transparent;">
+ <div style="width: 50%; min-width: 75%;"></div>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/minmax-width-special-values-block-intrinsic-ref.html b/layout/reftests/box-properties/minmax-width-special-values-block-intrinsic-ref.html
new file mode 100644
index 000000000..e11ae0fb1
--- /dev/null
+++ b/layout/reftests/box-properties/minmax-width-special-values-block-intrinsic-ref.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>intrinsic min-widths and max-widths for -moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+<body>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 1px;">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 1px;">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 500px">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 500px">AA B</div>
+</td></tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/minmax-width-special-values-block-intrinsic.html b/layout/reftests/box-properties/minmax-width-special-values-block-intrinsic.html
new file mode 100644
index 000000000..3ea9437b6
--- /dev/null
+++ b/layout/reftests/box-properties/minmax-width-special-values-block-intrinsic.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>intrinsic min-widths and max-widths for -moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+<body>
+
+<table border><tr><td>
+ <div style="width: 1px; min-width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 1px; min-width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 1px; min-width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 1px; min-width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 1px; min-width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 1px; min-width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 1px; min-width: -moz-available">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 1px; min-width: -moz-available">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 500px; max-width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 500px; max-width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 500px; max-width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 500px; max-width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 500px; max-width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 500px; max-width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: 500px; max-width: -moz-available">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: 500px; max-width: -moz-available">AA B</div>
+</td></tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/outline-radius-percent-1-ref.html b/layout/reftests/box-properties/outline-radius-percent-1-ref.html
new file mode 100644
index 000000000..f7342c1df
--- /dev/null
+++ b/layout/reftests/box-properties/outline-radius-percent-1-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div {
+ outline-width: 10px; outline-style: solid;
+ width: 400px; height: 50px;
+ margin: 20px 0;
+ border-style: solid; border-color: transparent; border-width: 0;
+ padding: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <div style="-moz-outline-radius: 20px / 2.5px;"></div>
+ <div style="-moz-outline-radius: 40px / 5px;"></div>
+ <div style="-moz-outline-radius: 80px / 10px;"></div>
+ <div style="padding: 0 100px; -moz-outline-radius: 60px / 5px;"></div>
+ <div style="padding: 0 100px 0 0; -moz-outline-radius: 50px / 5px;"></div>
+ <div style="padding: 0 0 0 100px; -moz-outline-radius: 50px / 5px;"></div>
+ <div style="border-width: 0 100px; -moz-outline-radius: 60px / 5px;"></div>
+ <div style="border-width: 0 100px 0 0; -moz-outline-radius: 50px / 5px;"></div>
+ <div style="border-width: 0 0 0 100px; -moz-outline-radius: 50px / 5px;"></div>
+ <div style="border-width: 0 100px; padding: 0 100px;
+ -moz-outline-radius: 80px / 5px;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/outline-radius-percent-1.html b/layout/reftests/box-properties/outline-radius-percent-1.html
new file mode 100644
index 000000000..9a683f82f
--- /dev/null
+++ b/layout/reftests/box-properties/outline-radius-percent-1.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div {
+ outline-width: 10px; outline-style: solid;
+ width: 400px; height: 50px;
+ margin: 20px 0;
+ border-style: solid; border-color: transparent; border-width: 0;
+ padding: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <div style="-moz-outline-radius: 5%;"></div>
+ <div style="-moz-outline-radius: 10%;"></div>
+ <div style="-moz-outline-radius: 20%;"></div>
+ <div style="padding: 0 100px; -moz-outline-radius: 10%;"></div>
+ <div style="padding: 0 100px 0 0; -moz-outline-radius: 10%;"></div>
+ <div style="padding: 0 0 0 100px; -moz-outline-radius: 10%;"></div>
+ <div style="border-width: 0 100px; -moz-outline-radius: 10%;"></div>
+ <div style="border-width: 0 100px 0 0; -moz-outline-radius: 10%;"></div>
+ <div style="border-width: 0 0 0 100px; -moz-outline-radius: 10%;"></div>
+ <div style="border-width: 0 100px; padding: 0 100px;
+ -moz-outline-radius: 10%;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/box-properties/reftest-stylo.list b/layout/reftests/box-properties/reftest-stylo.list
new file mode 100644
index 000000000..b25f1258e
--- /dev/null
+++ b/layout/reftests/box-properties/reftest-stylo.list
@@ -0,0 +1,37 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+== outline-radius-percent-1.html outline-radius-percent-1.html
+== min-width-1.html min-width-1.html
+== min-height-1.html min-height-1.html
+== max-width-1.html max-width-1.html
+== max-height-1.html max-height-1.html
+== width-special-values-block.html width-special-values-block.html
+== width-special-values-float.html width-special-values-float.html
+random == width-special-values-image-block.html width-special-values-image-block.html
+== width-special-values-image.html width-special-values-image.html
+== width-special-values-block-intrinsic.html width-special-values-block-intrinsic.html
+== width-special-values-float-intrinsic.html width-special-values-float-intrinsic.html
+skip == minmax-width-special-values-block-intrinsic.html minmax-width-special-values-block-intrinsic.html
+skip == width-special-values-cell-auto.html width-special-values-cell-auto.html
+== width-special-values-cell-fixed.html width-special-values-cell-fixed.html
+== box-sizing-1.html box-sizing-1.html
+== box-sizing-2.html box-sizing-2.html
+== box-sizing-3.html box-sizing-3.html
+== box-sizing-4.html box-sizing-4.html
+== box-sizing-minmax-height.html box-sizing-minmax-height.html
+== box-sizing-minmax-width.html box-sizing-minmax-width.html
+== box-sizing-mozbox-minmax-height.html box-sizing-mozbox-minmax-height.html
+skip == abspos-non-replaced-width-offset-margin.html abspos-non-replaced-width-offset-margin.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip == abspos-replaced-width-offset-margin.html abspos-replaced-width-offset-margin.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip-if(B2G||Mulet) HTTP(..) == CSS21-t100301.xhtml CSS21-t100301.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+random-if(B2G||Mulet) == CSS21-t100303.xhtml CSS21-t100303.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+random-if(B2G||Mulet) == CSS21-t100303-simple.xhtml CSS21-t100303-simple.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+random-if(B2G||Mulet) == CSS21-t100801-vertical-align.xhtml CSS21-t100801-vertical-align.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+== clip-auto.html clip-auto.html
+== clip-rect-auto.html clip-rect-auto.html
+== width-rounding.html width-rounding.html
diff --git a/layout/reftests/box-properties/reftest.list b/layout/reftests/box-properties/reftest.list
new file mode 100644
index 000000000..4a8168b03
--- /dev/null
+++ b/layout/reftests/box-properties/reftest.list
@@ -0,0 +1,30 @@
+== outline-radius-percent-1.html outline-radius-percent-1-ref.html
+== min-width-1.html min-width-1-ref.html
+== min-height-1.html min-height-1-ref.html
+== max-width-1.html max-width-1-ref.html
+== max-height-1.html max-height-1-ref.html
+== width-special-values-block.html width-special-values-block-ref.html
+== width-special-values-float.html width-special-values-block-ref.html
+== width-special-values-image-block.html width-special-values-image-block-ref.html
+== width-special-values-image.html width-special-values-image-ref.html
+== width-special-values-block-intrinsic.html width-special-values-block-intrinsic-ref.html
+== width-special-values-float-intrinsic.html width-special-values-block-intrinsic-ref.html
+== minmax-width-special-values-block-intrinsic.html minmax-width-special-values-block-intrinsic-ref.html
+== width-special-values-cell-auto.html width-special-values-cell-auto-ref.html
+== width-special-values-cell-fixed.html width-special-values-cell-fixed-ref.html
+== box-sizing-1.html box-sizing-1-ref.html
+== box-sizing-2.html box-sizing-2-ref.html
+== box-sizing-3.html box-sizing-1-ref.html
+== box-sizing-4.html box-sizing-4-ref.html
+== box-sizing-minmax-height.html box-sizing-minmax-height-ref.html
+== box-sizing-minmax-width.html box-sizing-minmax-width-ref.html
+== box-sizing-mozbox-minmax-height.html box-sizing-mozbox-minmax-height-ref.html
+== abspos-non-replaced-width-offset-margin.html abspos-non-replaced-width-offset-margin-ref.html
+== abspos-replaced-width-offset-margin.html abspos-replaced-width-offset-margin-ref.html
+HTTP(..) == CSS21-t100301.xhtml CSS21-t100301-ref.xhtml
+== CSS21-t100303.xhtml CSS21-t100303-ref.xhtml
+== CSS21-t100303-simple.xhtml CSS21-t100303-ref.xhtml
+== CSS21-t100801-vertical-align.xhtml CSS21-t100801-vertical-align-ref.xhtml
+== clip-auto.html clip-auto-ref.html
+== clip-rect-auto.html clip-rect-auto-ref.html
+== width-rounding.html width-rounding-ref.html
diff --git a/layout/reftests/box-properties/width-rounding-ref.html b/layout/reftests/box-properties/width-rounding-ref.html
new file mode 100644
index 000000000..3f9166f86
--- /dev/null
+++ b/layout/reftests/box-properties/width-rounding-ref.html
@@ -0,0 +1,207 @@
+<!DOCTYPE HTML>
+<title>width rounding (bug 590417)</title>
+<style>
+
+p { margin: 0; height: 1px; background: blue; }
+
+</style>
+<p style="width: 200.00px"></p>
+<p style="width: 200.01px"></p>
+<p style="width: 200.02px"></p>
+<p style="width: 200.03px"></p>
+<p style="width: 200.04px"></p>
+<p style="width: 200.05px"></p>
+<p style="width: 200.06px"></p>
+<p style="width: 200.07px"></p>
+<p style="width: 200.08px"></p>
+<p style="width: 200.09px"></p>
+<p style="width: 200.10px"></p>
+<p style="width: 200.11px"></p>
+<p style="width: 200.12px"></p>
+<p style="width: 200.13px"></p>
+<p style="width: 200.14px"></p>
+<p style="width: 200.15px"></p>
+<p style="width: 200.16px"></p>
+<p style="width: 200.17px"></p>
+<p style="width: 200.18px"></p>
+<p style="width: 200.19px"></p>
+<p style="width: 200.20px"></p>
+<p style="width: 200.21px"></p>
+<p style="width: 200.22px"></p>
+<p style="width: 200.23px"></p>
+<p style="width: 200.24px"></p>
+<p style="width: 200.25px"></p>
+<p style="width: 200.26px"></p>
+<p style="width: 200.27px"></p>
+<p style="width: 200.28px"></p>
+<p style="width: 200.29px"></p>
+<p style="width: 200.30px"></p>
+<p style="width: 200.31px"></p>
+<p style="width: 200.32px"></p>
+<p style="width: 200.33px"></p>
+<p style="width: 200.34px"></p>
+<p style="width: 200.35px"></p>
+<p style="width: 200.36px"></p>
+<p style="width: 200.37px"></p>
+<p style="width: 200.38px"></p>
+<p style="width: 200.39px"></p>
+<p style="width: 200.40px"></p>
+<p style="width: 200.41px"></p>
+<p style="width: 200.42px"></p>
+<p style="width: 200.43px"></p>
+<p style="width: 200.44px"></p>
+<p style="width: 200.45px"></p>
+<p style="width: 200.46px"></p>
+<p style="width: 200.47px"></p>
+<p style="width: 200.48px"></p>
+<p style="width: 200.49px"></p>
+<p style="width: 200.50px"></p>
+<p style="width: 200.51px"></p>
+<p style="width: 200.52px"></p>
+<p style="width: 200.53px"></p>
+<p style="width: 200.54px"></p>
+<p style="width: 200.55px"></p>
+<p style="width: 200.56px"></p>
+<p style="width: 200.57px"></p>
+<p style="width: 200.58px"></p>
+<p style="width: 200.59px"></p>
+<p style="width: 200.60px"></p>
+<p style="width: 200.61px"></p>
+<p style="width: 200.62px"></p>
+<p style="width: 200.63px"></p>
+<p style="width: 200.64px"></p>
+<p style="width: 200.65px"></p>
+<p style="width: 200.66px"></p>
+<p style="width: 200.67px"></p>
+<p style="width: 200.68px"></p>
+<p style="width: 200.69px"></p>
+<p style="width: 200.70px"></p>
+<p style="width: 200.71px"></p>
+<p style="width: 200.72px"></p>
+<p style="width: 200.73px"></p>
+<p style="width: 200.74px"></p>
+<p style="width: 200.75px"></p>
+<p style="width: 200.76px"></p>
+<p style="width: 200.77px"></p>
+<p style="width: 200.78px"></p>
+<p style="width: 200.79px"></p>
+<p style="width: 200.80px"></p>
+<p style="width: 200.81px"></p>
+<p style="width: 200.82px"></p>
+<p style="width: 200.83px"></p>
+<p style="width: 200.84px"></p>
+<p style="width: 200.85px"></p>
+<p style="width: 200.86px"></p>
+<p style="width: 200.87px"></p>
+<p style="width: 200.88px"></p>
+<p style="width: 200.89px"></p>
+<p style="width: 200.90px"></p>
+<p style="width: 200.91px"></p>
+<p style="width: 200.92px"></p>
+<p style="width: 200.93px"></p>
+<p style="width: 200.94px"></p>
+<p style="width: 200.95px"></p>
+<p style="width: 200.96px"></p>
+<p style="width: 200.97px"></p>
+<p style="width: 200.98px"></p>
+<p style="width: 200.99px"></p>
+<p style="width: 201.00px"></p>
+<p style="width: 201.01px"></p>
+<p style="width: 201.02px"></p>
+<p style="width: 201.03px"></p>
+<p style="width: 201.04px"></p>
+<p style="width: 201.05px"></p>
+<p style="width: 201.06px"></p>
+<p style="width: 201.07px"></p>
+<p style="width: 201.08px"></p>
+<p style="width: 201.09px"></p>
+<p style="width: 201.10px"></p>
+<p style="width: 201.11px"></p>
+<p style="width: 201.12px"></p>
+<p style="width: 201.13px"></p>
+<p style="width: 201.14px"></p>
+<p style="width: 201.15px"></p>
+<p style="width: 201.16px"></p>
+<p style="width: 201.17px"></p>
+<p style="width: 201.18px"></p>
+<p style="width: 201.19px"></p>
+<p style="width: 201.20px"></p>
+<p style="width: 201.21px"></p>
+<p style="width: 201.22px"></p>
+<p style="width: 201.23px"></p>
+<p style="width: 201.24px"></p>
+<p style="width: 201.25px"></p>
+<p style="width: 201.26px"></p>
+<p style="width: 201.27px"></p>
+<p style="width: 201.28px"></p>
+<p style="width: 201.29px"></p>
+<p style="width: 201.30px"></p>
+<p style="width: 201.31px"></p>
+<p style="width: 201.32px"></p>
+<p style="width: 201.33px"></p>
+<p style="width: 201.34px"></p>
+<p style="width: 201.35px"></p>
+<p style="width: 201.36px"></p>
+<p style="width: 201.37px"></p>
+<p style="width: 201.38px"></p>
+<p style="width: 201.39px"></p>
+<p style="width: 201.40px"></p>
+<p style="width: 201.41px"></p>
+<p style="width: 201.42px"></p>
+<p style="width: 201.43px"></p>
+<p style="width: 201.44px"></p>
+<p style="width: 201.45px"></p>
+<p style="width: 201.46px"></p>
+<p style="width: 201.47px"></p>
+<p style="width: 201.48px"></p>
+<p style="width: 201.49px"></p>
+<p style="width: 201.50px"></p>
+<p style="width: 201.51px"></p>
+<p style="width: 201.52px"></p>
+<p style="width: 201.53px"></p>
+<p style="width: 201.54px"></p>
+<p style="width: 201.55px"></p>
+<p style="width: 201.56px"></p>
+<p style="width: 201.57px"></p>
+<p style="width: 201.58px"></p>
+<p style="width: 201.59px"></p>
+<p style="width: 201.60px"></p>
+<p style="width: 201.61px"></p>
+<p style="width: 201.62px"></p>
+<p style="width: 201.63px"></p>
+<p style="width: 201.64px"></p>
+<p style="width: 201.65px"></p>
+<p style="width: 201.66px"></p>
+<p style="width: 201.67px"></p>
+<p style="width: 201.68px"></p>
+<p style="width: 201.69px"></p>
+<p style="width: 201.70px"></p>
+<p style="width: 201.71px"></p>
+<p style="width: 201.72px"></p>
+<p style="width: 201.73px"></p>
+<p style="width: 201.74px"></p>
+<p style="width: 201.75px"></p>
+<p style="width: 201.76px"></p>
+<p style="width: 201.77px"></p>
+<p style="width: 201.78px"></p>
+<p style="width: 201.79px"></p>
+<p style="width: 201.80px"></p>
+<p style="width: 201.81px"></p>
+<p style="width: 201.82px"></p>
+<p style="width: 201.83px"></p>
+<p style="width: 201.84px"></p>
+<p style="width: 201.85px"></p>
+<p style="width: 201.86px"></p>
+<p style="width: 201.87px"></p>
+<p style="width: 201.88px"></p>
+<p style="width: 201.89px"></p>
+<p style="width: 201.90px"></p>
+<p style="width: 201.91px"></p>
+<p style="width: 201.92px"></p>
+<p style="width: 201.93px"></p>
+<p style="width: 201.94px"></p>
+<p style="width: 201.95px"></p>
+<p style="width: 201.96px"></p>
+<p style="width: 201.97px"></p>
+<p style="width: 201.98px"></p>
+<p style="width: 201.99px"></p>
diff --git a/layout/reftests/box-properties/width-rounding.html b/layout/reftests/box-properties/width-rounding.html
new file mode 100644
index 000000000..418475f43
--- /dev/null
+++ b/layout/reftests/box-properties/width-rounding.html
@@ -0,0 +1,210 @@
+<!DOCTYPE HTML>
+<title>width rounding (bug 590417)</title>
+<style>
+
+p { margin: 0; background: blue }
+p:after { display:block; clear: left; content: "" }
+span { float: left; width: 30%; height: 1px }
+span:first-child, span:first-child + span { width: 35% }
+
+</style>
+<p style="width: 200.00px"><span></span><span></span><span></span></p>
+<p style="width: 200.01px"><span></span><span></span><span></span></p>
+<p style="width: 200.02px"><span></span><span></span><span></span></p>
+<p style="width: 200.03px"><span></span><span></span><span></span></p>
+<p style="width: 200.04px"><span></span><span></span><span></span></p>
+<p style="width: 200.05px"><span></span><span></span><span></span></p>
+<p style="width: 200.06px"><span></span><span></span><span></span></p>
+<p style="width: 200.07px"><span></span><span></span><span></span></p>
+<p style="width: 200.08px"><span></span><span></span><span></span></p>
+<p style="width: 200.09px"><span></span><span></span><span></span></p>
+<p style="width: 200.10px"><span></span><span></span><span></span></p>
+<p style="width: 200.11px"><span></span><span></span><span></span></p>
+<p style="width: 200.12px"><span></span><span></span><span></span></p>
+<p style="width: 200.13px"><span></span><span></span><span></span></p>
+<p style="width: 200.14px"><span></span><span></span><span></span></p>
+<p style="width: 200.15px"><span></span><span></span><span></span></p>
+<p style="width: 200.16px"><span></span><span></span><span></span></p>
+<p style="width: 200.17px"><span></span><span></span><span></span></p>
+<p style="width: 200.18px"><span></span><span></span><span></span></p>
+<p style="width: 200.19px"><span></span><span></span><span></span></p>
+<p style="width: 200.20px"><span></span><span></span><span></span></p>
+<p style="width: 200.21px"><span></span><span></span><span></span></p>
+<p style="width: 200.22px"><span></span><span></span><span></span></p>
+<p style="width: 200.23px"><span></span><span></span><span></span></p>
+<p style="width: 200.24px"><span></span><span></span><span></span></p>
+<p style="width: 200.25px"><span></span><span></span><span></span></p>
+<p style="width: 200.26px"><span></span><span></span><span></span></p>
+<p style="width: 200.27px"><span></span><span></span><span></span></p>
+<p style="width: 200.28px"><span></span><span></span><span></span></p>
+<p style="width: 200.29px"><span></span><span></span><span></span></p>
+<p style="width: 200.30px"><span></span><span></span><span></span></p>
+<p style="width: 200.31px"><span></span><span></span><span></span></p>
+<p style="width: 200.32px"><span></span><span></span><span></span></p>
+<p style="width: 200.33px"><span></span><span></span><span></span></p>
+<p style="width: 200.34px"><span></span><span></span><span></span></p>
+<p style="width: 200.35px"><span></span><span></span><span></span></p>
+<p style="width: 200.36px"><span></span><span></span><span></span></p>
+<p style="width: 200.37px"><span></span><span></span><span></span></p>
+<p style="width: 200.38px"><span></span><span></span><span></span></p>
+<p style="width: 200.39px"><span></span><span></span><span></span></p>
+<p style="width: 200.40px"><span></span><span></span><span></span></p>
+<p style="width: 200.41px"><span></span><span></span><span></span></p>
+<p style="width: 200.42px"><span></span><span></span><span></span></p>
+<p style="width: 200.43px"><span></span><span></span><span></span></p>
+<p style="width: 200.44px"><span></span><span></span><span></span></p>
+<p style="width: 200.45px"><span></span><span></span><span></span></p>
+<p style="width: 200.46px"><span></span><span></span><span></span></p>
+<p style="width: 200.47px"><span></span><span></span><span></span></p>
+<p style="width: 200.48px"><span></span><span></span><span></span></p>
+<p style="width: 200.49px"><span></span><span></span><span></span></p>
+<p style="width: 200.50px"><span></span><span></span><span></span></p>
+<p style="width: 200.51px"><span></span><span></span><span></span></p>
+<p style="width: 200.52px"><span></span><span></span><span></span></p>
+<p style="width: 200.53px"><span></span><span></span><span></span></p>
+<p style="width: 200.54px"><span></span><span></span><span></span></p>
+<p style="width: 200.55px"><span></span><span></span><span></span></p>
+<p style="width: 200.56px"><span></span><span></span><span></span></p>
+<p style="width: 200.57px"><span></span><span></span><span></span></p>
+<p style="width: 200.58px"><span></span><span></span><span></span></p>
+<p style="width: 200.59px"><span></span><span></span><span></span></p>
+<p style="width: 200.60px"><span></span><span></span><span></span></p>
+<p style="width: 200.61px"><span></span><span></span><span></span></p>
+<p style="width: 200.62px"><span></span><span></span><span></span></p>
+<p style="width: 200.63px"><span></span><span></span><span></span></p>
+<p style="width: 200.64px"><span></span><span></span><span></span></p>
+<p style="width: 200.65px"><span></span><span></span><span></span></p>
+<p style="width: 200.66px"><span></span><span></span><span></span></p>
+<p style="width: 200.67px"><span></span><span></span><span></span></p>
+<p style="width: 200.68px"><span></span><span></span><span></span></p>
+<p style="width: 200.69px"><span></span><span></span><span></span></p>
+<p style="width: 200.70px"><span></span><span></span><span></span></p>
+<p style="width: 200.71px"><span></span><span></span><span></span></p>
+<p style="width: 200.72px"><span></span><span></span><span></span></p>
+<p style="width: 200.73px"><span></span><span></span><span></span></p>
+<p style="width: 200.74px"><span></span><span></span><span></span></p>
+<p style="width: 200.75px"><span></span><span></span><span></span></p>
+<p style="width: 200.76px"><span></span><span></span><span></span></p>
+<p style="width: 200.77px"><span></span><span></span><span></span></p>
+<p style="width: 200.78px"><span></span><span></span><span></span></p>
+<p style="width: 200.79px"><span></span><span></span><span></span></p>
+<p style="width: 200.80px"><span></span><span></span><span></span></p>
+<p style="width: 200.81px"><span></span><span></span><span></span></p>
+<p style="width: 200.82px"><span></span><span></span><span></span></p>
+<p style="width: 200.83px"><span></span><span></span><span></span></p>
+<p style="width: 200.84px"><span></span><span></span><span></span></p>
+<p style="width: 200.85px"><span></span><span></span><span></span></p>
+<p style="width: 200.86px"><span></span><span></span><span></span></p>
+<p style="width: 200.87px"><span></span><span></span><span></span></p>
+<p style="width: 200.88px"><span></span><span></span><span></span></p>
+<p style="width: 200.89px"><span></span><span></span><span></span></p>
+<p style="width: 200.90px"><span></span><span></span><span></span></p>
+<p style="width: 200.91px"><span></span><span></span><span></span></p>
+<p style="width: 200.92px"><span></span><span></span><span></span></p>
+<p style="width: 200.93px"><span></span><span></span><span></span></p>
+<p style="width: 200.94px"><span></span><span></span><span></span></p>
+<p style="width: 200.95px"><span></span><span></span><span></span></p>
+<p style="width: 200.96px"><span></span><span></span><span></span></p>
+<p style="width: 200.97px"><span></span><span></span><span></span></p>
+<p style="width: 200.98px"><span></span><span></span><span></span></p>
+<p style="width: 200.99px"><span></span><span></span><span></span></p>
+<p style="width: 201.00px"><span></span><span></span><span></span></p>
+<p style="width: 201.01px"><span></span><span></span><span></span></p>
+<p style="width: 201.02px"><span></span><span></span><span></span></p>
+<p style="width: 201.03px"><span></span><span></span><span></span></p>
+<p style="width: 201.04px"><span></span><span></span><span></span></p>
+<p style="width: 201.05px"><span></span><span></span><span></span></p>
+<p style="width: 201.06px"><span></span><span></span><span></span></p>
+<p style="width: 201.07px"><span></span><span></span><span></span></p>
+<p style="width: 201.08px"><span></span><span></span><span></span></p>
+<p style="width: 201.09px"><span></span><span></span><span></span></p>
+<p style="width: 201.10px"><span></span><span></span><span></span></p>
+<p style="width: 201.11px"><span></span><span></span><span></span></p>
+<p style="width: 201.12px"><span></span><span></span><span></span></p>
+<p style="width: 201.13px"><span></span><span></span><span></span></p>
+<p style="width: 201.14px"><span></span><span></span><span></span></p>
+<p style="width: 201.15px"><span></span><span></span><span></span></p>
+<p style="width: 201.16px"><span></span><span></span><span></span></p>
+<p style="width: 201.17px"><span></span><span></span><span></span></p>
+<p style="width: 201.18px"><span></span><span></span><span></span></p>
+<p style="width: 201.19px"><span></span><span></span><span></span></p>
+<p style="width: 201.20px"><span></span><span></span><span></span></p>
+<p style="width: 201.21px"><span></span><span></span><span></span></p>
+<p style="width: 201.22px"><span></span><span></span><span></span></p>
+<p style="width: 201.23px"><span></span><span></span><span></span></p>
+<p style="width: 201.24px"><span></span><span></span><span></span></p>
+<p style="width: 201.25px"><span></span><span></span><span></span></p>
+<p style="width: 201.26px"><span></span><span></span><span></span></p>
+<p style="width: 201.27px"><span></span><span></span><span></span></p>
+<p style="width: 201.28px"><span></span><span></span><span></span></p>
+<p style="width: 201.29px"><span></span><span></span><span></span></p>
+<p style="width: 201.30px"><span></span><span></span><span></span></p>
+<p style="width: 201.31px"><span></span><span></span><span></span></p>
+<p style="width: 201.32px"><span></span><span></span><span></span></p>
+<p style="width: 201.33px"><span></span><span></span><span></span></p>
+<p style="width: 201.34px"><span></span><span></span><span></span></p>
+<p style="width: 201.35px"><span></span><span></span><span></span></p>
+<p style="width: 201.36px"><span></span><span></span><span></span></p>
+<p style="width: 201.37px"><span></span><span></span><span></span></p>
+<p style="width: 201.38px"><span></span><span></span><span></span></p>
+<p style="width: 201.39px"><span></span><span></span><span></span></p>
+<p style="width: 201.40px"><span></span><span></span><span></span></p>
+<p style="width: 201.41px"><span></span><span></span><span></span></p>
+<p style="width: 201.42px"><span></span><span></span><span></span></p>
+<p style="width: 201.43px"><span></span><span></span><span></span></p>
+<p style="width: 201.44px"><span></span><span></span><span></span></p>
+<p style="width: 201.45px"><span></span><span></span><span></span></p>
+<p style="width: 201.46px"><span></span><span></span><span></span></p>
+<p style="width: 201.47px"><span></span><span></span><span></span></p>
+<p style="width: 201.48px"><span></span><span></span><span></span></p>
+<p style="width: 201.49px"><span></span><span></span><span></span></p>
+<p style="width: 201.50px"><span></span><span></span><span></span></p>
+<p style="width: 201.51px"><span></span><span></span><span></span></p>
+<p style="width: 201.52px"><span></span><span></span><span></span></p>
+<p style="width: 201.53px"><span></span><span></span><span></span></p>
+<p style="width: 201.54px"><span></span><span></span><span></span></p>
+<p style="width: 201.55px"><span></span><span></span><span></span></p>
+<p style="width: 201.56px"><span></span><span></span><span></span></p>
+<p style="width: 201.57px"><span></span><span></span><span></span></p>
+<p style="width: 201.58px"><span></span><span></span><span></span></p>
+<p style="width: 201.59px"><span></span><span></span><span></span></p>
+<p style="width: 201.60px"><span></span><span></span><span></span></p>
+<p style="width: 201.61px"><span></span><span></span><span></span></p>
+<p style="width: 201.62px"><span></span><span></span><span></span></p>
+<p style="width: 201.63px"><span></span><span></span><span></span></p>
+<p style="width: 201.64px"><span></span><span></span><span></span></p>
+<p style="width: 201.65px"><span></span><span></span><span></span></p>
+<p style="width: 201.66px"><span></span><span></span><span></span></p>
+<p style="width: 201.67px"><span></span><span></span><span></span></p>
+<p style="width: 201.68px"><span></span><span></span><span></span></p>
+<p style="width: 201.69px"><span></span><span></span><span></span></p>
+<p style="width: 201.70px"><span></span><span></span><span></span></p>
+<p style="width: 201.71px"><span></span><span></span><span></span></p>
+<p style="width: 201.72px"><span></span><span></span><span></span></p>
+<p style="width: 201.73px"><span></span><span></span><span></span></p>
+<p style="width: 201.74px"><span></span><span></span><span></span></p>
+<p style="width: 201.75px"><span></span><span></span><span></span></p>
+<p style="width: 201.76px"><span></span><span></span><span></span></p>
+<p style="width: 201.77px"><span></span><span></span><span></span></p>
+<p style="width: 201.78px"><span></span><span></span><span></span></p>
+<p style="width: 201.79px"><span></span><span></span><span></span></p>
+<p style="width: 201.80px"><span></span><span></span><span></span></p>
+<p style="width: 201.81px"><span></span><span></span><span></span></p>
+<p style="width: 201.82px"><span></span><span></span><span></span></p>
+<p style="width: 201.83px"><span></span><span></span><span></span></p>
+<p style="width: 201.84px"><span></span><span></span><span></span></p>
+<p style="width: 201.85px"><span></span><span></span><span></span></p>
+<p style="width: 201.86px"><span></span><span></span><span></span></p>
+<p style="width: 201.87px"><span></span><span></span><span></span></p>
+<p style="width: 201.88px"><span></span><span></span><span></span></p>
+<p style="width: 201.89px"><span></span><span></span><span></span></p>
+<p style="width: 201.90px"><span></span><span></span><span></span></p>
+<p style="width: 201.91px"><span></span><span></span><span></span></p>
+<p style="width: 201.92px"><span></span><span></span><span></span></p>
+<p style="width: 201.93px"><span></span><span></span><span></span></p>
+<p style="width: 201.94px"><span></span><span></span><span></span></p>
+<p style="width: 201.95px"><span></span><span></span><span></span></p>
+<p style="width: 201.96px"><span></span><span></span><span></span></p>
+<p style="width: 201.97px"><span></span><span></span><span></span></p>
+<p style="width: 201.98px"><span></span><span></span><span></span></p>
+<p style="width: 201.99px"><span></span><span></span><span></span></p>
diff --git a/layout/reftests/box-properties/width-special-values-block-intrinsic-ref.html b/layout/reftests/box-properties/width-special-values-block-intrinsic-ref.html
new file mode 100644
index 000000000..4e9e11772
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-block-intrinsic-ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>intrinsic widths for -moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+<body>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div>AA B</div>
+</td></tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-block-intrinsic.html b/layout/reftests/box-properties/width-special-values-block-intrinsic.html
new file mode 100644
index 000000000..aec2493fd
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-block-intrinsic.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>intrinsic widths for -moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+<body>
+
+<table border><tr><td>
+ <div style="width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: -moz-available">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-available">AA B</div>
+</td></tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-block-ref.html b/layout/reftests/box-properties/width-special-values-block-ref.html
new file mode 100644
index 000000000..0d284e7f0
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-block-ref.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+
+ div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ margin-bottom: 1px;
+ float: left;
+ clear: left;
+ }
+
+ div.fill { width: 37px; }
+
+ </style>
+</head>
+<body style="width: 100px">
+<div class="">A B</div>
+<div class="">A B</div>
+<div class="">A B</div>
+<div class="">A <br>B</div>
+<div class="">A <br>B</div>
+<div class="">A <br>B</div>
+<div class="">A B</div>
+<div class="">A B</div>
+<div class="">A B</div>
+<div class="fill">A B C D E F G H I J</div>
+<div class="fill">A B C D E F G H I J</div>
+<div class="fill">A B C D E F G H I J</div>
+<div class="">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA <br>B</div>
+<div class="">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA <br>B</div>
+<div class="">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA <br>B</div>
+<div class="fill">A B</div>
+<div class="fill">A B</div>
+<div class="fill">A B</div>
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-block.html b/layout/reftests/box-properties/width-special-values-block.html
new file mode 100644
index 000000000..b802f487d
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-block.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+
+ div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ margin-bottom: 1px;
+ }
+
+ div.v1 { width: -moz-max-content; }
+ div.v2 { width: -moz-min-content; }
+ div.v3 { width: -moz-fit-content; }
+ div.v4 { width: -moz-available; }
+
+ div.s1 { box-sizing: content; }
+ div.s2 { box-sizing: padding; }
+ div.s3 { box-sizing: border; }
+
+ </style>
+</head>
+<body style="width: 100px">
+<div class="v1 s1">A B</div>
+<div class="v1 s2">A B</div>
+<div class="v1 s3">A B</div>
+<div class="v2 s1">A B</div>
+<div class="v2 s2">A B</div>
+<div class="v2 s3">A B</div>
+<div class="v3 s1">A B</div>
+<div class="v3 s2">A B</div>
+<div class="v3 s3">A B</div>
+<div class="v3 s1">A B C D E F G H I J</div>
+<div class="v3 s2">A B C D E F G H I J</div>
+<div class="v3 s3">A B C D E F G H I J</div>
+<div class="v3 s1">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA B</div>
+<div class="v3 s2">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA B</div>
+<div class="v3 s3">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA B</div>
+<div class="v4 s1">A B</div>
+<div class="v4 s2">A B</div>
+<div class="v4 s3">A B</div>
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-cell-auto-ref.html b/layout/reftests/box-properties/width-special-values-cell-auto-ref.html
new file mode 100644
index 000000000..191603a06
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-cell-auto-ref.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on table cells with table-layout: auto</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+
+ td td {
+ border-left: 1px solid;
+ padding-left: 2px;
+ padding-right: 4px;
+ border-right: 8px solid;
+
+ background: yellow;
+ }
+
+ </style>
+</head>
+<body>
+
+<table border><tr>
+<td>
+<!-- width -->
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+
+</td>
+<td>
+<!-- min-width -->
+
+<table border><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+
+<table border><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+
+</td>
+<td>
+<!-- max-width -->
+
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td>A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+<table border><tr><td style="width: 150px">A B</td></tr></table>
+<table border width="1"><tr><td>A B</td></tr></table>
+
+
+</td>
+</tr></table>
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-cell-auto.html b/layout/reftests/box-properties/width-special-values-cell-auto.html
new file mode 100644
index 000000000..414cafb1f
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-cell-auto.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on table cells with table-layout: auto</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+
+ td td {
+ border-left: 1px solid;
+ padding-left: 2px;
+ padding-right: 4px;
+ border-right: 8px solid;
+
+ background: yellow;
+ }
+
+ </style>
+</head>
+<body>
+
+<table border><tr>
+<td>
+<!-- width -->
+<table border><tr><td style="width: -moz-max-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: -moz-max-content">A B</td></tr></table>
+<table border><tr><td style="width: -moz-min-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: -moz-min-content">A B</td></tr></table>
+<table border><tr><td style="width: -moz-fit-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: -moz-fit-content">A B</td></tr></table>
+<table border><tr><td style="width: -moz-available">A B</td></tr></table>
+<table border width="1"><tr><td style="width: -moz-available">A B</td></tr></table>
+
+</td>
+<td>
+<!-- min-width -->
+
+<table border><tr><td style="min-width: -moz-max-content">A B</td></tr></table>
+<table border width="1"><tr><td style="min-width: -moz-max-content">A B</td></tr></table>
+<table border><tr><td style="min-width: -moz-min-content">A B</td></tr></table>
+<table border width="1"><tr><td style="min-width: -moz-min-content">A B</td></tr></table>
+<table border><tr><td style="min-width: -moz-fit-content">A B</td></tr></table>
+<table border width="1"><tr><td style="min-width: -moz-fit-content">A B</td></tr></table>
+<table border><tr><td style="min-width: -moz-available">A B</td></tr></table>
+<table border width="1"><tr><td style="min-width: -moz-available">A B</td></tr></table>
+
+<table border><tr><td style="width: 1px; min-width: -moz-max-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 1px; min-width: -moz-max-content">A B</td></tr></table>
+<table border><tr><td style="width: 1px; min-width: -moz-min-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 1px; min-width: -moz-min-content">A B</td></tr></table>
+<table border><tr><td style="width: 1px; min-width: -moz-fit-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 1px; min-width: -moz-fit-content">A B</td></tr></table>
+<table border><tr><td style="width: 1px; min-width: -moz-available">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 1px; min-width: -moz-available">A B</td></tr></table>
+
+</td>
+<td>
+<!-- max-width -->
+
+<table border><tr><td style="max-width: -moz-max-content">A B</td></tr></table>
+<table border width="1"><tr><td style="max-width: -moz-max-content">A B</td></tr></table>
+<table border><tr><td style="max-width: -moz-min-content">A B</td></tr></table>
+<table border width="1"><tr><td style="max-width: -moz-min-content">A B</td></tr></table>
+<table border><tr><td style="max-width: -moz-fit-content">A B</td></tr></table>
+<table border width="1"><tr><td style="max-width: -moz-fit-content">A B</td></tr></table>
+<table border><tr><td style="max-width: -moz-available">A B</td></tr></table>
+<table border width="1"><tr><td style="max-width: -moz-available">A B</td></tr></table>
+
+<table border><tr><td style="width: 150px; max-width: -moz-max-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 150px; max-width: -moz-max-content">A B</td></tr></table>
+<table border><tr><td style="width: 150px; max-width: -moz-min-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 150px; max-width: -moz-min-content">A B</td></tr></table>
+<table border><tr><td style="width: 150px; max-width: -moz-fit-content">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 150px; max-width: -moz-fit-content">A B</td></tr></table>
+<table border><tr><td style="width: 150px; max-width: -moz-available">A B</td></tr></table>
+<table border width="1"><tr><td style="width: 150px; max-width: -moz-available">A B</td></tr></table>
+
+
+</td>
+</tr></table>
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-cell-fixed-ref.html b/layout/reftests/box-properties/width-special-values-cell-fixed-ref.html
new file mode 100644
index 000000000..1a8c6601f
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-cell-fixed-ref.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on table cells with table-layout: fixed</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+
+ td table { width: 200px; }
+ td td:first-child {
+ border-left: 1px solid;
+ padding-left: 2px;
+ padding-right: 4px;
+ border-right: 8px solid;
+
+ background: yellow;
+ }
+
+ </style>
+</head>
+<body>
+
+<table border><tr>
+<td>
+<!-- width -->
+<table border><tr><td width="1">A&nbsp;B</td><td></td></tr></table>
+<table border><tr><td width="1">A B</td><td></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+
+</td>
+<td>
+<!-- min-width -->
+
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+
+<table border><tr><td width="1">A&nbsp;B</td><td></td></tr></table>
+<table border><tr><td width="1">A B</td><td></td></tr></table>
+<table border><tr><td width="1">A B</td><td></td></tr></table>
+<table border><tr><td width="1"><div style="width: 1px">A B</div></td><td></td></tr></table>
+
+</td>
+<td>
+<!-- max-width -->
+
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+<table border><tr><td width="50%">A B</td><td width="50%"></td></tr></table>
+
+<table border><tr><td width="1">A&nbsp;B</td><td></td></tr></table>
+<table border><tr><td width="1">A B</td><td></td></tr></table>
+<table border><tr><td width="1">A&nbsp;B</td><td></td></tr></table>
+<table border><tr><td width="150">A B</td><td></td></tr></table>
+
+</td>
+</tr></table>
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-cell-fixed.html b/layout/reftests/box-properties/width-special-values-cell-fixed.html
new file mode 100644
index 000000000..adaf42f24
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-cell-fixed.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on table cells with table-layout: fixed</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+
+ td table { table-layout: fixed; width: 200px; }
+ td td:first-child {
+ border-left: 1px solid;
+ padding-left: 2px;
+ padding-right: 4px;
+ border-right: 8px solid;
+
+ background: yellow;
+ }
+
+ </style>
+</head>
+<body>
+
+<table border><tr>
+<td>
+<!-- width -->
+<table border><tr><td style="width: -moz-max-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: -moz-min-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: -moz-fit-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: -moz-available">A B</td><td></td></tr></table>
+
+</td>
+<td>
+<!-- min-width -->
+
+<table border><tr><td style="min-width: -moz-max-content">A B</td><td></td></tr></table>
+<table border><tr><td style="min-width: -moz-min-content">A B</td><td></td></tr></table>
+<table border><tr><td style="min-width: -moz-fit-content">A B</td><td></td></tr></table>
+<table border><tr><td style="min-width: -moz-available">A B</td><td></td></tr></table>
+
+<table border><tr><td style="width: 1px; min-width: -moz-max-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: 1px; min-width: -moz-min-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: 1px; min-width: -moz-fit-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: 1px; min-width: -moz-available">A B</td><td></td></tr></table>
+
+</td>
+<td>
+<!-- max-width -->
+
+<table border><tr><td style="max-width: -moz-max-content">A B</td><td></td></tr></table>
+<table border><tr><td style="max-width: -moz-min-content">A B</td><td></td></tr></table>
+<table border><tr><td style="max-width: -moz-fit-content">A B</td><td></td></tr></table>
+<table border><tr><td style="max-width: -moz-available">A B</td><td></td></tr></table>
+
+<table border><tr><td style="width: 150px; max-width: -moz-max-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: 150px; max-width: -moz-min-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: 150px; max-width: -moz-fit-content">A B</td><td></td></tr></table>
+<table border><tr><td style="width: 150px; max-width: -moz-available">A B</td><td></td></tr></table>
+
+
+</td>
+</tr></table>
+
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-float-intrinsic.html b/layout/reftests/box-properties/width-special-values-float-intrinsic.html
new file mode 100644
index 000000000..efa41584e
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-float-intrinsic.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>intrinsic widths for -moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ div { float: left; clear: left; }
+
+ </style>
+</head>
+<body>
+
+<table border><tr><td>
+ <div style="width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-max-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-min-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-fit-content">AA B</div>
+</td></tr></table>
+
+<table border><tr><td>
+ <div style="width: -moz-available">AA B</div>
+</td></tr></table>
+
+<table border width="1"><tr><td>
+ <div style="width: -moz-available">AA B</div>
+</td></tr></table>
+
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-float.html b/layout/reftests/box-properties/width-special-values-float.html
new file mode 100644
index 000000000..1c5056907
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-float.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on blocks</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { font-size: 10px; line-height: 1; }
+
+ div {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+
+ background: yellow;
+ float: left;
+ clear: left;
+ margin-bottom: 1px;
+ }
+
+ div.v1 { width: -moz-max-content; }
+ div.v2 { width: -moz-min-content; }
+ div.v3 { width: -moz-fit-content; }
+ div.v4 { width: -moz-available; }
+
+ div.s1 { box-sizing: content; }
+ div.s2 { box-sizing: padding; }
+ div.s3 { box-sizing: border; }
+
+ </style>
+</head>
+<body style="width: 100px">
+<div class="v1 s1">A B</div>
+<div class="v1 s2">A B</div>
+<div class="v1 s3">A B</div>
+<div class="v2 s1">A B</div>
+<div class="v2 s2">A B</div>
+<div class="v2 s3">A B</div>
+<div class="v3 s1">A B</div>
+<div class="v3 s2">A B</div>
+<div class="v3 s3">A B</div>
+<div class="v3 s1">A B C D E F G H I J</div>
+<div class="v3 s2">A B C D E F G H I J</div>
+<div class="v3 s3">A B C D E F G H I J</div>
+<div class="v3 s1">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA B</div>
+<div class="v3 s2">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA B</div>
+<div class="v3 s3">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA B</div>
+<div class="v4 s1">A B</div>
+<div class="v4 s2">A B</div>
+<div class="v4 s3">A B</div>
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-image-block-ref.html b/layout/reftests/box-properties/width-special-values-image-block-ref.html
new file mode 100644
index 000000000..6aee205fd
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-image-block-ref.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on block images</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ img {
+ display: block;
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+ box-sizing: content;
+ margin-bottom: 1px;
+ }
+
+ img.v1 { }
+ img.v2 { }
+ img.v3 { }
+ img.v4 { width: 37px; }
+
+ </style>
+</head>
+<body style="width: 100px">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s3">
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-image-block.html b/layout/reftests/box-properties/width-special-values-image-block.html
new file mode 100644
index 000000000..11425ca6c
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-image-block.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on block images</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ img {
+ display: block;
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+ margin-bottom: 1px;
+ }
+
+ img.v1 { width: -moz-max-content; }
+ img.v2 { width: -moz-min-content; }
+ img.v3 { width: -moz-fit-content; }
+ img.v4 { width: -moz-available; }
+
+ img.s1 { box-sizing: content; }
+ img.s2 { box-sizing: padding; }
+ img.s3 { box-sizing: border; }
+
+ </style>
+</head>
+<body style="width: 100px">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s3">
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-image-ref.html b/layout/reftests/box-properties/width-special-values-image-ref.html
new file mode 100644
index 000000000..3a874b7d0
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-image-ref.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on inline images</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ img {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+ box-sizing: content;
+ margin-bottom: 1px;
+ }
+
+ img.v1 { }
+ img.v2 { }
+ img.v3 { }
+ img.v4 { width: 37px; }
+
+ </style>
+</head>
+<body style="width: 100px">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s3">
+</body>
+</html>
diff --git a/layout/reftests/box-properties/width-special-values-image.html b/layout/reftests/box-properties/width-special-values-image.html
new file mode 100644
index 000000000..46a8e58a7
--- /dev/null
+++ b/layout/reftests/box-properties/width-special-values-image.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>-moz-max-content, -moz-min-content, -moz-fit-content, and -moz-available values of CSS width property, on inline images</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ img {
+ margin-left: 1px;
+ border-left: 2px solid;
+ padding-left: 4px;
+ padding-right: 8px;
+ border-right: 16px solid;
+ margin-right: 32px;
+ margin-bottom: 1px;
+ }
+
+ img.v1 { width: -moz-max-content; }
+ img.v2 { width: -moz-min-content; }
+ img.v3 { width: -moz-fit-content; }
+ img.v4 { width: -moz-available; }
+
+ img.s1 { box-sizing: content; }
+ img.s2 { box-sizing: padding; }
+ img.s3 { box-sizing: border; }
+
+ </style>
+</head>
+<body style="width: 100px">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v1 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v2 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v3 s3">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s1">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s2">
+<img src="../pixel-rounding/green-25x25.png" alt="[]" class="v4 s3">
+</body>
+</html>