Bug 252281
| Summary: | REGRESSION (259904@main): window.getSelection() is empty for selection inside textarea | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Yury Semikhatsky <yurys> |
| Component: | HTML Editing | Assignee: | Ryosuke Niwa <rniwa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | darin, m.goleb+bugzilla, rniwa, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 216325 | ||
| Bug Blocks: | |||
Yury Semikhatsky
After https://commits.webkit.org/259904@main the following page shows empty selection when selecting some text inside the textarea, it was selected text before the change.
data:text/html,<textarea>Some text</textarea><div>empty</div>
<script>
document.addEventListener('selectionchange', () => {
let div = document.querySelector("div");
div.textContent = window.getSelection().toString();
});
</script>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
This is expected behavior change from enabling live range selection.
Darin Adler
This is behavior that matches other web browsers and an intentional change. I’m not sure there’s anything more to say about this. We may want to close this bug unless there is additional insight about the effects of this.
Yury Semikhatsky
> This is behavior that matches other web browsers and an intentional change.
In Chromium example above does capture actual selection within the text area. In Firefox it doesn't.
With that said, feel free to close this. If this is an intentional change in the behavior, we'll update our test expectations.
Darin Adler
I think we should work together to decide what the behavior should be. I had no idea that Chromium and Firefox had different behavior.
We should add coverage in Web Platform Tests, write the behavior in some standard, and make sure all the browsers match for interoperability.
Yury Semikhatsky
To avoid confusion, when talking about updating our tests I meant Playwright test expectations for WebKit (we noticed the change in the behavior with a recent WebKit roll).
Ryosuke Niwa
Looks like at least one Apple internal website is broken due to this behavior difference. We may need to restore the old behavior of WebKit...
Ryosuke Niwa
Reopening this bug to restore the old behavior.
Ryosuke Niwa
<rdar://107622423>
Ryosuke Niwa
Pull request: https://github.com/WebKit/WebKit/pull/13063
EWS
Committed 263280@main (b6892f51e01e): <https://commits.webkit.org/263280@main>
Reviewed commits have been landed. Closing PR #13063 and removing active labels.