Bug 1079151 - Updated test files with corrected comments and references as needed. r=jfkthame
authorGérard Talbot <bugzilla@gtalbot.org>
Tue, 02 Jun 2015 11:55:18 +0100
changeset 246723 780a3290c0ed72238f4cf49c0d2acb6c5a31ab27
parent 246722 5f2e8622f9455a3dcd1b994888ed8844e0874220
child 246724 3c8ed81098ddbe4a4c09e7aa652b5288dc4ce0d3
push id28839
push userkwierso@gmail.com
push dateWed, 03 Jun 2015 01:20:15 +0000
treeherdermozilla-central@20a96e15631a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1079151
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1079151 - Updated test files with corrected comments and references as needed. r=jfkthame
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-003.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-005.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-007.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-009.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-011.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-013.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-015.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-017.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-019.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-021.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-023.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-025.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-027.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-029.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-031.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-033.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-035.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-037.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-039.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-041.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-043.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-045.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-047.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-049.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-051.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-053.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-055.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-057.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-059.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-061.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-063.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-065.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-067.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-069.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-071.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-073.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-075.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-077.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-079.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-081.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-083.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-085.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-087.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-089.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-091.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-093.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-095.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-097.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-002.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-004.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-006.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-008.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-010.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-012.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-014.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-016.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-018.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-020.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-022.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-024.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-026.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-028.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-030.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-032.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-034.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-036.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-038.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-040.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-042.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-044.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-046.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-048.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-050.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-052.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-054.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-056.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-058.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-060.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-062.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-064.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-066.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-068.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-070.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-072.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-074.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-076.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-078.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-080.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-082.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-084.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-086.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-088.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-090.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-092.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-094.xht
layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-096.xht
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-003.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-003.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-003-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then set 'top' to the static position, then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-3row-320x320.png");
       color: transparent;
@@ -39,76 +39,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-      0px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
-      0px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 240px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-005.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-005.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'left', 'width' and 'right' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'left', 'width' and 'right' are 'auto', then the width becomes shrink-to-fit and then solve for 'right'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'left', 'width' and 'right' are 'auto', then set 'left' to the static position, the width becomes shrink-to-fit and then solve for 'right'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -40,69 +40,67 @@
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
     }
 
 /*
 "
 If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
-"
 
-"
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
-      0px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
-      0px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 240px;
+And so computed right value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-007.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-007.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-007-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then set 'top' to the static position, then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -44,76 +44,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-      0px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
-      0px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 240px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-009.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-009.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then set 'bottom' to the static position, the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -39,76 +39,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
-3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
+1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-And so computed top value must be 240px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-011.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-011.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'left', 'width' and 'right' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'left', 'width' and 'right' are 'auto', then the width becomes shrink-to-fit and then solve for 'left'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'left', 'width' and 'right' are 'auto', then set 'right' to the static position, the width becomes shrink-to-fit and then solve for 'left'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -40,69 +40,67 @@
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
     }
 
 /*
 "
 If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
-"
 
-"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    160px : right: auto
+    160px : right: auto: set to static position
     =====================
     320px : width of containing block
 
 gives us:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    160px : right: auto
+    160px : right: auto: set to static position
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-013.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-013.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-013-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then set 'bottom' to the static position, the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -43,76 +43,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
-3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
+1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-And so computed top value must be 240px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-015.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-015.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top', 'height' are 'auto' and bottom is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr'  and 'top', 'height' are 'auto' and bottom is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' are 'auto' and bottom is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -39,75 +39,74 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-017.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-017.xht
@@ -50,21 +50,21 @@ 1. 'left' and 'width' are 'auto' and 'ri
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
   +
     160px : right
@@ -72,33 +72,33 @@ So:
     320px : width of containing block
 
 gives us:
 
   (solve) : left: auto
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
   +
     160px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-019.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-019.xht
@@ -1,23 +1,23 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'height' are 'auto and 'bottom' is not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-013-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'height' are 'auto and 'bottom' is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -29,89 +29,88 @@
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
       direction: ltr;
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
-
     }
 
   div#containing-block > span
     {
       background-color: red;
       bottom: 2em;
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-021.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-021.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'height' are 'auto and 'bottom' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'height' are 'auto and 'bottom' is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -39,74 +39,74 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-023.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-023.xht
@@ -29,78 +29,76 @@
     }
 
   div#containing-block > span
     {
       background-color: red;
       color: green;
       left: auto;
       position: absolute;
-      right: auto;
+      right: 2em;
       width: auto;
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
-
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      160px : right
     =====================
     320px : width of containing block
 
 gives us:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      160px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-025.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-025.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-013-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' are 'auto' and bottom is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -43,74 +43,74 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-027.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-027.xht
@@ -1,23 +1,23 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
-  <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
+  <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height" title="10.6.4 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-003-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-3row-320x320.png");
       color: transparent;
@@ -39,72 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-    160px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    (solve): bottom: auto
+   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-gives us:
-
-    160px : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-    (solve): bottom: auto
-    =====================
-    320px : height of containing block
-
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-029.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-029.xht
@@ -46,59 +46,59 @@
 "
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
-    160px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
-    160px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 80px;
+And so computed right value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-031.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-031.xht
@@ -1,23 +1,23 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-007-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -44,72 +44,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-    160px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-gives us:
-
-    160px : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-    (solve): bottom: auto
-    =====================
-    320px : height of containing block
-
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-033.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-033.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'bottom' are 'auto and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'bottom' to static position and solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -39,72 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    160px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-gives us:
-
-  (solve) : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-    160px : bottom: auto
-    =====================
-    320px : height of containing block
-
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-035.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-035.xht
@@ -48,57 +48,35 @@ 2. 'left' and 'right' are 'auto' and 'wi
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
     160px : right: auto
     =====================
     320px : width of containing block
 
-gives us:
-
-  (solve) : left: auto
-  +
-      0px : margin-left: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : width
-  +
-      0px : padding-right
-  +
-      0px : border-right-width
-  +
-      0px : margin-right: auto
-  +
-    160px : right: auto
-    =====================
-    320px : width of containing block
-
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-037.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-037.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-013-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'bottom' to static position and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -43,72 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    160px : bottom
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-gives us:
-
-  (solve) : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-    160px : bottom
-    =====================
-    320px : height of containing block
-
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-039.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-039.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -38,74 +38,75 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-041.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-041.xht
@@ -49,57 +49,57 @@ 3. 'width' and 'right' are 'auto' and 'l
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-043.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-043.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-013-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -42,74 +42,75 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    (solve): bottom: auto
+   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-045.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-045.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -38,74 +38,75 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-047.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-047.xht
@@ -38,68 +38,67 @@
       width: auto;
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
     }
 
 /*
-
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-049.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-049.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-013-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -42,74 +42,75 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-      80px: top
+     80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
-      80px: top
+     80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-051.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-051.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-003-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto', then  solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto', then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-3row-320x320.png");
       color: transparent;
@@ -38,52 +38,53 @@
       bottom: 1em;
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : height: auto
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-053.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-053.xht
@@ -48,35 +48,35 @@ 4. 'left' is 'auto', 'width' and 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-     80px : width: auto
+     80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      80px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 160px;
+And so computed left value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-055.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-055.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-007-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto', then then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto', then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -43,50 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : height: auto
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-057.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-057.xht
@@ -39,50 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : height: auto
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-059.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-059.xht
@@ -48,35 +48,35 @@ 4.'left' is 'auto', 'width' and 'right' 
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      80px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 160px;
+And so computed left value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-061.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-061.xht
@@ -43,52 +43,55 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
+
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-063.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-063.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-003-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then then solve for 'height'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then solve for 'height'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-3row-320x320.png");
       color: transparent;
@@ -29,66 +29,68 @@
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-065.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-065.xht
@@ -25,18 +25,18 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
-      color: green;
+      background-color: green;
+      height: 1em;
       left: 2em;
       position: absolute;
       right: 1em;
       width: auto;
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
@@ -48,41 +48,41 @@ 5. 'width' is 'auto', 'left' and 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
     160px : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
   (solve) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      80px : right: auto
     =====================
     320px : width of containing block
 
-And so computed width value must be 80px;
+And so computed width value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-067.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-067.xht
@@ -33,66 +33,68 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-069.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-069.xht
@@ -29,66 +29,68 @@
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-071.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-071.xht
@@ -25,18 +25,18 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
-      color: green;
+      background-color: green;
+      height: 1em;
       left: 2em;
       position: absolute;
       right: 1em;
       width: auto;
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
       writing-mode: tb-lr; /* IE11 */
       writing-mode: vertical-lr;
@@ -48,41 +48,41 @@ 5. 'width' is 'auto', 'left' and 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
     160px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
   (solve) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      80px : right
     =====================
     320px : width of containing block
 
-And so computed width value must be 80px;
+And so computed width value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-073.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-073.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-007-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then then solve for 'height'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then solve for 'height'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-lr;
       -webkit-writing-mode: vertical-lr;
@@ -33,66 +33,68 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-075.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-075.xht
@@ -39,50 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-077.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-077.xht
@@ -48,35 +48,35 @@ 6. 'right' is 'auto', 'left' and 'width'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-079.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-079.xht
@@ -43,50 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-081.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-081.xht
@@ -39,50 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-083.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-083.xht
@@ -48,35 +48,35 @@ 6. 'right' is 'auto', 'left' and 'width'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-085.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-085.xht
@@ -43,50 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-087.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-087.xht
@@ -41,72 +41,74 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
-If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
+If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-     160px : top
+    160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    80px : height
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
-     160px : top
+    160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    80px : height
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
   (solve) : bottom
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-089.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-089.xht
@@ -86,21 +86,21 @@ gives us:
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
   +
-  (solve) : right: auto
+  (solve) : right
     =====================
     320px : width of containing block
 
-And so computed right value must be 80px;
+And so computed right value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-091.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-091.xht
@@ -45,26 +45,28 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
-If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
+If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
@@ -100,17 +102,17 @@ gives us:
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
   (solve) : bottom
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-093.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-093.xht
@@ -41,26 +41,28 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
@@ -96,17 +98,17 @@ gives us:
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-095.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-095.xht
@@ -1,15 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'left', 'width' and 'right' are not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'left', 'width' and 'right' are not 'auto' (overconstrained)</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
   <meta name="assert" content="When 'direction' is 'rtl' and 'left', 'width' and 'right' are not 'auto' and if the values are overconstrained, then ignore 'left' and then solve for 'left'." />
@@ -52,19 +52,19 @@ If none of the three is 'auto': If both 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
     160px : left
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
@@ -74,33 +74,33 @@ So:
     320px : width of containing block
 
 gives us:
 
   (solve) : left
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
     160px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-097.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vlr-097.xht
@@ -1,15 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are not 'auto' (overconstrained)</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-013-ref.xht" />
 
   <meta name="flags" content="ahem image" />
   <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are not 'auto' and if the values are overconstrained, then ignore 'top' and solve for 'top'." />
@@ -45,26 +45,28 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
@@ -100,17 +102,17 @@ gives us:
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-002.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-002.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-002-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then set 'top' to the static position, the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-3row-320x320.png");
       color: transparent;
@@ -39,76 +39,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-      0px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
-      0px : top: auto
+    160px : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 240px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-004.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-004.xht
@@ -4,21 +4,20 @@
 
  <head>
 
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'left', 'width' and 'right' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
-
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'left', 'width' and 'right' are 'auto', then the width becomes shrink-to-fit and then solve for 'right'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'left', 'width' and 'right' are 'auto', then set 'left' to the static position, the width becomes shrink-to-fit and then solve for 'right'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -41,69 +40,67 @@
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
     }
 
 /*
 "
 If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
-"
 
-"
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
-      0px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
-      0px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 240px;
+And so computed right value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-006.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-006.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-006-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' and 'bottom' are 'auto', then set 'top' to the static position, the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -43,76 +43,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-      0px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
-      0px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 240px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-008.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-008.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then set 'bottom' to the static position, the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -39,76 +39,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
-3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
+1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-And so computed top value must be 240px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-010.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-010.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'left', 'width' and 'right' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'left', 'width' and 'right' are 'auto', then the width becomes shrink-to-fit and then solve for 'left'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'left', 'width' and 'right' are 'auto', then set 'right' to the static position, the width becomes shrink-to-fit and then solve for 'left'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-2col-2row-320x320.png");
       color: transparent;
@@ -40,69 +40,67 @@
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
     }
 
 /*
 "
 If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
-"
 
-"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    160px : right: auto
+    160px : right: auto: set to static position
     =====================
     320px : width of containing block
 
 gives us:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    160px : right: auto
+    160px : right: auto: set to static position
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-012.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-012.xht
@@ -4,20 +4,20 @@
 
  <head>
 
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
-  <link rel="match" href="abs-pos-non-replaced-vrl-012-ref.xht" />
+  <link rel="match" href="s71-abs-pos-non-replaced-vrl-012-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto', then set 'bottom' to the static position, the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -43,76 +43,76 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
 "
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
-3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
+If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
+
+1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-      0px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-And so computed top value must be 240px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-014.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-014.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top', 'height' are 'auto' and bottom is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' are 'auto' and 'bottom' is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top', 'height' are 'auto' and 'bottom' is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -39,75 +39,74 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-016.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-016.xht
@@ -50,21 +50,21 @@ 1. 'left' and 'width' are 'auto' and 'ri
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
   +
     160px : right
@@ -72,33 +72,33 @@ So:
     320px : width of containing block
 
 gives us:
 
   (solve) : left: auto
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
   +
     160px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-018.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-018.xht
@@ -1,23 +1,23 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'height' are 'auto and 'bottom' is not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-012-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'height' are 'auto and 'bottom' is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -43,74 +43,74 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-020.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-020.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'height' are 'auto and 'bottom' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'height' are 'auto and 'bottom' is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -39,74 +39,74 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-022.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-022.xht
@@ -39,68 +39,66 @@
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
-
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-     160px : right
+    160px : right
     =====================
     320px : width of containing block
 
 gives us:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-     160px : right
+    160px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-024.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-024.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-012-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height becomes shrink-to-fit and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height is based on the content and then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -43,74 +43,74 @@
       color: green;
       height: auto;
       position: absolute;
       top: auto;
     }
 
 /*
 "
-set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
 
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
 gives us:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-026.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-026.xht
@@ -1,23 +1,23 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-002-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-3row-320x320.png");
       color: transparent;
@@ -39,72 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-    160px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-gives us:
-
-    160px : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-  (solve) : bottom: auto
-    =====================
-    320px : height of containing block
-
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-028.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-028.xht
@@ -46,59 +46,59 @@
 "
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
-    160px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
-    160px : left: auto
+    160px : left: auto: set to static position
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 80px;
+And so computed right value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-030.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-030.xht
@@ -1,23 +1,23 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-006-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -43,72 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-    160px : top: auto
+    160px : top: auto: set to static position
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-gives us:
-
-    160px : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-    (solve): bottom: auto
-    =====================
-    320px : height of containing block
-
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-032.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-032.xht
@@ -4,20 +4,20 @@
 
  <head>
 
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'bottom' are 'auto and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
-  <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht-ref.xht" />
+  <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'bottom' to static position and solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -39,72 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    160px : bottom: auto
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-gives us:
-
-  (solve) : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-    160px : bottom: auto
-    =====================
-    320px : height of containing block
-
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-034.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-034.xht
@@ -48,57 +48,35 @@ 2. 'left' and 'right' are 'auto' and 'wi
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-    160px : right: auto
+    160px : right: auto: set to static position
     =====================
     320px : width of containing block
 
-gives us:
-
-  (solve) : left: auto
-  +
-      0px : margin-left: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : width
-  +
-      0px : padding-right
-  +
-      0px : border-right-width
-  +
-      0px : margin-right: auto
-  +
-    160px : right: auto
-    =====================
-    320px : width of containing block
-
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-036.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-036.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-012-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'bottom' to static position and then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to static position and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -43,72 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static position, otherwise set 'right' to the static position. Then solve for 'left' (if 'direction is 'rtl') or 'right' (if 'direction' is 'ltr').
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-    160px : bottom
+    160px : bottom: auto: set to static position
     =====================
     320px : height of containing block
 
-gives us:
-
-  (solve) : top: auto
-  +
-      0px : margin-top: auto
-  +
-      0px : border-top-width
-  +
-      0px : padding-top
-  +
-     80px : height
-  +
-      0px : padding-bottom
-  +
-      0px : border-bottom-width
-  +
-      0px : margin-bottom: auto
-  +
-    160px : bottom
-    =====================
-    320px : height of containing block
-
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-038.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-038.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -38,74 +38,75 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-040.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-040.xht
@@ -38,68 +38,67 @@
       width: auto;
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
     }
 
 /*
-
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-042.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-042.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-012-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -42,74 +42,75 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-044.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-044.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -38,74 +38,75 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
-   (solve): bottom: auto
+  (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-046.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-046.xht
@@ -38,68 +38,67 @@
       width: auto;
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
     }
 
 /*
-
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-    (shrink-to-fit) : width: auto
+  (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
 gives us:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : (shrink-to-fit) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-   (solve): right: auto
+  (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-048.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-048.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-012-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height becomes shrink-to-fit and then solve for 'bottom'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is based on the content and then solve for 'bottom'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -42,76 +42,78 @@
       bottom: auto;
       color: green;
       height: auto;
       position: absolute;
       top: 1em;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the width is shrink-to-fit . Then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
-      80px: top
+     80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-    (shrink-to-fit) : height: auto
+  (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
 gives us:
 
-      80px: top
+     80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : (shrink-to-fit) : height: auto
+     80px : (based on the content) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
+
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-050.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-050.xht
@@ -38,52 +38,53 @@
       bottom: 1em;
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
+"
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
 
 "
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : height: auto
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-052.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-052.xht
@@ -48,35 +48,35 @@ 4. 'left' is 'auto', 'width' and 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
-     80px : width: auto
+     80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      80px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 160px;
+And so computed left value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-054.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-054.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-006-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto', then then solve for 'top'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'top' is 'auto' and 'height' and 'bottom' are not 'auto', then solve for 'top'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -43,50 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : height: auto
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-056.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-056.xht
@@ -39,50 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
-     80px : height: auto
+     80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-058.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-058.xht
@@ -48,35 +48,35 @@ 4.'left' is 'auto', 'width' and 'right' 
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
   (solve) : left: auto
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      80px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 160px;
+And so computed left value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-060.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-060.xht
@@ -43,52 +43,55 @@
       color: green;
       height: 1em;
       position: absolute;
       top: auto;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
   (solve) : top: auto
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 160px;
+And so computed top value must be 160px .
 */
 
