DOM: Prefer standard caretPositionFromPoint over deprecated caretRangeFromPoint#76921
Conversation
|
Size Change: -1 B (0%) Total Size: 7.73 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 994239c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23786961539
|
|
I'm going to merge this modernization PR. All checks are passing, and it's a minor refactoring. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
…angeFromPoint` (#76921) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
…angeFromPoint` (#76921) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
What?
Noticed while investigating #34215.
PR modenizes
caretRangeFromPointDOM helper. Changes: ThecaretPositionFromPointis baseline available and recommended over the deprecatedcaretRangeFromPoint. See: https://developer.mozilla.org/en-US/docs/Web/API/Document/caretPositionFromPointcaretRangeFromPoint()to try the standarddocument.caretPositionFromPointfirst, falling back to the deprecated WebKit-originateddocument.caretRangeFromPointfor older browsersRange | null) and function signature unchanged — no caller changes neededDocumentMaybeWithCaretPositionFromPointandCaretPositiontypedefsTesting Instructions
The writing flow e2e tests should cover this refactoring.
Use of AI Tools
Used Cluade to validate the idea, reviewed and tested manually.