Skip to content

Truly independent web browser

LibWeb: Keep inline formatting in the empty line made by insertParagraph

Andreas Kling232c55a5948a
diff --git a/Libraries/LibWeb/Editing/Commands.cpp b/Libraries/LibWeb/Editing/Commands.cpp
index 21b14113ab4..9144e1837b8 100644
--- a/Libraries/LibWeb/Editing/Commands.cpp
+++ b/Libraries/LibWeb/Editing/Commands.cpp
@@ -1741,6 +1741,37 @@ bool command_insert_paragraph_action(DOM::Document& document, Utf16View)
// length of container).
auto new_line_range = DOM::Range::create(active_range->start_container(), active_range->start_offset(), *container, container->length());
+ // INTEROP: Browsers keep the inline formatting of the caret in a line that the split leaves empty. They give it
+ // clones of the inline ancestors of the caret that change its formatting, with its line break inside
+ // them. They do not do this if the caret is in a link. Collect these ancestors here, before the split
+ // moves the caret.
+ Vector<GC::Ref<DOM::Element>> inline_ancestors_to_clone;
+ for (GC::Ptr<DOM::Node> ancestor = active_range->start_container(); ancestor && ancestor != container; ancestor = ancestor->parent()) {
+ if (is<HTML::HTMLAnchorElement>(*ancestor)) {
+ inline_ancestors_to_clone.clear();
+ break;
+ }
+ auto* element = as_if<HTML::HTMLElement>(*ancestor);
+ if (element && is_inline_node(*element) && element_changes_formatting(*element))
+ inline_ancestors_to_clone.prepend(*element);
+ }
+ auto append_line_break = [&](DOM::Node& parent, GC::Ptr<DOM::Node> line_break) -> GC::Ref<DOM::Node> {
+ GC::Ref<DOM::Node> innermost = parent;
+ for (auto ancestor : inline_ancestors_to_clone) {
+ auto clone = MUST(clone_node_for_editing(ancestor, false));
+ if (auto* clone_element = as_if<DOM::Element>(*clone)) {
+ EditingHistory::ProxyMutationScope mutation_scope { *clone };
+ clone_element->remove_attribute(HTML::AttributeNames::id);
+ }
+ MUST(append_node(clone, innermost));
+ innermost = clone;
+ }
+ if (!line_break)
+ line_break = MUST(DOM::create_element(document, HTML::TagNames::br, Namespace::HTML));
+ MUST(append_node(*line_break, innermost));
+ return innermost;
+ };
+
// 15. While new line range's start offset is zero and its start node is not a prohibited paragraph child, set its
// start to (parent of start node, index of start node).
GC::Ptr<DOM::Node> start_container = new_line_range->start_container();
@@ -1866,16 +1897,22 @@ bool command_insert_paragraph_action(DOM::Document& document, Utf16View)
// 32. If container has no visible children, call createElement("br") on the context object, and append the result
// as the last child of container.
+ // NB: See the INTEROP note at step 14 for the inline ancestors that the br is placed in.
if (!has_visible_children(*container))
- MUST(append_node(MUST(DOM::create_element(document, HTML::TagNames::br, Namespace::HTML)), *container));
+ append_line_break(*container, {});
// 33. If new container has no visible children, call createElement("br") on the context object, and append the
// result as the last child of new container.
- if (!has_visible_children(*new_container))
- MUST(append_node(MUST(DOM::create_element(document, HTML::TagNames::br, Namespace::HTML)), *new_container));
+ // NB: See the INTEROP note at step 14 for the inline ancestors that the br is placed in. If new container only
+ // contains the br that ended the line, that br is moved into them.
+ GC::Ref<DOM::Node> caret_container = *new_container;
+ auto only_child_is_line_break = !inline_ancestors_to_clone.is_empty() && new_container->child_count() == 1
+ && is<HTML::HTMLBRElement>(new_container->first_child());
+ if (!has_visible_children(*new_container) || (end_of_line && only_child_is_line_break))
+ caret_container = append_line_break(*new_container, only_child_is_line_break ? new_container->first_child() : nullptr);
// 34. Call collapse(new container, 0) on the context object's selection.
- MUST(document.get_selection()->collapse(new_container, 0));
+ MUST(document.get_selection()->collapse(caret_container, 0));
// 35. Return true
return true;
diff --git a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp
index 2eb1a372c41..a203752e027 100644
--- a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp
+++ b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp
@@ -956,7 +956,7 @@ static bool white_space_is_from_default_style(GC::Ref<DOM::Node> node)
// Whether element gives its children formatting that its parent does not, as one of the command values that are
// recorded by "record the values of nodes".
-static bool element_changes_formatting(DOM::Element& element)
+bool element_changes_formatting(DOM::Element& element)
{
Array const commands = { CommandNames::subscript, CommandNames::bold, CommandNames::fontName,
CommandNames::fontSize, CommandNames::foreColor, CommandNames::hiliteColor, CommandNames::italic,
diff --git a/Libraries/LibWeb/Editing/Internal/Algorithms.h b/Libraries/LibWeb/Editing/Internal/Algorithms.h
index 710f0d51e5a..08ebed00b82 100644
--- a/Libraries/LibWeb/Editing/Internal/Algorithms.h
+++ b/Libraries/LibWeb/Editing/Internal/Algorithms.h
@@ -56,6 +56,7 @@ void autolink(DOM::BoundaryPoint);
GC::Ref<DOM::Range> block_extend_a_range(GC::Ref<DOM::Range>);
GC::Ptr<DOM::Node> block_node_of_node(GC::Ref<DOM::Node>);
bool editing_ignores_content(DOM::Node const&);
+bool element_changes_formatting(DOM::Element&);
DOM::BoundaryPoint end_boundary_of_node(GC::Ref<DOM::Node>);
Utf16String canonical_space_sequence(size_t length, bool non_breaking_start, bool non_breaking_end);
void canonicalize_collapsed_selection_for_editing(Selection&);
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertParagraph.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertParagraph.txt
index 274d42b6a8f..3f222f2d9af 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertParagraph.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertParagraph.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-112 Pass
-26 Fail
+114 Pass
+24 Fail
Pass <div contenteditable style="white-space:nowrap; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:nowrap; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:nowrap; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:nowrap; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:nowrap; display:block">abc[]</div>
Pass <div contenteditable style="white-space:nowrap; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:nowrap; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:nowrap; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertText.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertText.txt
index 68b7bdbae7c..d6067347868 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertText.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=nowrap&command=insertText.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-106 Pass
-32 Fail
+108 Pass
+30 Fail
Pass <div contenteditable style="white-space:nowrap; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:nowrap; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:nowrap; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Fail <div contenteditable style="white-space:nowrap; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:nowrap; display:block">abc[]</div>
Pass <div contenteditable style="white-space:nowrap; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:nowrap; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Fail <div contenteditable style="white-space:nowrap; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:nowrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:nowrap">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertParagraph.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertParagraph.txt
index 4268a7062cc..9845ff2d7a4 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertParagraph.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertParagraph.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-112 Pass
-26 Fail
+114 Pass
+24 Fail
Pass <div contenteditable style="white-space:pre; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:pre; display:block">abc[]</div> (de
Pass <div contenteditable style="white-space:pre; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertText.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertText.txt
index 0add3c1ee1c..bff0bffd9d3 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertText.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre&command=insertText.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-106 Pass
-32 Fail
+108 Pass
+30 Fail
Pass <div contenteditable style="white-space:pre; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Fail <div contenteditable style="white-space:pre; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:pre; display:block">abc[]</div> (de
Pass <div contenteditable style="white-space:pre; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Fail <div contenteditable style="white-space:pre; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertParagraph.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertParagraph.txt
index 3bc8a1ff1eb..182debbd3e8 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertParagraph.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertParagraph.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-112 Pass
-26 Fail
+114 Pass
+24 Fail
Pass <div contenteditable style="white-space:pre-line; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-line; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-line; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-line; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:pre-line; display:block">abc[]</div
Pass <div contenteditable style="white-space:pre-line; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre-line; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre-line; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertText.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertText.txt
index 2f79afc2abb..e545d1640bb 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertText.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-line&command=insertText.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-106 Pass
-32 Fail
+108 Pass
+30 Fail
Pass <div contenteditable style="white-space:pre-line; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-line; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-line; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Fail <div contenteditable style="white-space:pre-line; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:pre-line; display:block">abc[]</div
Pass <div contenteditable style="white-space:pre-line; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre-line; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Fail <div contenteditable style="white-space:pre-line; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-line; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-line">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertParagraph.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertParagraph.txt
index 0dc69917aee..ede724da156 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertParagraph.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertParagraph.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-112 Pass
-26 Fail
+114 Pass
+24 Fail
Pass <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-wrap; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-wrap; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div
Pass <div contenteditable style="white-space:pre-wrap; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre-wrap; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertText.txt b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertText.txt
index 3177f9607a5..3d9508bee9e 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertText.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/other/insertparagraph-with-white-space-style.tentative@white-space=pre-wrap&command=insertText.txt
@@ -2,13 +2,13 @@ Harness status: OK
Found 138 tests
-106 Pass
-32 Fail
+108 Pass
+30 Fail
Pass <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-wrap; display:block">[]abc</div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="white-space:pre-wrap; display:block">a[]bc</div> (defaultParagraphSeparator: div)
Fail <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">abc[]</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">[]abc</div></div> (defaultParagraphSeparator: div)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">a[]bc</div></div> (defaultParagraphSeparator: div)
@@ -77,7 +77,7 @@ Pass <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div
Pass <div contenteditable style="white-space:pre-wrap; display:block">[]abc</div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="white-space:pre-wrap; display:block">a[]bc</div> (defaultParagraphSeparator: p)
Fail <div contenteditable style="white-space:pre-wrap; display:block">abc[]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)
-Fail <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
+Pass <div contenteditable style="white-space:pre-wrap; display:block"><b>abc[]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">abc[]</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">[]abc</div></div> (defaultParagraphSeparator: p)
Pass <div contenteditable style="display:block"><div style="white-space:pre-wrap">a[]bc</div></div> (defaultParagraphSeparator: p)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected] b/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected]
index 98d1d9aa38d..de23f08e2d4 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected]
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected]
@@ -2,8 +2,8 @@ Harness status: OK
Found 1000 tests
-985 Pass
-15 Fail
+997 Pass
+3 Fail
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<blockquote><p>foo[]<p>bar</blockquote>" checks for modifications to non-editable content
Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<blockquote><p>foo[]<p>bar</blockquote>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<blockquote><p>foo[]<p>bar</blockquote>" queryCommandIndeterm("defaultparagraphseparator") before
@@ -349,7 +349,7 @@ Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<b>foo[]</b>bar
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</b></p>" queryCommandValue("defaultparagraphseparator") before
@@ -365,7 +365,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>foo[]</
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>": execCommand("defaultparagraphseparator", false, "p") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>" compare innerHTML
+Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>" compare innerHTML
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</b></div>" queryCommandValue("defaultparagraphseparator") before
@@ -381,7 +381,7 @@ Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>foo[]</
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[]</i></b></p>" queryCommandValue("defaultparagraphseparator") before
@@ -397,7 +397,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>foo[
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>": execCommand("defaultparagraphseparator", false, "p") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>" compare innerHTML
+Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>" compare innerHTML
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[]</i></b></div>" queryCommandValue("defaultparagraphseparator") before
@@ -413,7 +413,7 @@ Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>foo[
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[]</b></i></p>" queryCommandValue("defaultparagraphseparator") before
@@ -429,7 +429,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>foo[
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>": execCommand("defaultparagraphseparator", false, "p") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>" compare innerHTML
+Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>" compare innerHTML
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>foo[]</b></i></div>" queryCommandValue("defaultparagraphseparator") before
@@ -477,7 +477,7 @@ Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "foo<b>[]bar</b>
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</b></p>" queryCommandValue("defaultparagraphseparator") before
@@ -493,7 +493,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b>[]foo</
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>": execCommand("defaultparagraphseparator", false, "p") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>" compare innerHTML
+Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>" compare innerHTML
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</b></div>" queryCommandValue("defaultparagraphseparator") before
@@ -509,7 +509,7 @@ Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b>[]foo</
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]foo</i></b></p>" queryCommandValue("defaultparagraphseparator") before
@@ -525,7 +525,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><b><i>[]fo
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>": execCommand("defaultparagraphseparator", false, "p") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>" compare innerHTML
+Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>" compare innerHTML
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]foo</i></b></div>" queryCommandValue("defaultparagraphseparator") before
@@ -541,7 +541,7 @@ Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><b><i>[]fo
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]foo</b></i></p>" queryCommandValue("defaultparagraphseparator") before
@@ -557,7 +557,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<p><i><b>[]fo
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>": execCommand("defaultparagraphseparator", false, "p") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>" compare innerHTML
+Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>" compare innerHTML
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>" queryCommandIndeterm("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>" queryCommandState("defaultparagraphseparator") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div><i><b>[]foo</b></i></div>" queryCommandValue("defaultparagraphseparator") before
diff --git a/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected] b/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected]
index 3f9c4043b52..30aba70ead0 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected]
+++ b/Tests/LibWeb/Text/expected/wpt-import/editing/run/[email protected]
@@ -2,8 +2,8 @@ Harness status: OK
Found 1000 tests
-954 Pass
-46 Fail
+960 Pass
+40 Fail
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div class=a id=x><div class=b id=y>[]foo</div></div>" queryCommandIndeterm("insertparagraph") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div class=a id=x><div class=b id=y>[]foo</div></div>" queryCommandState("insertparagraph") before
Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<div class=a id=x><div class=b id=y>[]foo</div></div>" queryCommandValue("insertparagraph") before
@@ -772,7 +772,7 @@ Pass [["defaultparagraphseparator","p"],["insertparagraph",""]] "<h3>[abc]</h3><
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>" queryCommandIndeterm("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>" queryCommandState("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\">foo[]</span></div>" queryCommandValue("insertparagraph") before
@@ -782,7 +782,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span st
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>" queryCommandIndeterm("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>" queryCommandState("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></div>" queryCommandValue("insertparagraph") before
@@ -792,7 +792,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span st
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>" queryCommandIndeterm("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>" queryCommandState("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></div>" queryCommandValue("insertparagraph") before
@@ -872,7 +872,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<div><span st
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>" queryCommandIndeterm("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>" queryCommandState("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\">foo[]</span></li></ul>" queryCommandValue("insertparagraph") before
@@ -882,7 +882,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>" queryCommandIndeterm("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>" queryCommandState("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></li></ul>" queryCommandValue("insertparagraph") before
@@ -892,7 +892,7 @@ Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>": execCommand("defaultparagraphseparator", false, "div") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>": execCommand("insertparagraph", false, "") return value
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>" checks for modifications to non-editable content
-Fail [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>" compare innerHTML
+Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>" compare innerHTML
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>" queryCommandIndeterm("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>" queryCommandState("insertparagraph") before
Pass [["defaultparagraphseparator","div"],["insertparagraph",""]] "<ul><li><span style=\"color:rgb(0, 0, 255)\"><span style=\"background-color:rgb(0, 0, 255)\">foo[]</span></span></li></ul>" queryCommandValue("insertparagraph") before