Bug 601436 - mtable 'align' attribute: negative rownumbers are wrongly interpreted. r=roc

This commit is contained in:
Frédéric Wang 2011-08-07 01:29:00 -04:00
parent 56a42da678
commit a3ea06bbc7
4 changed files with 34 additions and 2 deletions

View File

@ -540,9 +540,10 @@ nsMathMLmtableOuterFrame::GetRowFrameAt(nsPresContext* aPresContext,
// 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) {

View File

@ -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>

View File

@ -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>

View File

@ -26,6 +26,7 @@ fails-if(winWidget) == mfenced-10.html mfenced-10-ref.html
== 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