Split relList supports() into multiple tests (#17026)
Also correct the tests for 'form'.
diff --git a/html/semantics/rellist-feature-detection.html b/html/semantics/rellist-feature-detection.html
index d290439..45debcc 100644
--- a/html/semantics/rellist-feature-detection.html
+++ b/html/semantics/rellist-feature-detection.html
@@ -24,10 +24,11 @@
'apple-touch-icon-precomposed', 'canonical']
};
link_support_table['area'] = link_support_table['a'];
-link_support_table['form'] = link_support_table['form'];
+link_support_table['form'] = link_support_table['a'];
-function test_rellist(tag_name, rel_table) {
- let element = document.createElement(tag_name);
+function test_rellist(tag_name) {
+ const rel_table = link_support_table[tag_name];
+ const element = document.createElement(tag_name);
let tag = element.tagName;
// Test that setting rel is also setting relList, for both
// valid and invalid values.
@@ -74,10 +75,10 @@
}
}
-test(function() {
- test_rellist('LINK', link_support_table['link']);
- test_rellist('A', link_support_table['a']);
- test_rellist('AREA', link_support_table['area']);
- test_rellist('FORM', link_support_table['form']);
-}, 'Make sure that relList based feature detection is working');
+['link', 'a', 'area', 'form'].forEach(tag_name => {
+ test(
+ () => test_rellist(tag_name),
+ `Make sure that relList based feature detection is working for <${tag_name}>`
+ );
+});
</script>