updateSelection: make more intuitive#36834
Merged
sideshowbarker merged 1 commit intomdn:mainfrom Nov 18, 2024
Merged
Conversation
Contributor
|
Preview URLs |
sideshowbarker
approved these changes
Nov 18, 2024
wbamberg
added a commit
to wbamberg/content
that referenced
this pull request
Nov 27, 2024
* origin/xss-guide: (284 commits) Add information on default entryPoint property values (mdn#36633) Bump husky from 9.1.6 to 9.1.7 (mdn#36863) fix(performance): Typo '50ms seconds' (mdn#36861) Add spec_url & add note for bcd for `<frequency>` and `<frequency-percentage>` (mdn#36848) addresses 36583: summary icon styles (mdn#36691) Remove "simple" part 3: change to "basic" (mdn#36762) the default option of a select (mdn#36658) docs(css): Add support for `<string>` in `syntax` descriptor of @Property at-rule (mdn#36655) Fix parameter syntax for `Navigation.updateCurrentEntry()` (mdn#36852) Update CSP source expression reference (mdn#36792) chore(http): Refresh headers docs (d-k) (mdn#36075) chore(http): Refresh headers r-s (mdn#36590) Updated index.md (mdn#36845) fix : wrong method name (mdn#36843) Remove all redirects to other locales (mdn#36811) fix typos (mdn#36837) docs: update Accept-Charset status (mdn#36822) updateSelection: make more intuitive (mdn#36834) updateText: Remove false information (mdn#36832) DOMRect instance properties (mdn#36704) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Making when to throw exceptions more intuitive.
Motivation
Additional details
With my experiment with Google Chrome 131.0.6778.70, following things didn't throw exceptions:
startgreater thanend:editContext.updateSelection(10, 5);startandendzero:editContext.updateSelection(0, 0);startandendnegative:editContext.updateSelection(-1, -2);What to do with negative
startandenddoesn't seem defined and I thought that there may be an environment where exceptions are thrown in such cases.However, the other cases seems quite natural and I don't think exceptions should be thrown in such cases.
Quote from the definitions of EditContext state in EditContext API:
The "selection start" and "selection end" are what are set based on
startandendpassed toupdateSelection()in the EditContext Interface.Related issues and pull requests