Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<circle> attributes do not include "fill" #1

Closed
yurivish opened this issue Dec 26, 2017 · 3 comments
Closed

<circle> attributes do not include "fill" #1

yurivish opened this issue Dec 26, 2017 · 3 comments

Comments

@yurivish
Copy link

yurivish commented Dec 26, 2017

Hi! I noticed some missing properties when playing around with your dataset here. 😄

fill on <circle> is missing:

"circle": [

This also seems to be the case for many other elements, such as <rect>. Andstroke is also missing. Did you mean to leave these out for some reason, or was it an accidental omission?

Section M.2 of the SVG 1.1 spec has a list of styling attributes and the elements on which they may be present.

@wooorm
Copy link
Owner

wooorm commented Dec 28, 2017

Hey @yurivish! Thanks for contributing! :)

You’re right! Because of the build script, the presentation attributes aren't added (by mistake), as you point out.

I‘m wondering though: adding them to all those elements increases the size a lot! It used to be 2.86 kB (min+gzip) or 17 kB (min), but with this fix would be 3.76 kB (min+gzip) or 62 kB (min).

That’s quite the increase! Maybe we could add another special category? @ for all the presentational attributes, and potentially @ in each element that can have them?

Do you have any ideas?

@yurivish
Copy link
Author

That depends on how this package is used — do you know what people typically use it for? In my case I'm using the data in your excellent packages for validating HTML/SVG tags and attributes and am preprocessing the JSONs anyway, so the size of the files isn't an issue.

People who care about code size and are shipping the data to the client are almost certainly using gzip, and for people who aren't the size increase is probably not important.

I was exploring a compression scheme earlier that collected all tag/attribute names into a set and represented each one by an unsigned 16-bit integer index. Tag-attribute pairs can then be represented as 32-bit integers.

I decided to hold off on further work until later, but if you're interested in compressing the size of the raw data then that might be a good way to go. 😄

@wooorm wooorm closed this as completed in 0b60f63 Dec 29, 2017
wooorm added a commit that referenced this issue Dec 29, 2017
Previously, presentational attributes were not represented
on any of the elements that allowed them.

Closes GH-1.
@wooorm
Copy link
Owner

wooorm commented Dec 29, 2017

You’re right! Done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants