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

Do we need HighlightRange? #15

Open
Reinmar opened this issue Nov 15, 2018 · 1 comment
Open

Do we need HighlightRange? #15

Reinmar opened this issue Nov 15, 2018 · 1 comment

Comments

@Reinmar
Copy link

Reinmar commented Nov 15, 2018

To avoid defining a new subclass of Range, perhaps the entire API could be somehow built around the HighlightsMap.

const range = new Range();

const highlight = document.highlights.create( 'example-highlight', range, {
    priority: 1
} );

highlight.style.color = 'red';
highlight.priority = 42;

document.highlights.remove( range );

HighlightsMap#create() doing create&add at once is not the prettiest method, but maybe something along these lines could work. Having those new properties (style, priority, label) in some new interface (rather than squashed together with Range's properties) might avoid creating one giant class.

@gked
Copy link

gked commented Jul 23, 2019

closing to track the issue here: MicrosoftEdge/MSEdgeExplainers#69

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