+
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-062.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-062.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-002-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then then solve for 'height'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then solve for 'height'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-3row-320x320.png");
       color: transparent;
@@ -29,66 +29,68 @@
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-064.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-064.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: ltr' and  'width' is 'auto', 'left' and 'right' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-004-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'ltr' and 'left', 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'." />
+  <meta name="assert" content="When 'direction' is 'ltr' and 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   div#containing-block
     {
       background: red url("support/bg-red-3col-2row-320x320.png");
       color: transparent;
@@ -25,18 +25,18 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
-      color: green;
+      background-color: green;
+      height: 1em;
       left: 2em;
       position: absolute;
       right: 1em;
       width: auto;
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
@@ -46,43 +46,43 @@
 "
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
-    160px : left: auto
+    160px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
   (solve) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
-     80px : right: auto
+     80px : right
     =====================
     320px : width of containing block
 
-And so computed width value must be 80px;
+And so computed width value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-066.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-066.xht
@@ -33,66 +33,68 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-068.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-068.xht
@@ -29,66 +29,68 @@
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-070.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-070.xht
@@ -25,18 +25,18 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
-      color: green;
+      background-color: green;
+      height: 1em;
       left: 2em;
       position: absolute;
       right: 1em;
       width: auto;
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
       writing-mode: tb-rl; /* IE11 */
       writing-mode: vertical-rl;
@@ -48,41 +48,41 @@ 5. 'width' is 'auto', 'left' and 'right'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
     160px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
   (solve) : width: auto
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
      80px : right
     =====================
     320px : width of containing block
 
-And so computed width value must be 80px;
+And so computed width value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-072.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-072.xht
@@ -7,17 +7,17 @@
   <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto'</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-006-ref.xht" />
 
   <meta name="flags" content="ahem image" />
-  <meta name="assert" content="When 'direction' is 'rtl' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then then solve for 'height'." />
+  <meta name="assert" content="When 'direction' is 'rtl' and 'height' is 'auto' and 'top' and 'bottom' are not 'auto', then solve for 'height'." />
 
   <link type="text/css" rel="stylesheet" href="support/ahem.css" />
 
   <style type="text/css"><![CDATA[
   html
     {
       -ah-writing-mode: vertical-rl;
       -webkit-writing-mode: vertical-rl;
@@ -33,66 +33,68 @@
       font: 80px/1 Ahem;
       height: 320px;
       position: relative;
       width: 320px;
     }
 
   div#containing-block > span
     {
-      background-color: red;
+      background-color: green;
       bottom: 1em;
-      color: green;
       height: auto;
       position: absolute;
       top: 2em;
+      width: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
   (solve) : height: auto
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
      80px : bottom
     =====================
     320px : height of containing block
 
-And so computed height value must be 80px;
+And so computed height value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
   <p><img src="support/pass-cdts-abs-pos-non-replaced.png" width="246" height="36" alt="Image download support must be enabled" /></p>
 
-  <div id="containing-block">1 2 34<span>X</span></div>
+  <div id="containing-block">1 2 34<span></span></div>
 
  </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-074.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-074.xht
@@ -39,50 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-076.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-076.xht
@@ -48,35 +48,35 @@ 6. 'right' is 'auto', 'left' and 'width'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-078.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-078.xht
@@ -43,50 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-080.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-080.xht
@@ -39,50 +39,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-082.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-082.xht
@@ -48,35 +48,35 @@ 6. 'right' is 'auto', 'left' and 'width'
 "
 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
      80px : left
   +
-      0px : margin-left: auto
+      0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
   (solve) : right: auto
     =====================
     320px : width of containing block
 
-And so computed right value must be 160px;
+And so computed right value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-084.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-084.xht
@@ -43,50 +43,52 @@
       color: green;
       height: 1em;
       position: absolute;
       top: 1em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve for 'right'
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
      80px : top
   +
-      0px : margin-top: auto
+      0px : margin-top
   +
       0px : border-top-width
   +
       0px : padding-top
   +
      80px : height
   +
       0px : padding-bottom
   +
       0px : border-bottom-width
   +
-      0px : margin-bottom: auto
+      0px : margin-bottom
   +
   (solve) : bottom: auto
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 160px;
+And so computed bottom value must be 160px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-086.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-086.xht
@@ -41,26 +41,28 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
-If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
+If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
@@ -96,17 +98,17 @@ gives us:
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
   (solve) : bottom
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-088.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-088.xht
@@ -52,19 +52,19 @@ If none of the three is 'auto': If both 
 'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
 
 So:
 
     160px : left
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
@@ -74,33 +74,33 @@ So:
     320px : width of containing block
 
 gives us:
 
     160px : left
   +
       0px : margin-left
   +
-      0px : border-top-width
+      0px : border-left-width
   +
-      0px : padding-top
+      0px : padding-left
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
       0px : margin-right
   +
-  (solve) : right: auto
+  (solve) : right
     =====================
     320px : width of containing block
 
-And so computed right value must be 80px;
+And so computed right value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-090.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-090.xht
@@ -45,26 +45,28 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
-If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
+If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
@@ -100,17 +102,17 @@ gives us:
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
   (solve) : bottom
     =====================
     320px : height of containing block
 
-And so computed bottom value must be 80px;
+And so computed bottom value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-092.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-092.xht
@@ -41,26 +41,28 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
@@ -96,17 +98,17 @@ gives us:
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-094.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-094.xht
@@ -1,15 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'left', 'width' and 'right' are not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'left', 'width' and 'right' are not 'auto' (overconstrained)</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vlr-009-ref.xht" />
 
   <meta name="flags" content="ahem image" />
   <meta name="assert" content="When 'direction' is 'rtl' and 'left', 'width' and 'right' are not 'auto' and if the values are overconstrained, then ignore 'left' and then solve for 'left'." />
@@ -84,23 +84,23 @@ gives us:
       0px : padding-top
   +
      80px : width
   +
       0px : padding-right
   +
       0px : border-right-width
   +
-      0px : margin-right: auto
+      0px : margin-right
   +
     160px : right
     =====================
     320px : width of containing block
 
-And so computed left value must be 80px;
+And so computed left value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>
 
--- a/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-096.xht
+++ b/layout/reftests/writing-mode/abspos/s71-abs-pos-non-replaced-vrl-096.xht
@@ -1,15 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
 
-  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are not 'auto'</title>
+  <title>CSS Writing Modes Test: absolutely positioned non-replaced element - 'direction: rtl' and 'top', 'height' and 'bottom' are not 'auto' (overconstrained)</title>
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
   <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" title="7.1 Principles of Layout in Vertical Writing Modes" />
   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width" title="10.3.7 Absolutely positioned, non-replaced elements" />
   <link rel="match" href="s71-abs-pos-non-replaced-vrl-012-ref.xht" />
 
   <meta name="flags" content="ahem image" />
   <meta name="assert" content="When 'direction' is 'rtl' and 'top', 'height' and 'bottom' are not 'auto' and if the values are overconstrained, then ignore 'top' and solve for 'top'." />
@@ -45,26 +45,28 @@
       margin-bottom: 0em;
       margin-top: 0em;
       position: absolute;
       top: 2em;
     }
 
 /*
 "
+Layout calculation rules (such as those in CSS2.1, Section 10.3) that apply to the horizontal dimension in horizontal writing modes instead apply to the vertical dimension in vertical writing modes.
+"
+7.1 Principles of Layout in Vertical Writing Modes
+http://www.w3.org/TR/css-writing-modes-3/#vertical-layout
+
+So here, *-top and *-bottom properties are input into the §10.3.7 algorithms where *-top properties refer to *-left properties in the layout rules and where *-bottom properties refer to *-right properties in the layout rules.
+
+"
 If none of the three is 'auto': If both 'margin-left' and 'margin-right' are 'auto', solve the equation under the extra constraint that the two margins get equal values, unless this would make them negative, in which case when direction of the containing block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and solve for 'margin-right' ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', solve the equation for that value. If the values are over-constrained, ignore the value for 'left' (in case the 'direction' property of the containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that value.
 "
 
-'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + 'right' = width of containing block
-
-"
-Layout rules that refer to the *-left and *-right box properties (border, margin, padding) use *-top and *-bottom instead, and vice versa. Which side of the box the property applies to doesn't change: only which values are inputs to which layout calculations changes.
-"
-7.1 Principles of Layout in Vertical Writing Modes
-http://www.w3.org/TR/css-writing-modes-3/#logical-direction-layout
+'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block
 
 So:
 
     160px : top
   +
       0px : margin-top
   +
       0px : border-top-width
@@ -100,17 +102,17 @@ gives us:
       0px : border-bottom-width
   +
       0px : margin-bottom
   +
     160px : bottom
     =====================
     320px : height of containing block
 
-And so computed top value must be 80px;
+And so computed top value must be 80px .
 */
 
   ]]></style>
 
  </head>
 
  <body>