mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Assign new wrapped node list to container for insertParagraph
Forgot to implement this part of the spec.
This commit is contained in:
parent
c56f7d9cde
commit
d424dc1b32
Notes:
github-actions[bot]
2025-05-07 14:12:28 +00:00
Author: https://github.com/gmta
Commit: d424dc1b32
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4633
1 changed files with 5 additions and 1 deletions
|
@ -1546,10 +1546,14 @@ bool command_insert_paragraph_action(DOM::Document& document, String const&)
|
|||
|
||||
// 7. Wrap node list, with sibling criteria returning false and new parent instructions returning the result of
|
||||
// calling createElement(tag) on the context object. Set container to the result.
|
||||
wrap(
|
||||
// AD-HOC: wrap() does not always return something, but the rest of this algorithm expects it to be a valid
|
||||
// node. Therefore, we only change the container if we successfully wrapped the node list.
|
||||
auto new_container = wrap(
|
||||
node_list,
|
||||
[](auto) { return false; },
|
||||
[&] { return MUST(DOM::create_element(document, tag, Namespace::HTML)); });
|
||||
if (new_container)
|
||||
container = new_container;
|
||||
}
|
||||
|
||||
// 12. If container's local name is "address", "listing", or "pre":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue