Bug 975935 - Override nsDisplayBorder::GetBounds and import tests from MathJax. r=roc, r=fredw, a=sledru
authorJames Kitchener <jkitch.bug@gmail.com>
Wed, 05 Mar 2014 16:14:58 -0500
changeset 183171 80a30f9e24cc060df51af636a0b5b731ac9c605f
parent 183170 a48b46a28ee7ccc019d8318aea89ec572cd371f1
child 183172 b225712ef2ed1efd8f189ac5606b3d3f990be463
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, fredw, sledru
bugs975935
milestone29.0a2
Bug 975935 - Override nsDisplayBorder::GetBounds and import tests from MathJax. r=roc, r=fredw, a=sledru
layout/base/nsDisplayList.cpp
layout/base/nsDisplayList.h
layout/mathml/nsMathMLmtableFrame.cpp
layout/mathml/nsMathMLmtableFrame.h
layout/reftests/mathml/columnlines-1-ref.html
layout/reftests/mathml/columnlines-1a.html
layout/reftests/mathml/columnlines-1b.html
layout/reftests/mathml/columnlines-1c.html
layout/reftests/mathml/columnlines-2-ref.html
layout/reftests/mathml/columnlines-2a.html
layout/reftests/mathml/columnlines-2b.html
layout/reftests/mathml/columnlines-3-1-ref.html
layout/reftests/mathml/columnlines-3-1.html
layout/reftests/mathml/columnlines-3-2-ref.html
layout/reftests/mathml/columnlines-3-2.html
layout/reftests/mathml/reftest.list
layout/reftests/mathml/rowlines-1-ref.html
layout/reftests/mathml/rowlines-1a.html
layout/reftests/mathml/rowlines-1b.html
layout/reftests/mathml/rowlines-1c.html
layout/reftests/mathml/rowlines-2-ref.html
layout/reftests/mathml/rowlines-2a.html
layout/reftests/mathml/rowlines-2b.html
layout/reftests/mathml/rowlines-3-1-ref.html
layout/reftests/mathml/rowlines-3-1.html
layout/reftests/mathml/rowlines-3-2-ref.html
layout/reftests/mathml/rowlines-3-2.html
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2629,23 +2629,28 @@ nsDisplayBorder::Paint(nsDisplayListBuil
                               mFrame->StyleContext(),
                               mFrame->GetSkipSides());
 }
 
 nsRect
 nsDisplayBorder::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
 {
   *aSnap = true;
-  const nsStyleBorder *styleBorder = mFrame->StyleBorder();
+  return CalculateBounds(*mFrame->StyleBorder());
+}
+
+nsRect
+nsDisplayBorder::CalculateBounds(const nsStyleBorder& aStyleBorder)
+{
   nsRect borderBounds(ToReferenceFrame(), mFrame->GetSize());
-  if (styleBorder->IsBorderImageLoaded()) {
-    borderBounds.Inflate(mFrame->StyleBorder()->GetImageOutset());
+  if (aStyleBorder.IsBorderImageLoaded()) {
+    borderBounds.Inflate(aStyleBorder.GetImageOutset());
     return borderBounds;
   } else {
-    nsMargin border = styleBorder->GetComputedBorder();
+    nsMargin border = aStyleBorder.GetComputedBorder();
     nsRect result;
     if (border.top > 0) {
       result = nsRect(borderBounds.X(), borderBounds.Y(), borderBounds.Width(), border.top);
     }
     if (border.right > 0) {
       result.UnionRect(result, nsRect(borderBounds.XMost() - border.right, borderBounds.Y(), border.right, borderBounds.Height()));
     }
     if (border.bottom > 0) {
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -1909,16 +1909,19 @@ public:
                                    const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
   NS_DISPLAY_DECL_NAME("Border", TYPE_BORDER)
   
   virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder);
 
   virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
                                          const nsDisplayItemGeometry* aGeometry,
                                          nsRegion* aInvalidRegion) MOZ_OVERRIDE;
+
+ protected:
+  nsRect CalculateBounds(const nsStyleBorder& aStyleBorder);
 };
 
 /**
  * A simple display item that just renders a solid color across the
  * specified bounds. For canvas frames (in the CSS sense) we split off the
  * drawing of the background color into this class (from nsDisplayBackground
  * via nsDisplayCanvasBackground). This is done so that we can always draw a
  * background color to avoid ugly flashes of white when we can't draw a full
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -175,74 +175,88 @@ FindCellProperty(const nsIFrame* aCellFr
       currentFrame = nullptr; // A null frame pointer exits the loop
     else
       currentFrame = currentFrame->GetParent(); // Go to the parent frame
   }
 
   return propertyData;
 }
 
+static void
+ApplyBorderToStyle(const nsMathMLmtdFrame* aFrame,
+                   nsStyleBorder& aStyleBorder)
+{
+  int32_t rowIndex;
+  int32_t columnIndex;
+  aFrame->GetRowIndex(rowIndex);
+  aFrame->GetColIndex(columnIndex);
+
+  nscoord borderWidth =
+    aFrame->PresContext()->GetBorderWidthTable()[NS_STYLE_BORDER_WIDTH_THIN];
+
+  nsTArray<int8_t>* rowLinesList =
+    FindCellProperty(aFrame, RowLinesProperty());
+
+  nsTArray<int8_t>* columnLinesList =
+    FindCellProperty(aFrame, ColumnLinesProperty());
+
+  // We don't place a row line on top of the first row
+  if (rowIndex > 0 && rowLinesList) {
+    // If the row number is greater than the number of provided rowline
+    // values, we simply repeat the last value.
+    int32_t listLength = rowLinesList->Length();
+    if (rowIndex < listLength) {
+      aStyleBorder.SetBorderStyle(NS_SIDE_TOP,
+                    rowLinesList->ElementAt(rowIndex - 1));
+    } else {
+      aStyleBorder.SetBorderStyle(NS_SIDE_TOP,
+                    rowLinesList->ElementAt(listLength - 1));
+    }
+    aStyleBorder.SetBorderWidth(NS_SIDE_TOP, borderWidth);
+  }
+
+  // We don't place a column line on the left of the first column.
+  if (columnIndex > 0 && columnLinesList) {
+    // If the column number is greater than the number of provided columline
+    // values, we simply repeat the last value.
+    int32_t listLength = columnLinesList->Length();
+    if (columnIndex < listLength) {
+      aStyleBorder.SetBorderStyle(NS_SIDE_LEFT,
+                    columnLinesList->ElementAt(columnIndex - 1));
+    } else {
+      aStyleBorder.SetBorderStyle(NS_SIDE_LEFT,
+                    columnLinesList->ElementAt(listLength - 1));
+    }
+    aStyleBorder.SetBorderWidth(NS_SIDE_LEFT, borderWidth);
+  }
+}
+
 /*
  * A variant of the nsDisplayBorder contains special code to render a border
  * around a nsMathMLmtdFrame based on the rowline and columnline properties
  * set on the cell frame.
  */
 class nsDisplaymtdBorder : public nsDisplayBorder {
 public:
   nsDisplaymtdBorder(nsDisplayListBuilder* aBuilder, nsMathMLmtdFrame* aFrame)
     : nsDisplayBorder(aBuilder, aFrame)
   {
   }
 
+  virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE
+  {
+    nsStyleBorder styleBorder = *mFrame->StyleBorder();
+    ApplyBorderToStyle(static_cast<nsMathMLmtdFrame*>(mFrame), styleBorder);
+    return CalculateBounds(styleBorder);
+  }
+
   virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE
   {
-    int32_t rowIndex;
-    int32_t columnIndex;
-    static_cast<nsTableCellFrame*>(mFrame)->
-      GetCellIndexes(rowIndex, columnIndex);
-
     nsStyleBorder styleBorder = *mFrame->StyleBorder();
-    nscoord borderWidth =
-      mFrame->PresContext()->GetBorderWidthTable()[NS_STYLE_BORDER_WIDTH_THIN];
-
-    nsTArray<int8_t>* rowLinesList =
-      FindCellProperty(mFrame, RowLinesProperty());
-
-    nsTArray<int8_t>* columnLinesList =
-      FindCellProperty(mFrame, ColumnLinesProperty());
-
-    // We don't place a row line on top of the first row
-    if (rowIndex > 0 && rowLinesList) {
-      // If the row number is greater than the number of provided rowline
-      // values, we simply repeat the last value.
-      int32_t listLength = rowLinesList->Length();
-      if (rowIndex < listLength) {
-        styleBorder.SetBorderStyle(NS_SIDE_TOP,
-                      rowLinesList->ElementAt(rowIndex - 1));
-      } else {
-        styleBorder.SetBorderStyle(NS_SIDE_TOP,
-                      rowLinesList->ElementAt(listLength - 1));
-      }
-      styleBorder.SetBorderWidth(NS_SIDE_TOP, borderWidth);
-    }
-
-    // We don't place a column line on the left of the first column.
-    if (columnIndex > 0 && columnLinesList) {
-      // If the column number is greater than the number of provided columline
-      // values, we simply repeat the last value.
-      int32_t listLength = columnLinesList->Length();
-      if (columnIndex < listLength) {
-        styleBorder.SetBorderStyle(NS_SIDE_LEFT,
-                      columnLinesList->ElementAt(columnIndex - 1));
-      } else {
-        styleBorder.SetBorderStyle(NS_SIDE_LEFT,
-                      columnLinesList->ElementAt(listLength - 1));
-      }
-      styleBorder.SetBorderWidth(NS_SIDE_LEFT, borderWidth);
-    }
+    ApplyBorderToStyle(static_cast<nsMathMLmtdFrame*>(mFrame), styleBorder);
 
     nsPoint offset = ToReferenceFrame();
     nsCSSRendering::PaintBorderWithStyleBorder(mFrame->PresContext(), *aCtx,
                                                mFrame, mVisibleRect,
                                                nsRect(offset,
                                                       mFrame->GetSize()),
                                                styleBorder,
                                                mFrame->StyleContext(),
@@ -832,16 +846,26 @@ nsresult
 nsMathMLmtdFrame::ProcessBorders(nsTableFrame* aFrame,
                                  nsDisplayListBuilder* aBuilder,
                                  const nsDisplayListSet& aLists)
 {
   aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
                                             nsDisplaymtdBorder(aBuilder, this));
   return NS_OK;
 }
+
+nsMargin*
+nsMathMLmtdFrame::GetBorderWidth(nsMargin& aBorder) const
+{
+  nsStyleBorder styleBorder = *StyleBorder();
+  ApplyBorderToStyle(this, styleBorder);
+  aBorder = styleBorder.GetComputedBorder();
+  return &aBorder;
+}
+
 // --------
 // implementation of nsMathMLmtdInnerFrame
 
 NS_QUERYFRAME_HEAD(nsMathMLmtdInnerFrame)
   NS_QUERYFRAME_ENTRY(nsIMathMLFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
 
 nsIFrame*
--- a/layout/mathml/nsMathMLmtableFrame.h
+++ b/layout/mathml/nsMathMLmtableFrame.h
@@ -201,16 +201,18 @@ public:
 
   virtual int32_t GetRowSpan() MOZ_OVERRIDE;
   virtual int32_t GetColSpan() MOZ_OVERRIDE;
   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
   {
     return nsTableCellFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
   }
 
+  virtual nsMargin* GetBorderWidth(nsMargin& aBorder) const MOZ_OVERRIDE;
+
 protected:
   nsMathMLmtdFrame(nsStyleContext* aContext) : nsTableCellFrame(aContext) {}
   virtual ~nsMathMLmtdFrame();
 }; // class nsMathMLmtdFrame
 
 // --------------
 
 class nsMathMLmtdInnerFrame : public nsBlockFrame,
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1-ref.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable>
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1a.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable columnlines="none">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1b.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable columnlines="solid">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1c.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable columnlines="dashed">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-2-ref.html
@@ -0,0 +1,41 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable columnlines="solid none dashed dashed dashed">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>*</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-2a.html
@@ -0,0 +1,41 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable columnlines="solid none dashed">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>*</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-2b.html
@@ -0,0 +1,41 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable columnlines="solid none dashed dashed dashed solid solid none solid none">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>*</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-1-ref.html
@@ -0,0 +1,32 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable columnlines="dashed">
+        <mtr>
+          <mtd><mspace height="150px"></mspace></mtd>
+          <mtd><mspace height="150px"></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 115px; left: 0px;
+              width: 50px; height: 55px; background: red;"></div>
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-1.html
@@ -0,0 +1,48 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <!-- We assume there is a gap of more than 1px between dashes. Hence
+       putting two dashed lines with only one pixel of difference in their
+       vertical coordinates should not render the same as one dashed line
+       alone. The opposite is true for continuous line.
+       The red squares allow to ignore the difference at the bounds -->
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable  columnlines="dashed">
+        <mtr>
+          <mtd><mspace height="150px"></mspace></mtd>
+          <mtd><mspace height="150px"></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 6px; left: 5px;">
+    <math>
+      <mtable columnlines="dashed">
+        <mtr>
+          <mtd><mspace height="150px"></mspace></mtd>
+          <mtd><mspace height="150px"></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 115px; left: 0px;
+              width: 50px; height: 55px; background: red;"></div>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-2-ref.html
@@ -0,0 +1,32 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable columnlines="solid">
+        <mtr>
+          <mtd><mspace height="150px"></mspace></mtd>
+          <mtd><mspace height="150px"></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 115px; left: 0px;
+              width: 50px; height: 55px; background: red;"></div>
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-2.html
@@ -0,0 +1,48 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <!-- We assume there is a gap of more than 1px between dashes. Hence
+       putting two dashed lines with only one pixel of difference in their
+       vertical coordinates should not render the same as one dashed line
+       alone. The opposite is true for continuous line.
+       The red squares allow to ignore the difference at the bounds -->
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable  columnlines="solid">
+        <mtr>
+          <mtd><mspace height="150px"></mspace></mtd>
+          <mtd><mspace height="150px"></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 6px; left: 5px;">
+    <math>
+      <mtable columnlines="solid">
+        <mtr>
+          <mtd><mspace height="150px"></mspace></mtd>
+          <mtd><mspace height="150px"></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 115px; left: 0px;
+              width: 50px; height: 55px; background: red;"></div>
+  </body>
+</html>
--- a/layout/reftests/mathml/reftest.list
+++ b/layout/reftests/mathml/reftest.list
@@ -180,8 +180,22 @@ fails == whitespace-trim-4.html whitespa
 == mathvariant-4.html mathvariant-4-ref.html
 == mathvariant-5.html mathvariant-5-ref.html
 == ssty-1.html ssty-1-ref.html
 == ssty-2.html ssty-2-ref.html
 == ssty-3.html ssty-3-ref.html
 == ssty-4.html ssty-4-ref.html
 == mathscript-1.html mathscript-1-ref.html
 == mathscript-2.html mathscript-2-ref.html
+== columnlines-1a.html columnlines-1-ref.html
+!= columnlines-1b.html columnlines-1-ref.html
+!= columnlines-1c.html columnlines-1-ref.html
+== columnlines-2a.html columnlines-2-ref.html
+== columnlines-2b.html columnlines-2-ref.html
+!= columnlines-3-1.html columnlines-3-1-ref.html
+== columnlines-3-2.html columnlines-3-2-ref.html
+== rowlines-1a.html rowlines-1-ref.html
+!= rowlines-1b.html rowlines-1-ref.html
+!= rowlines-1c.html rowlines-1-ref.html
+== rowlines-2a.html rowlines-2-ref.html
+== rowlines-2b.html rowlines-2-ref.html
+!= rowlines-3-1.html rowlines-3-1-ref.html
+== rowlines-3-2.html rowlines-3-2-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1-ref.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable>
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1a.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable rowlines="none">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1b.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable  rowlines="solid">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1c.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable rowlines="dashed">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+          <mtd>
+            <mn>6</mn>
+          </mtd>
+          <mtd>
+            <mn>7</mn>
+          </mtd>
+          <mtd>
+            <mn>8</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>9</mn>
+          </mtd>
+          <mtd>
+            <mn>10</mn>
+          </mtd>
+          <mtd>
+            <mn>11</mn>
+          </mtd>
+          <mtd>
+            <mn>12</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>13</mn>
+          </mtd>
+          <mtd>
+            <mn>14</mn>
+          </mtd>
+          <mtd>
+            <mn>15</mn>
+          </mtd>
+          <mtd>
+            <mn>16</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-2-ref.html
@@ -0,0 +1,51 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable rowlines="none dashed solid solid solid">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>*</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-2a.html
@@ -0,0 +1,51 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable rowlines="none dashed solid">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>*</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-2b.html
@@ -0,0 +1,51 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+    <math>
+      <mtable rowlines="none dashed solid solid solid none dashed dashed none">
+        <mtr>
+          <mtd>
+            <mn>1</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>2</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>3</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>4</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>5</mn>
+          </mtd>
+        </mtr>
+        <mtr>
+          <mtd>
+            <mn>*</mn>
+          </mtd>
+        </mtr>
+      </mtable>
+    </math>
+
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-1-ref.html
@@ -0,0 +1,34 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable width="150px" rowlines="dashed">
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 5px; left: 110px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-1.html
@@ -0,0 +1,53 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <!-- We assume there is a gap of more than 1px between dashes. Hence
+       putting two dashed lines with only one pixel of difference in their
+       horizontal coordinates should not render the same as one dashed line
+       alone. The opposite is true for continuous line.
+       The red squares allow to ignore the difference at the bounds -->
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable width="150px" rowlines="dashed">
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 6px;">
+    <math>
+      <mtable width="150px"  rowlines="dashed">
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 5px; left: 110px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-2-ref.html
@@ -0,0 +1,34 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable width="150px" rowlines="solid">
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 5px; left: 112px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-2.html
@@ -0,0 +1,53 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80:  -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>mtable frame</title>
+    <!-- Copyright (c) 2011 Design Science, Inc.
+         License: Apache License 2.0 -->
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  </head>
+
+  <body>
+
+  <!-- We assume there is a gap of more than 1px between dashes. Hence
+       putting two dashed lines with only one pixel of difference in their
+       horizontal coordinates should not render the same as one dashed line
+       alone. The opposite is true for continuous line.
+       The red squares allow to ignore the difference at the bounds -->
+
+  <div style="position: absolute; top: 5px; left: 5px;">
+    <math>
+      <mtable width="150px" rowlines="solid">
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 6px;">
+    <math>
+      <mtable width="150px" rowlines="solid">
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+        <mtr>
+          <mtd><mspace></mspace></mtd>
+        </mtr>
+      </mtable>
+    </math>
+  </div>
+
+  <div style="position: absolute; top: 5px; left: 0px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  <div style="position: absolute; top: 5px; left: 112px;
+              width: 50px; height: 50px; background: red;"></div>
+
+  </body>
+</html>