Bug 1241840 - Set table cell colspan=0 to 1 instead per the HTML spec. r=bz

This commit is contained in:
Mats Palmgren 2016-01-27 17:02:12 +01:00
parent 891bc8cae6
commit 2fcfd3ded9
4 changed files with 32 additions and 5 deletions

View File

@ -110,7 +110,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
[ 0, 1, 2, -1, -1],
[-1, -1, -1, -1, -1],
[ 3, 4, 5, -1, -1],
[ 6, 7, 7, 7, 7],
[ 6, 7, -1, -1, -1],
[ 6, 8, 9, -1, -1],
[ 6, 10, 9, 11, 12]
];

View File

@ -388,9 +388,7 @@ HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
if (res) {
int32_t val = aResult.GetIntegerValue();
// reset large colspan values as IE and opera do
// quirks mode does not honor the special html 4 value of 0
if (val > MAX_COLSPAN || val < 0 ||
(0 == val && InNavQuirksMode(OwnerDoc()))) {
if (val > MAX_COLSPAN || val <= 0) {
aResult.SetTo(1, &aValue);
}
}

View File

@ -1193,7 +1193,7 @@ nsMathMLmtdFrame::GetColSpan()
if (!value.IsEmpty()) {
nsresult error;
colspan = value.ToInteger(&error);
if (NS_FAILED(error) || colspan < 0 || colspan > MAX_COLSPAN)
if (NS_FAILED(error) || colspan <= 0 || colspan > MAX_COLSPAN)
colspan = 1;
}
}

View File

@ -615,3 +615,32 @@
[th.rowSpan: IDL set to 4294967295 followed by getAttribute()]
expected: FAIL
[td.colSpan: setAttribute() to 0 followed by IDL get]
expected: FAIL
[td.colSpan: setAttribute() to "-0" followed by IDL get]
expected: FAIL
[td.colSpan: setAttribute() to "0" followed by IDL get]
expected: FAIL
[td.colSpan: IDL set to 0 followed by IDL get]
expected: FAIL
[td.colSpan: IDL set to "-0" followed by IDL get]
expected: FAIL
[th.colSpan: setAttribute() to 0 followed by IDL get]
expected: FAIL
[th.colSpan: setAttribute() to "-0" followed by IDL get]
expected: FAIL
[th.colSpan: setAttribute() to "0" followed by IDL get]
expected: FAIL
[th.colSpan: IDL set to 0 followed by IDL get]
expected: FAIL
[th.colSpan: IDL set to "-0" followed by IDL get]
expected: FAIL