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-1] Clarifying that user agents must not use live ranges internally for static ranges #4597 #6545

Merged
merged 3 commits into from Dec 1, 2021

Conversation

dandclark
Copy link
Contributor

Per resolution in #4597, clarify that when authors uses StaticRange highlights, UAs should use the actual static ranges rather than backing them with live ranges.

@@ -482,6 +482,9 @@ Range Updating and Invalidation</h3>
in response to DOM changes,
nor can they be modified by the author after creation.

Note: In other words, the user agent is expected to store the actual
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest removing the "note :" and combining this with the paragraph above. @frivoal, what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd keep it. To me, this sentence clarifies the intent of this earlier normative sentence, rather than add any new requirement.

the user agent must not adjust the boundary points of StaticRanges in response to DOM changes

Do you think it'd be possible for an implementation to satisfy that requirement while still doing something that would be observably different from using static ranges internally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear (in case it wasn't already), my suggestion was just editorial - to combine both the paragraphs into one.

In response to your question though, I think a UA could use live ranges internally and still satisfy the original sentence, since the static ranges created/used by authors wouldn't actually be changed in response to DOM mutations (only the internal live ranges would). That's why I think adding the second sentence is important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me:

a UA could use live ranges internally and still satisfy the original sentence, since the static ranges created/used by authors wouldn't actually be changed in response to DOM mutations

I've pulled the text into the above paragraph. Happy to switch it back though, I think either way is reasonable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frivoal @sanketj I just noticed we never landed this.

What can we do to resolve the disagreement here? I'm inclined to agree that it's useful to have this sentence in normative text (not a note). This would specifically forbid the possibility of a UA using live range internally, while not adjusting StaticRanges passed as arguments. Without the new normative sentence, that would arguably be allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frivoal Going to go ahead and land this. If there are any objections please let me know and I'll follow up with another PR.

@sanketj sanketj merged commit af776de into w3c:main Dec 1, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants