-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cherry-pick "LibWeb+LibWebView: Auto-select subtext when editing DOM nodes/attributes" #25295
Draft
nico
wants to merge
6
commits into
SerenityOS:master
Choose a base branch
from
nico:pr-1205
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
We currently use a naive word segmentation, looking for ASCII spaces to mark a word boundary. Use LibUnicode's complete implementation instead. (cherry picked from commit 430c9d3e3fb6ec9e2aa3d962381672b70957c395)
Otherwise, it looks a bit awkward where the cursor position does not update while the selection is elsewhere. Note that this requires passing along the raw selection positions from `set the selection range` to the elements. Otherwise, consider what will happen if we set the selection start and end to the same value. By going through the API accessor, we hit the case where the start and end are the same value, and return the document cursor position. This would mean the cursor position would not be updated. The test changes here more closely match what Firefox produces now. It is not a 100% match; the `select event fired` test case isn't right. The problem is the event fires for the input element, but we most recently focused the textarea element. Thus, when we retrieve the selection from the input element, we return the document's cursor position, which is actually in the textarea element. The fix will ultimately be to fully implement the following: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-textarea/input-cursor That is, each input / textarea element should separately track its own text cursor position. (cherry picked from commit fd289deb44e0fc26f54a133c637c136bf0716cd5)
The implementation of setBaseAndExtent will create a new range. (cherry picked from commit 96ad310643ff90af557b9ca71db450ebd4d37ba5)
This allows for coming up with coordinates that work on macOS with a DPR of 2 more easily. (cherry picked from commit 59fe7ca8300ca64ad92e47a694ee352e8f99a1f8)
For example, if the shadow root was detached from the document in some manner, its host will be null. (cherry picked from commit 8fb2cc2be1d7a63eba7b1ae5c93e3db181ca393f)
This adds the following behavior for the DOM node/attribute editor in the Inspector: * If the user double clicks on an attribute name, the name is selected. * If the user double clicks on an attribute value, the value text (sans the surrounding quotes) is selected. * Otherwise, double clicks select the entire text range. (cherry picked from commit 7fff00972d667e7c83ed0336dc8e7f8ddbd91298)
github-actions
bot
added
the
👀 pr-needs-review
PR needs review from a maintainer or community member
label
Nov 5, 2024
github-actions
bot
removed
the
👀 pr-needs-review
PR needs review from a maintainer or community member
label
Nov 5, 2024
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
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.
LadybirdBrowser/ladybird#1205