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

Should the methods of EditContext throw an exception if they abort due to not activated? #26

Closed
masayuki-nakano opened this issue Dec 13, 2021 · 2 comments · Fixed by #77

Comments

@masayuki-nakano
Copy link

The methods of EditContext are defined their behavior as

  1. If the EditContext is not activated, abort these steps.

But this is unclear whether an exception should be thrown or silently do nothing.

@travisleithead travisleithead transferred this issue from w3c/editing Apr 21, 2022
@dandclark
Copy link
Contributor

This is an old issue but the question is still relevant, and we should prioritize resolving it.
The 4 methods that have this behavior are updateText(), updateSelection(), updateSelectionBounds(), updateControlBounds(), and updateCharacterBounds()

There's a third option I'd also like to consider, which is that we could just let the methods run normally even if the EditContext is not active. I think that is actually the more desirable behavior. Consider a page with multiple editable forms each implemented with EditContext, and the page has a single button to clear all forms. The page should not be required to set focus on each form in order to clear its text state.

The implementations of these methods don't fire any events, they're just a state update. So allowing them to function on a non-active EditContext should not introduce any complications.

@dandclark dandclark added the Agenda+ Queue this item for discussion at the next WG meeting label Oct 5, 2023
@johanneswilm johanneswilm changed the title Shuold the methods of EditContext throw an exception if they abort due to not activated? Should the methods of EditContext throw an exception if they abort due to not activated? Oct 12, 2023
@johanneswilm johanneswilm removed the Agenda+ Queue this item for discussion at the next WG meeting label Oct 12, 2023
@w3c w3c deleted a comment from css-meeting-bot Oct 13, 2023
@dandclark
Copy link
Contributor

Bot posted the minutes from the wrong topic. Here are the correct minutes from the 2023-10-12 WG meeting:

8:40 AM <sanketj_> dandclark: Spec mentions that updateText and similar method all should abort early if EditContext is not active.
8:41 AM <sanketj_> dandclark: Chromium does not implement that way, does not abort if EditContext is not active.
8:41 AM <sanketj_> dandclark: Seems unnecessary to abort, and maybe not desirable.
8:41 AM q+
8:42 AM <sanketj_> johanneswilm: Agree not desirable. Requiring focus seems not as convenient.
8:43 AM <sanketj_> Resolution: Accept proposal.

dandclark added a commit that referenced this issue Oct 16, 2023
Per [WG resolution](#26 (comment)), remove "is active" checks from `updateText()`, `updateSelection()`, `updateSelectionBounds()`, `updateControlBounds()`, and `updateCharacterBounds()`.

Closes #26
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 a pull request may close this issue.

4 participants