[csswg-drafts] [css-fonts] FontFaceSet uses referential equality for calculating .has()

craigkovatch has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-fonts] FontFaceSet uses referential equality for calculating 
.has() ==
FontFaceSet.has is not very useful right now, as it appears to use 
referential equality when comparing. So if I want to avoid adding 
duplicate FontFaces to my document, as currently speced I will have to
 do my own iteration and deep value comparison.

Could FontFace expose some sort of comparison method that could be 
used by FontFaceSet to provide easier deduping? i.e. so the following 
code could work:

```
var font1 = new FontFace("test", "url(test.woff)", {});
document.fonts.add(font1);
var font2 = new FontFace("test, "url(test.woff)", {});
if (document.fonts.has(font2)) {; // this should be useful
  continue;
}
```

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/273 using your GitHub 
account

Received on Wednesday, 6 July 2016 02:29:18 UTC