Bug 1370835 - Match new standard for span IDL property; r?mystor draft
authorAryeh Gregor <ayg@aryeh.name>
Thu, 03 Aug 2017 21:24:56 +0300
changeset 620627 a02736c7190536af9f79de417300bf0dabe82d57
parent 619581 52285ea5e54c73d3ed824544cef2ee3f195f05e6
child 640772 b6b5c1ce6e65ff66e16c5c3c6af6d3630e2ac482
push id72117
push userbmo:ayg@aryeh.name
push dateThu, 03 Aug 2017 18:27:11 +0000
reviewersmystor
bugs1370835
milestone57.0a1
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
dom/html/HTMLTableColElement.cpp
dom/html/HTMLTableColElement.h
testing/web-platform/meta/html/dom/reflection-tabular.html.ini
--- 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
-