W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2016

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

From: craigkovatch via GitHub <sysbot+gh@w3.org>
Date: Wed, 06 Jul 2016 02:29:08 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-163986110-1467772146-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:00 UTC