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

[css-highlight-api] should priority be a floating point number or an integer? #4592

Closed
frivoal opened this issue Dec 13, 2019 · 5 comments
Closed

Comments

@frivoal
Copy link
Collaborator

frivoal commented Dec 13, 2019

Assuming we continue having numerical priorities (see #4591), should the highlight priority be an integer instead of a double?

Downside of integers: likely to be used like BASIC line numbers, counting in 10s (or in 100s) to make insertion between two layers easy. Workable, but clumsy.

Downside of doubles: depending on the internal precision used to store these, in some browsers two very close numbers could be considered equal, while in other browsers they would be different. Depending on the order of insertion into CSS.highlights, this could result in the opposite ordering, and therefore interop problems.

@hober
Copy link
Member

hober commented Jan 22, 2020

If we use numbers at all for this, we should just match z-index and use integers.

@sanketj
Copy link
Member

sanketj commented Mar 24, 2021

@frivoal @hober @fantasai I don't have strong opinions on this, but I'm in favor of keeping this simple and just using integers. Are you all okay with that?

@astearns
Copy link
Member

Given that there is the escape hatch of running through the HighlightRegistry and changing all of the numbers to whatever you like, I am also in favor of integers

@frivoal
Copy link
Collaborator Author

frivoal commented Mar 24, 2021

I'd go with integers too, I think the downside of floats I listed in #4592 (comment) is just asking for trouble.

@sanketj
Copy link
Member

sanketj commented Mar 24, 2021

Updated the spec in the PR above to model the priority attribute as an integer. Closing this issue.

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

No branches or pull requests

4 participants