[whatwg] Dataset contradiction - does "data-" generate an item in .dataset?

Tab Atkins Jr. jackalmage at gmail.com
Wed Jun 30 09:11:24 PDT 2010


In the first paragraph of
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data
it says that a custom data attribute is "an attribute in no namespace
whose name starts with the string "data-", has at least one character
after the hyphen,...".  Following this, <div data-=foo> would not put
anything in .dataset.

However, in the algorithm for getting the list of name-value pairs, it
says to process "each content attribute on the element whose first
five characters are the string "data-" and whose remaining characters
(if any)...".  Following this, <div data-=foo> would make
.dataset[""]="foo".

One of these references needs to be fixed, as webkit is implementing
dataset right now.

~TJ



More information about the whatwg mailing list