Bug 1370835 - Match new standard for span IDL property; r?mystor
https://github.com/whatwg/html/issues/2705
https://github.com/whatwg/html/pull/2734
MozReview-Commit-ID: 7Sso9sO8f7y
--- a/dom/html/HTMLTableColElement.cpp
+++ b/dom/html/HTMLTableColElement.cpp
@@ -39,17 +39,17 @@ HTMLTableColElement::ParseAttribute(int3
{
if (aNamespaceID == kNameSpaceID_None) {
/* ignore these attributes, stored simply as strings ch */
if (aAttribute == nsGkAtoms::charoff) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::span) {
/* protection from unrealistic large colspan values */
- aResult.ParseIntWithFallback(aValue, 1, MAX_COLSPAN);
+ aResult.ParseClampedNonNegativeInt(aValue, 1, 1, MAX_COLSPAN);
return true;
}
if (aAttribute == nsGkAtoms::width) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::align) {
return ParseTableCellHAlignValue(aValue, aResult);
}
--- a/dom/html/HTMLTableColElement.h
+++ b/dom/html/HTMLTableColElement.h
@@ -22,18 +22,17 @@ public:
}
uint32_t Span() const
{
return GetIntAttr(nsGkAtoms::span, 1);
}
void SetSpan(uint32_t aSpan, ErrorResult& aError)
{
- uint32_t span = aSpan ? aSpan : 1;
- SetUnsignedIntAttr(nsGkAtoms::span, span, 1, aError);
+ SetUnsignedIntAttr(nsGkAtoms::span, aSpan, 1, aError);
}
void GetAlign(DOMString& aAlign)
{
GetHTMLAttr(nsGkAtoms::align, aAlign);
}
void SetAlign(const nsAString& aAlign, ErrorResult& aError)
{
deleted file mode 100644
--- a/testing/web-platform/meta/html/dom/reflection-tabular.html.ini
+++ /dev/null
@@ -1,32 +0,0 @@
-[reflection-tabular.html]
- type: testharness
- [colgroup.span: setAttribute() to 2147483648]
- expected: FAIL
-
- [colgroup.span: setAttribute() to 4294967295]
- expected: FAIL
-
- [colgroup.span: setAttribute() to 4294967296]
- expected: FAIL
-
- [colgroup.span: IDL set to 0]
- expected: FAIL
-
- [colgroup.span: IDL set to "-0"]
- expected: FAIL
-
- [col.span: setAttribute() to 2147483648]
- expected: FAIL
-
- [col.span: setAttribute() to 4294967295]
- expected: FAIL
-
- [col.span: setAttribute() to 4294967296]
- expected: FAIL
-
- [col.span: IDL set to 0]
- expected: FAIL
-
- [col.span: IDL set to "-0"]
- expected: FAIL
-