Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: third_party/WebKit/LayoutTests/fast/table/table-cell-scope-getter.html

Issue 2376593003: Limit scope getter to predefined values (Closed)
Patch Set: Add test Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/table/table-cell-scope-getter.html
diff --git a/third_party/WebKit/LayoutTests/fast/table/table-cell-scope-getter.html b/third_party/WebKit/LayoutTests/fast/table/table-cell-scope-getter.html
new file mode 100644
index 0000000000000000000000000000000000000000..4e62535e7c6046da42374b72614d5ac0bbdaceeb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/table/table-cell-scope-getter.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+ <script>
+ td = document.createElement('td');
tkent 2016/09/29 23:15:56 indentation looks bad.
+test(function() {
+ assert_equals(td.scope, '');
+ td.scope = "Foo";
+ assert_equals(td.scope, '');
+ td.setAttribute("scope", "");
+ assert_equals(td.scope, '');
+ td.setAttribute("scope", "Foo");
+ assert_equals(td.scope, '');
+}, '"Default value of scope getter is empty string"');
+
+test(function() {
+ td.scope = "row";
+ assert_equals(td.scope, 'row');
+ td.scope = "ROW";
+ assert_equals(td.scope, 'row');
+ td.scope = "Row";
+ assert_equals(td.scope, 'row');
+
+ td.setAttribute("scope", "row");
+ assert_equals(td.scope, 'row');
+ td.setAttribute("scope", "ROW");
+ assert_equals(td.scope, 'row');
+ td.setAttribute("scope", "Row");
+ assert_equals(td.scope, 'row');
+}, 'Row value is accepted with case-sensivity');
+
+test(function() {
+ td.scope = "col";
+ assert_equals(td.scope, 'col');
+ td.scope = "COL";
+ assert_equals(td.scope, 'col');
+ td.scope = "Col";
+ assert_equals(td.scope, 'col');
+
+ td.setAttribute("scope", "col");
+ assert_equals(td.scope, 'col');
+ td.setAttribute("scope", "COL");
+ assert_equals(td.scope, 'col');
+ td.setAttribute("scope", "Col");
+ assert_equals(td.scope, 'col');
+}, 'Col value is accepted with case-sensivity');
+
+test(function() {
+ td.scope = "rowgroup";
+ assert_equals(td.scope, 'rowgroup');
+ td.scope = "ROWGROUP";
+ assert_equals(td.scope, 'rowgroup');
+ td.scope = "Rowgroup";
+ assert_equals(td.scope, 'rowgroup');
+
+ td.setAttribute("scope", "rowgroup");
+ assert_equals(td.scope, 'rowgroup');
+ td.setAttribute("scope", "ROWGROUP");
+ assert_equals(td.scope, 'rowgroup');
+ td.setAttribute("scope", "Rowgroup");
+ assert_equals(td.scope, 'rowgroup');
+}, 'Rowgroup value is accepted with case-sensivity');
+
+test(function() {
+ td.scope = "colgroup";
+ assert_equals(td.scope, 'colgroup');
+ td.scope = "COLGROUP";
+ assert_equals(td.scope, 'colgroup');
+ td.scope = "Colgroup";
+ assert_equals(td.scope, 'colgroup');
+
+ td.setAttribute("scope", "colgroup");
+ assert_equals(td.scope, 'colgroup');
+ td.setAttribute("scope", "COLGROUP");
+ assert_equals(td.scope, 'colgroup');
+ td.setAttribute("scope", "Colgroup");
+ assert_equals(td.scope, 'colgroup');
+}, 'Colgroup value is accepted with case-sensivity');
+ </script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698