mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1142478 followup. Fix bogus test, and don't get the value of an invalid CheckedInt. Then we can reopen the CLOSED TREE.
This commit is contained in:
parent
eef6c8bda6
commit
ab8690b300
@ -1023,7 +1023,7 @@ nsContentUtils::ParseHTMLInteger(const nsAString& aValue,
|
||||
result |= eParseHTMLInteger_Error | eParseHTMLInteger_ErrorNoValue;
|
||||
}
|
||||
|
||||
if (negate) {
|
||||
if (value.isValid() && negate) {
|
||||
value = -value;
|
||||
// Checking the special case of -0.
|
||||
if (value == 0) {
|
||||
@ -1031,7 +1031,8 @@ nsContentUtils::ParseHTMLInteger(const nsAString& aValue,
|
||||
}
|
||||
}
|
||||
|
||||
if (leadingZeros > 1 || (leadingZeros == 1 && !(value == 0))) {
|
||||
if (value.isValid() &&
|
||||
(leadingZeros > 1 || (leadingZeros == 1 && !(value == 0)))) {
|
||||
result |= eParseHTMLInteger_NonStandard;
|
||||
}
|
||||
|
||||
@ -1040,7 +1041,7 @@ nsContentUtils::ParseHTMLInteger(const nsAString& aValue,
|
||||
}
|
||||
|
||||
*aResult = (ParseHTMLIntegerResultFlags)result;
|
||||
return value.value();
|
||||
return value.isValid() ? value.value() : 0;
|
||||
}
|
||||
|
||||
#define SKIP_WHITESPACE(iter, end_iter, end_res) \
|
||||
|
@ -44,11 +44,13 @@ is(td.getAttribute("colspan"), "100", "Colspan attribute didn't store the origin
|
||||
// Note, if colspan is negative, it is set to 1, because of backwards compatibility.
|
||||
// @see nsHTMLTableCellElement::ParseAttribute
|
||||
td.setAttribute("colspan", "-100k");
|
||||
is(td.getAttribute("colspan"), "1", "Colspan attribute didn't store the original value");
|
||||
is(td.getAttribute("colspan"), "-100k", "Colspan attribute didn't store the original value");
|
||||
td.setAttribute("colspan", " -100 ");
|
||||
is(td.getAttribute("colspan"), "1", "Colspan attribute didn't store the original value");
|
||||
is(td.getAttribute("colspan"), " -100 ", "Colspan attribute didn't store the original value");
|
||||
is(td.colSpan, 1, "Colspan reflection should be correct for ' -100 '");
|
||||
td.setAttribute("colspan", "-100");
|
||||
is(td.getAttribute("colspan"), "1", "Colspan attribute didn't store the original value");
|
||||
is(td.getAttribute("colspan"), "-100", "Colspan attribute didn't store the original value");
|
||||
is(td.colSpan, 1, "Colspan reflection should be correct for '-100'");
|
||||
|
||||
|
||||
td.setAttribute("colspan", "foobar");
|
||||
|
Loading…
Reference in New Issue
Block a user