[dart:html] Update Element.dataset documentation
Updates which characters are allowed in the dataset name based on
external documentation, and removes restriction on not allowing the
name to start with `xml`. These restrictions are not enforced in the
name parsing in `_DataAttributeMap`. Note, there is an additional
restriction in our docs which is inconsistent with external behavior
disallowing capital letters.
Change-Id: I4143503b17673be2e038df8647fef7c9ac09e9ba
Bug: https://github.com/dart-lang/sdk/issues/43295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 1ae463a..cc93c1e 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -13099,13 +13099,9 @@
/**
* Allows access to all custom data attributes (data-*) set on this element.
*
- * The keys for the map must follow these rules:
- *
- * * The name must not begin with 'xml'.
- * * The name cannot contain a semi-colon (';').
- * * The name cannot contain any capital letters.
- *
- * Any keys from markup will be converted to camel-cased keys in the map.
+ * Any data attributes in the markup will be converted to camel-cased keys
+ * in the map based on [these conversion
+ * rules](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset).
*
* For example, HTML specified as:
*
@@ -13117,6 +13113,8 @@
*
* See also:
*
+ * * [HTML data-* attributes naming
+ restrictions](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*)
* * [Custom data
* attributes](http://dev.w3.org/html5/spec-preview/global-attributes.html#custom-data-attribute)
*/
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 8ced8e6..046addf 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -756,13 +756,9 @@
/**
* Allows access to all custom data attributes (data-*) set on this element.
*
- * The keys for the map must follow these rules:
- *
- * * The name must not begin with 'xml'.
- * * The name cannot contain a semi-colon (';').
- * * The name cannot contain any capital letters.
- *
- * Any keys from markup will be converted to camel-cased keys in the map.
+ * Any data attributes in the markup will be converted to camel-cased keys
+ * in the map based on [these conversion
+ * rules](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset).
*
* For example, HTML specified as:
*
@@ -774,6 +770,8 @@
*
* See also:
*
+ * * [HTML data-* attributes naming
+ restrictions](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*)
* * [Custom data
* attributes](http://dev.w3.org/html5/spec-preview/global-attributes.html#custom-data-attribute)
*/