diff --git a/layout/reftests/reftest.list b/layout/reftests/reftest.list
index c0090e08630..ab7036d0855 100644
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -89,3 +89,5 @@ include forms/reftest.list
# mathml
include mathml/reftest.list
+
+include ../xul/base/src/grid/reftests/reftest.list
diff --git a/layout/xul/base/src/grid/reftests/column-sizing-1-ref.xul b/layout/xul/base/src/grid/reftests/column-sizing-1-ref.xul
new file mode 100644
index 00000000000..df0113083fe
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/column-sizing-1-ref.xul
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/column-sizing-1.xul b/layout/xul/base/src/grid/reftests/column-sizing-1.xul
new file mode 100644
index 00000000000..2a94569ba4b
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/column-sizing-1.xul
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-basic-ref.xhtml b/layout/xul/base/src/grid/reftests/not-full-basic-ref.xhtml
new file mode 100644
index 00000000000..cd233585a38
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-basic-ref.xhtml
@@ -0,0 +1,27 @@
+
+
+
+
+ XUL Grid Test
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-basic.xul b/layout/xul/base/src/grid/reftests/not-full-basic.xul
new file mode 100644
index 00000000000..5c7fa91236e
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-basic.xul
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-grid-pack-align.xul b/layout/xul/base/src/grid/reftests/not-full-grid-pack-align.xul
new file mode 100644
index 00000000000..3fe6a95cbac
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-grid-pack-align.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-group-align-ref.xhtml b/layout/xul/base/src/grid/reftests/not-full-row-group-align-ref.xhtml
new file mode 100644
index 00000000000..abef67f87c5
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-group-align-ref.xhtml
@@ -0,0 +1,27 @@
+
+
+
+
+ XUL Grid Test
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-group-align.xul b/layout/xul/base/src/grid/reftests/not-full-row-group-align.xul
new file mode 100644
index 00000000000..0037d9fb839
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-group-align.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-group-direction-ref.xhtml b/layout/xul/base/src/grid/reftests/not-full-row-group-direction-ref.xhtml
new file mode 100644
index 00000000000..b2a92b07b52
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-group-direction-ref.xhtml
@@ -0,0 +1,27 @@
+
+
+
+
+ XUL Grid Test
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-group-direction.xul b/layout/xul/base/src/grid/reftests/not-full-row-group-direction.xul
new file mode 100644
index 00000000000..c38db40a5e9
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-group-direction.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-group-pack-ref.xhtml b/layout/xul/base/src/grid/reftests/not-full-row-group-pack-ref.xhtml
new file mode 100644
index 00000000000..9232f6ba425
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-group-pack-ref.xhtml
@@ -0,0 +1,31 @@
+
+
+
+
+ XUL Grid Test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-group-pack.xul b/layout/xul/base/src/grid/reftests/not-full-row-group-pack.xul
new file mode 100644
index 00000000000..bb8f650ae80
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-group-pack.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-leaf-align.xul b/layout/xul/base/src/grid/reftests/not-full-row-leaf-align.xul
new file mode 100644
index 00000000000..806514ebde6
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-leaf-align.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-leaf-direction.xul b/layout/xul/base/src/grid/reftests/not-full-row-leaf-direction.xul
new file mode 100644
index 00000000000..17c3a6585ea
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-leaf-direction.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-leaf-pack-ref.xhtml b/layout/xul/base/src/grid/reftests/not-full-row-leaf-pack-ref.xhtml
new file mode 100644
index 00000000000..30635313aae
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-leaf-pack-ref.xhtml
@@ -0,0 +1,27 @@
+
+
+
+
+ XUL Grid Test
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/not-full-row-leaf-pack.xul b/layout/xul/base/src/grid/reftests/not-full-row-leaf-pack.xul
new file mode 100644
index 00000000000..8f353c764a7
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/not-full-row-leaf-pack.xul
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/reftest.list b/layout/xul/base/src/grid/reftests/reftest.list
new file mode 100644
index 00000000000..7f72e9dc748
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/reftest.list
@@ -0,0 +1,17 @@
+== row-sizing-1.xul row-sizing-1-ref.xul
+== column-sizing-1.xul column-sizing-1-ref.xul
+== row-or-column-sizing-1.xul row-or-column-sizing-2.xul
+== row-or-column-sizing-1.xul row-or-column-sizing-3.xul
+== row-or-column-sizing-1.xul row-or-column-sizing-4.xul
+== z-order-1.xul z-order-1-ref.xul
+== z-order-2.xul z-order-2-ref.xul
+== not-full-basic.xul not-full-basic-ref.xhtml
+== not-full-grid-pack-align.xul not-full-basic-ref.xhtml
+== not-full-row-group-align.xul not-full-row-group-align-ref.xhtml # does anyone want/need this behavior?
+== not-full-row-group-pack.xul not-full-row-group-pack-ref.xhtml
+== not-full-row-group-direction.xul not-full-row-group-direction-ref.xhtml
+== not-full-row-leaf-align.xul not-full-basic-ref.xhtml
+== not-full-row-leaf-pack.xul not-full-row-leaf-pack-ref.xhtml
+== not-full-row-leaf-direction.xul not-full-row-leaf-pack-ref.xhtml
+== scrollable-columns.xul scrollable-columns-ref.xhtml
+fails == scrollable-rows.xul scrollable-rows-ref.xhtml
diff --git a/layout/xul/base/src/grid/reftests/row-or-column-sizing-1.xul b/layout/xul/base/src/grid/reftests/row-or-column-sizing-1.xul
new file mode 100644
index 00000000000..6c64eef1800
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/row-or-column-sizing-1.xul
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/row-or-column-sizing-2.xul b/layout/xul/base/src/grid/reftests/row-or-column-sizing-2.xul
new file mode 100644
index 00000000000..008f82fd511
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/row-or-column-sizing-2.xul
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/row-or-column-sizing-3.xul b/layout/xul/base/src/grid/reftests/row-or-column-sizing-3.xul
new file mode 100644
index 00000000000..1e8e55c294c
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/row-or-column-sizing-3.xul
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/row-or-column-sizing-4.xul b/layout/xul/base/src/grid/reftests/row-or-column-sizing-4.xul
new file mode 100644
index 00000000000..5a826fd84cd
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/row-or-column-sizing-4.xul
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/row-sizing-1-ref.xul b/layout/xul/base/src/grid/reftests/row-sizing-1-ref.xul
new file mode 100644
index 00000000000..b357190524c
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/row-sizing-1-ref.xul
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/row-sizing-1.xul b/layout/xul/base/src/grid/reftests/row-sizing-1.xul
new file mode 100644
index 00000000000..0455b8da449
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/row-sizing-1.xul
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/scrollable-columns-ref.xhtml b/layout/xul/base/src/grid/reftests/scrollable-columns-ref.xhtml
new file mode 100644
index 00000000000..698c5a036fb
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/scrollable-columns-ref.xhtml
@@ -0,0 +1,25 @@
+
+
+
+
+ XUL Grid Test
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/scrollable-columns.xul b/layout/xul/base/src/grid/reftests/scrollable-columns.xul
new file mode 100644
index 00000000000..661c4412f4b
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/scrollable-columns.xul
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/scrollable-rows-ref.xhtml b/layout/xul/base/src/grid/reftests/scrollable-rows-ref.xhtml
new file mode 100644
index 00000000000..6b5b95f02c0
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/scrollable-rows-ref.xhtml
@@ -0,0 +1,25 @@
+
+
+
+
+ XUL Grid Test
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/scrollable-rows.xul b/layout/xul/base/src/grid/reftests/scrollable-rows.xul
new file mode 100644
index 00000000000..9fa1f82c521
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/scrollable-rows.xul
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/z-order-1-ref.xul b/layout/xul/base/src/grid/reftests/z-order-1-ref.xul
new file mode 100644
index 00000000000..198c4e6c631
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/z-order-1-ref.xul
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/z-order-1.xul b/layout/xul/base/src/grid/reftests/z-order-1.xul
new file mode 100644
index 00000000000..d38ef9f4a02
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/z-order-1.xul
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/z-order-2-ref.xul b/layout/xul/base/src/grid/reftests/z-order-2-ref.xul
new file mode 100644
index 00000000000..5b0793d6d9c
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/z-order-2-ref.xul
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/xul/base/src/grid/reftests/z-order-2.xul b/layout/xul/base/src/grid/reftests/z-order-2.xul
new file mode 100644
index 00000000000..b2c270d6b7b
--- /dev/null
+++ b/layout/xul/base/src/grid/reftests/z-order-2.xul
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+