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

Adding HighlightRange to the selection #70

Closed
gked opened this issue Jul 23, 2019 · 2 comments
Closed

Adding HighlightRange to the selection #70

gked opened this issue Jul 23, 2019 · 2 comments

Comments

@gked
Copy link
Contributor

gked commented Jul 23, 2019

moving the issue from https://github.com/dlibby-/highlight/issues/14
@Reinmar as FYI

My understanding is that since HighlightRange inherits from Range, it can be passed to Selection#addRange().

According to https://www.w3.org/TR/selection-api/#dom-selection-addrange that range is passed there by a reference and it should be updated once the selection changes.

Does it mean that someone can add a highlight range to the selection? And, if so, could it cause some problems?

Also, we could imagine that the selection is highlighting its ranges internally (so ::selection ~== ::highlight(selection)). I wonder if this could have some interesting implications.

@sanketj
Copy link
Member

sanketj commented Jul 25, 2019

@Reinmar As mentioned in #69 , we have removed HighlightRange from this API and use a HighlightRangeGroup to apply highlight styling to a group of ranges. Therefore, this shouldn’t be an issue anymore. Please let me know if you disagree.

@sanketj
Copy link
Member

sanketj commented Jul 25, 2019

Closing this issue as it seems to have been addressed. Please feel free to reactivate if you have any additional concerns.

@sanketj sanketj closed this as completed Jul 25, 2019
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