Bug 1270459 - Limit td/th.scope to known values; r=bz
authorAryeh Gregor <ayg@aryeh.name>
Thu, 05 May 2016 21:29:54 +0300
changeset 296281 e5019fbf51a1f813fe60bcc2935b5582cd6b0dca
parent 296280 7428c2afbc5c2b7122b8687c9b523e8cefb3ba2d
child 296282 5b4e248577b338e619470852b62a776197b4b8d3
push id76271
push userayg@aryeh.name
push dateThu, 05 May 2016 18:29:22 +0000
treeherdermozilla-inbound@13d2ff715514 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1270459
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1270459 - Limit td/th.scope to known values; r=bz
dom/html/HTMLTableCellElement.cpp
dom/html/HTMLTableCellElement.h
testing/web-platform/meta/html/dom/reflection-tabular.html.ini
--- a/dom/html/HTMLTableCellElement.cpp
+++ b/dom/html/HTMLTableCellElement.cpp
@@ -364,16 +364,22 @@ HTMLTableCellElement::GetAlign(DOMString
 static const nsAttrValue::EnumTable kCellScopeTable[] = {
   { "row",      NS_STYLE_CELL_SCOPE_ROW },
   { "col",      NS_STYLE_CELL_SCOPE_COL },
   { "rowgroup", NS_STYLE_CELL_SCOPE_ROWGROUP },
   { "colgroup", NS_STYLE_CELL_SCOPE_COLGROUP },
   { 0 }
 };
 
+void
+HTMLTableCellElement::GetScope(DOMString& aScope)
+{
+  GetEnumAttr(nsGkAtoms::scope, nullptr, aScope);
+}
+
 bool
 HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
                                      nsIAtom* aAttribute,
                                      const nsAString& aValue,
                                      nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     /* ignore these attributes, stored simply as strings
--- a/dom/html/HTMLTableCellElement.h
+++ b/dom/html/HTMLTableCellElement.h
@@ -61,20 +61,17 @@ public:
   void GetAbbr(DOMString& aAbbr)
   {
     GetHTMLAttr(nsGkAtoms::abbr, aAbbr);
   }
   void SetAbbr(const nsAString& aAbbr, ErrorResult& aError)
   {
     SetHTMLAttr(nsGkAtoms::abbr, aAbbr, aError);
   }
-  void GetScope(DOMString& aScope)
-  {
-    GetHTMLAttr(nsGkAtoms::scope, aScope);
-  }
+  void GetScope(DOMString& aScope);
   void SetScope(const nsAString& aScope, ErrorResult& aError)
   {
     SetHTMLAttr(nsGkAtoms::scope, aScope, aError);
   }
   void GetAlign(DOMString& aAlign);
   void SetAlign(const nsAString& aAlign, ErrorResult& aError)
   {
     SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
--- a/testing/web-platform/meta/html/dom/reflection-tabular.html.ini
+++ b/testing/web-platform/meta/html/dom/reflection-tabular.html.ini
@@ -265,196 +265,16 @@
     expected: FAIL
 
   [th.rowSpan: setAttribute() to 2147483647 followed by IDL get]
     expected: FAIL
 
   [th.rowSpan: IDL set to 2147483647 followed by IDL get]
     expected: FAIL
 
-  [th.scope: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f  foo " followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to undefined followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to 7 followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to 1.5 followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to true followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to false followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to object "[object Object\]" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to NaN followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to Infinity followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to -Infinity followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to null followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to object "test-toString" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to object "test-valueOf" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "xrow" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "row\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "ow" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "ROW" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "xcol" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "col\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "ol" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "COL" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "xrowgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "rowgroup\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "owgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "ROWGROUP" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "xcolgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "colgroup\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "olgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: setAttribute() to "COLGROUP" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f  foo " followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to undefined followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to 7 followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to 1.5 followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to true followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to false followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to object "[object Object\]" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to NaN followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to Infinity followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to -Infinity followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to null followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to object "test-toString" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to object "test-valueOf" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "xrow" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "row\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "ow" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "ROW" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "xcol" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "col\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "ol" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "COL" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "xrowgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "rowgroup\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "owgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "ROWGROUP" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "xcolgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "colgroup\\0" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "olgroup" followed by IDL get]
-    expected: FAIL
-
-  [th.scope: IDL set to "COLGROUP" followed by IDL get]
-    expected: FAIL
-
   [th.sorted: typeof IDL attribute]
     expected: FAIL
 
   [th.sorted: IDL get with DOM attribute unset]
     expected: FAIL
 
   [th.sorted: setAttribute() to "" followed by IDL get]
     expected: FAIL