From c0ff725be31c2a376e160c408a7327cb578f14ed Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 30 Jan 2024 14:37:33 +0000 Subject: [PATCH] part 2: Make `HTMLEditor::FormatBlockContainerWithTransaction` refer the computed style when considering the wrapping part In bug 1851951, I considered that the method should keep the traditional behavior for the backward compatibility because of mainly used by handling a block level command, `formatBlock`, but I think that computing the replacing part should be considered with the computed style of the elements. That's compatible with the other browsers. Depends on D199844 Differential Revision: https://phabricator.services.mozilla.com/D199845 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1876913 gecko-commit: 505443c66b747ccc1247f4eeb960681204fd2ac7 gecko-reviewers: m_kato --- editing/data/formatblock.js | 6 ++++++ editing/data/insertparagraph.js | 15 +++++++++++++++ editing/run/formatblock.html | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/editing/data/formatblock.js b/editing/data/formatblock.js index bd559b3003686d..5cc040b1f13b10 100644 --- a/editing/data/formatblock.js +++ b/editing/data/formatblock.js @@ -1886,4 +1886,10 @@ var browserTests = [ "
[foo]
", //
can have
, so, wrap it with
[true], {"formatblock":[false,false,"",false,false,"div"]}], + +["abc[def]ghi", + [["formatblock","div"]], + "abc
def
ghi", + [true], + {"formatblock":[false,false,"",false,false,"div"]}], ] diff --git a/editing/data/insertparagraph.js b/editing/data/insertparagraph.js index d05f7415cefb5b..0dace0105c3963 100644 --- a/editing/data/insertparagraph.js +++ b/editing/data/insertparagraph.js @@ -2558,4 +2558,19 @@ var browserTests = [ "foo


barbaz
qux

"], [true,true], {}], + +// Inserting paragraph before
followed by a blocked should cause +// inserting an empty paragraph to start of the editing host at least. +["{}
abc
def
", + [["defaultparagraphseparator","div"],["insertparagraph",""]], + ["


abc
def
", + "


abc
def
"], + [true,true], + {}], +["{}
abc
def
", + [["defaultparagraphseparator","p"],["insertparagraph",""]], + ["



abc
def
", + "



abc
def
"], + [true,true], + {}], ] diff --git a/editing/run/formatblock.html b/editing/run/formatblock.html index f15f2c03dacd22..03b5a6512737b5 100644 --- a/editing/run/formatblock.html +++ b/editing/run/formatblock.html @@ -5,7 +5,8 @@ - + + formatblock - HTML editing conformance tests