Bug 601436 - mtable 'align' attribute: negative rownumbers are wrongly interpreted. r=roc
authorFrédéric Wang <fred.wang@free.fr>
Sun, 07 Aug 2011 01:29:00 -0400
changeset 74096 1cfc6b117e159e4ef04f2c8e4ff7c9f81d56e5df
parent 74095 439bd18e040a72ae39541acfe90e78e3f3475768
child 74097 db5a68bc2a0f12a74edd6220efc17de9bf45d1eb
child 74108 5579c4b5623e47e94ceb88911bbf6d4c46536524
push id20948
push usereakhgari@mozilla.com
push dateTue, 09 Aug 2011 18:44:27 +0000
treeherdermozilla-central@db5a68bc2a0f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs601436
milestone8.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 601436 - mtable 'align' attribute: negative rownumbers are wrongly interpreted. r=roc
layout/mathml/nsMathMLmtableFrame.cpp
layout/reftests/mathml/mtable-align-negative-rownumber-ref.html
layout/reftests/mathml/mtable-align-negative-rownumber.html
layout/reftests/mathml/reftest.list
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -535,19 +535,20 @@ nsMathMLmtableOuterFrame::GetRowFrameAt(
                                         PRInt32         aRowIndex)
 {
   PRInt32 rowCount, colCount;
   GetTableSize(rowCount, colCount);
 
   // Negative indices mean to find upwards from the end.
   if (aRowIndex < 0) {
     aRowIndex = rowCount + aRowIndex;
+  } else {
+    // aRowIndex is 1-based, so convert it to a 0-based index
+    --aRowIndex;
   }
-  // aRowIndex is 1-based, so convert it to a 0-based index
-  --aRowIndex;
 
   // if our inner table says that the index is valid, find the row now
   if (0 <= aRowIndex && aRowIndex <= rowCount) {
     nsIFrame* tableFrame = mFrames.FirstChild();
     if (!tableFrame || tableFrame->GetType() != nsGkAtoms::tableFrame)
       return nsnull;
     nsIFrame* rgFrame = tableFrame->GetFirstChild(nsnull);
     if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-negative-rownumber-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align attribute: negative rownumber</title>
+</head>
+
+<body>
+
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
+<mtable align="axis 3"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable><mo>=</mo>
+<mtable align="axis 1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable></mrow></math>
+</div>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-negative-rownumber.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align attribute: negative rownumber</title>
+</head>
+
+<body>
+
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
+<mtable align="axis -1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable><mo>=</mo>
+<mtable align="axis 1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable></mrow></math>
+</div>
+
+</body>
+</html>
--- a/layout/reftests/mathml/reftest.list
+++ b/layout/reftests/mathml/reftest.list
@@ -21,16 +21,17 @@ fails-if(winWidget) == mfenced-10.html m
 == mi-mathvariant-2.xhtml mi-mathvariant-2-ref.xhtml
 != non-spacing-accent-1.xhtml non-spacing-accent-1-ref.xhtml
 == overbar-width-1.xhtml overbar-width-1-ref.xhtml
 == quotes-1.xhtml quotes-1-ref.xhtml
 != stretchy-underbar-1.xhtml stretchy-underbar-1-ref.xhtml 
 == table-width-1.xhtml table-width-1-ref.xhtml
 == underbar-width-1.xhtml underbar-width-1-ref.xhtml
 == mathml-type-supported.xhtml mathml-type-supported-ref.xml
+== mtable-align-negative-rownumber.html mtable-align-negative-rownumber-ref.html
 != embellished-op-1-1.html embellished-op-1-1-ref.html
 != embellished-op-1-2.html embellished-op-1-2-ref.html
 != embellished-op-1-3.html embellished-op-1-3-ref.html
 != embellished-op-1-4.html embellished-op-1-4-ref.html
 != embellished-op-1-5.html embellished-op-1-5-ref.html
 != embellished-op-2-1.html embellished-op-2-1-ref.html
 != embellished-op-2-2.html embellished-op-2-2-ref.html
 != embellished-op-2-3.html embellished-op-2-3-ref.html