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

LibWeb: Implement most of the Editing API commands #3216

Merged

Conversation

gmta
Copy link
Collaborator

@gmta gmta commented Jan 10, 2025

Almost all commands in the spec are implemented, save for undo/redo and the clipboard commands.

Results in ~16.5k additional WPT passes.

Some of the functionalities can be tested here, although the modal input dialogs crash for some reason:
https://codepen.io/chrisdavidmills/full/gzYjag/

gmta added 30 commits January 10, 2025 16:18
This makes it more consistent with the other signatures.
Commit 98df4c2 changes the node argument to a GC::Ref<DOM::Node>, but
not all usages were updated accordingly.
The spec calls it a "node list", not "nodes".
This centralizes the logic for iterating over a Range's contained nodes.
Allows for easy iteration over the chain of ancestors for a node.
This prevents some unnecessary casting to DOM::Element.
If we are to insert nodes _before_ the original parent, we need to
insert them at the original parent's index, not the index before that.
This makes some of the spec implementations easier to follow and makes
it extra clear that the range is optional.
The associated spec was only partially implemented.
@gmta gmta requested a review from AtkinsSJ as a code owner January 10, 2025 16:09
@awesomekling awesomekling merged commit 98ec182 into LadybirdBrowser:master Jan 10, 2025
8 checks passed
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 this pull request may close these issues.

2 participants