Re: [dom] "A DOMSettableTokenList object is equivalent to ..." (#81)

Have you any test case? Some time ago I test DOMSettableTokenList for HTMLLinkElement.sizes but noticed different behaviour in Firefox, Chrome and IE11:

```
<!DOCTYPE html>
<html>

<head>
 <link sizes="32x32">
 <script>
  window.onload = function(){

   var box = document.getElementById("box");
   var link = document.getElementsByTagName("link")[0];
   var sizes_attr = link.attributes[0];

   box.innerHTML += "link.sizes: " + link.sizes // "32x32" - read set
    + "<br> sizes_attr.value: " + sizes_attr.value; // "32x32" - read attr

   link.sizes = "32x32 48x48 48x48"; // change set (not change attr)

   box.innerHTML += "<br><br>link.sizes: " + link.sizes // "32x32 48x48" - read set
    + "<br> sizes_attr.value: " + sizes_attr.value; // "32x32" - read attr

   sizes_attr.value = "48x48"; // change attr (change set)?

   box.innerHTML += "<br><br>link.sizes: " + link.sizes // "48x48" - read set
    + "<br> sizes_attr.value: " + sizes_attr.value; // "48x48" - read attr

  }
 </script>

</head>
<body>
 <div id="box">
</body>
</html>
``` 
Chrome:
link.sizes: 32x32
sizes_attr.value: 32x32

link.sizes: 32x32 48x48 48x48
sizes_attr.value: 32x32

link.sizes: 48x48
sizes_attr.value: 48x48

Firefox:
link.sizes: 32x32
sizes_attr.value: 32x32

link.sizes: 32x32 48x48 48x48
sizes_attr.value: 32x32 48x48 48x48

link.sizes: 48x48
sizes_attr.value: 48x48

IE11:
link.sizes: undefined
sizes_attr.value: 32x32

link.sizes: 32x32 48x48 48x48
sizes_attr.value: 32x32

link.sizes: 32x32 48x48 48x48
sizes_attr.value: 48x48

I'm not sure what behaviour is correct, changing attr's value via attr.value should change sets (from DOMSettableTokenList) or not? If yes where exactly do I find this definition?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/81#issuecomment-148913547

Received on Saturday, 17 October 2015 12:30:04 UTC