Bug 1921180 - part 3: Make HTMLEditor use preformatted linefeeds if it's preferred r=m_kato

Currently, only the "insert line break" handler uses a preformatted linefeed
instead of `<br>` if it's better.  However, in `contenteditable="plaintext-only",
we should use preformatted linefeeds in most cases.  Therefore, we should make
them call the inserters with the `GetPreferredLineBreak` result.

Differential Revision: https://phabricator.services.mozilla.com/D231666
This commit is contained in:
Masayuki Nakano
2024-12-24 00:21:52 +00:00
parent d6a5e03fa7
commit 05da8b6db0
8 changed files with 40 additions and 433 deletions

View File

@@ -1299,6 +1299,11 @@ Result<EditActionResult, nsresult> HTMLEditor::HandleInsertText(
// We remember this so that we know how to handle tabs.
const bool isWhiteSpaceCollapsible = !EditorUtils::IsWhiteSpacePreformatted(
*pointToInsert.ContainerAs<nsIContent>());
const Maybe<LineBreakType> lineBreakType = GetPreferredLineBreakType(
*pointToInsert.ContainerAs<nsIContent>(), *editingHost);
if (NS_WARN_IF(lineBreakType.isNothing())) {
return Err(NS_ERROR_FAILURE);
}
// turn off the edit listener: we know how to
// build the "doc changed range" ourselves, and it's
@@ -1376,12 +1381,12 @@ Result<EditActionResult, nsresult> HTMLEditor::HandleInsertText(
}
MOZ_ASSERT(inclusiveNextLinefeedOffset >= 0);
Result<CreateLineBreakResult, nsresult> insertLineBreakResultOrError =
InsertLineBreak(WithTransaction::Yes, LineBreakType::BRElement,
currentPoint);
InsertLineBreak(WithTransaction::Yes, *lineBreakType, currentPoint);
if (MOZ_UNLIKELY(insertLineBreakResultOrError.isErr())) {
NS_WARNING(
"HTMLEditor::InsertLineBreak(WithTransaction::Yes, "
"LineBreakType::BRElement) failed");
NS_WARNING(nsPrintfCString("HTMLEditor::InsertLineBreak("
"WithTransaction::Yes, %s) failed",
ToString(*lineBreakType).c_str())
.get());
return insertLineBreakResultOrError.propagateErr();
}
CreateLineBreakResult insertLineBreakResult =
@@ -1451,11 +1456,13 @@ Result<EditActionResult, nsresult> HTMLEditor::HandleInsertText(
Result<CreateLineBreakResult, nsresult> insertLineBreakResultOrError =
WhiteSpaceVisibilityKeeper::InsertLineBreak(
LineBreakType::BRElement, *this, currentPoint, *editingHost);
*lineBreakType, *this, currentPoint, *editingHost);
if (MOZ_UNLIKELY(insertLineBreakResultOrError.isErr())) {
NS_WARNING(
"WhiteSpaceVisibilityKeeper::InsertLineBreak(LineBreakType::"
"BRElement) failed");
nsPrintfCString(
"WhiteSpaceVisibilityKeeper::InsertLineBreak(%s) failed",
ToString(*lineBreakType).c_str())
.get());
return insertLineBreakResultOrError.propagateErr();
}
CreateLineBreakResult insertLineBreakResult =
@@ -1477,6 +1484,10 @@ Result<EditActionResult, nsresult> HTMLEditor::HandleInsertText(
nextOffset = inclusiveNextLinefeedOffset + 1;
pointToInsert = insertLineBreakResult.AfterLineBreak<EditorDOMPoint>();
currentPoint.SetAfter(&insertLineBreakResult.LineBreakContentRef());
if (NS_WARN_IF(!pointToInsert.IsSetAndValidInComposedDoc()) ||
NS_WARN_IF(!currentPoint.IsSetAndValidInComposedDoc())) {
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
}
}
}
@@ -2580,12 +2591,9 @@ Result<EditorDOMPoint, nsresult> HTMLEditor::HandleInsertLinefeed(
pointToPutCaret = insertLinefeedResultOrError.unwrap().UnwrapCaretPoint();
}
// Insert a padding <br> element at the end of the block element if there is
// no content between the inserted linefeed and the following block boundary
// to make sure that the last line is visible.
// XXX Blink/WebKit inserts another linefeed character in this case. However,
// for doing it, we need more work, e.g., updating serializer, deleting
// unnecessary padding <br> element at modifying the last line.
// Insert a padding <br> if the inserted linefeed is followed by a block
// boundary. Note that it should always be <br> for avoiding padding line
// breaks appear in `.textContent` value.
if (pointToPutCaret.IsInContentNode() && pointToPutCaret.IsEndOfContainer()) {
WSRunScanner wsScannerAtCaret(&aEditingHost, pointToPutCaret,
BlockInlineCheck::UseComputedDisplayStyle);
@@ -2610,8 +2618,6 @@ Result<EditorDOMPoint, nsresult> HTMLEditor::HandleInsertLinefeed(
CreateLineBreakResult insertBRElementResult =
insertBRElementResultOrError.unwrap();
MOZ_ASSERT(insertBRElementResult.Handled());
// We're tracking next caret position with newCaretPosition. Therefore,
// we don't need to update selection here.
insertBRElementResult.IgnoreCaretPointSuggestion();
}
}

View File

@@ -1214,15 +1214,15 @@ class HTMLEditor final : public EditorBase,
const Element& aEditingHost);
/**
* HandleInsertLinefeed() inserts a linefeed character into aInsertToBreak.
* HandleInsertLinefeed() inserts a linefeed character into aPointToBreak.
*
* @param aInsertToBreak The point where new linefeed character will be
* @param aPointToBreak The point where new linefeed character will be
* inserted before.
* @param aEditingHost Current active editing host.
* @return A suggest point to put caret.
*/
[[nodiscard]] MOZ_CAN_RUN_SCRIPT Result<EditorDOMPoint, nsresult>
HandleInsertLinefeed(const EditorDOMPoint& aInsertToBreak,
HandleInsertLinefeed(const EditorDOMPoint& aPointToBreak,
const Element& aEditingHost);
/**

View File

@@ -3639,14 +3639,24 @@ nsresult WhiteSpaceVisibilityKeeper::NormalizeVisibleWhiteSpacesAt(
// the beginning of soft wrapped lines, and lets the user see 2 spaces
// when they type 2 spaces.
if (NS_WARN_IF(!atEndOfVisibleWhiteSpaces.IsInContentNode())) {
return Err(NS_ERROR_FAILURE);
}
const Maybe<LineBreakType> lineBreakType =
aHTMLEditor.GetPreferredLineBreakType(
*atEndOfVisibleWhiteSpaces.ContainerAs<nsIContent>(),
aEditingHost);
if (NS_WARN_IF(lineBreakType.isNothing())) {
return Err(NS_ERROR_FAILURE);
}
Result<CreateLineBreakResult, nsresult> insertBRElementResultOrError =
aHTMLEditor.InsertLineBreak(WithTransaction::Yes,
HTMLEditor::LineBreakType::BRElement,
aHTMLEditor.InsertLineBreak(WithTransaction::Yes, *lineBreakType,
atEndOfVisibleWhiteSpaces);
if (MOZ_UNLIKELY(insertBRElementResultOrError.isErr())) {
NS_WARNING(
"HTMLEditor::InsertLineBreak(WithTransaction::Yes, "
"LineBreakType::BRElement) failed");
NS_WARNING(nsPrintfCString("HTMLEditor::InsertLineBreak("
"WithTransaction::Yes, %s) failed",
ToString(*lineBreakType).c_str())
.get());
return insertBRElementResultOrError.propagateErr();
}
CreateLineBreakResult insertBRElementResult =

View File

@@ -1,22 +1,10 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-wrap&display=inline-block&command=insertText]
[<span contenteditable style="display:inline-block; white-space:pre-wrap">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-wrap"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-wrap"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-wrap"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-wrap"><span style="white-space:normal"><span style="white-space:pre-wrap">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=normal&display=inline-block&command=insertParagraph]
[<span contenteditable style="display:inline-block; white-space:normal"><span style="display:block;white-space:normal">a[\]b</span></span>]
@@ -27,24 +15,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-wrap&display=inline&command=insertText]
[<span contenteditable style="display:inline; white-space:pre-wrap">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-wrap"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-wrap"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-wrap"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-wrap"><span style="white-space:normal"><span style="white-space:pre-wrap">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=normal&display=inline&command=insertText]
[<span contenteditable style="display:inline; white-space:normal"><span style="display:block;white-space:normal">a[\]b</span></span>]
@@ -58,64 +34,28 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-wrap&display=block&command=insertText]
[<span contenteditable style="display:block; white-space:pre-wrap">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-wrap"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-wrap"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-wrap"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-wrap"><span style="white-space:normal"><span style="white-space:pre-wrap">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre&display=inline-block&command=insertText]
[<p contenteditable style="display:inline-block; white-space:pre">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre"><span style="white-space:normal"><span style="white-space:pre">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre&display=inline&command=insertText]
[<p contenteditable style="display:inline; white-space:pre">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre"><span style="white-space:normal"><span style="white-space:pre">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-line&display=inline-block&command=insertParagraph]
[<p contenteditable style="display:inline-block; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -123,24 +63,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-line&display=block&command=insertText]
[<span contenteditable style="display:block; white-space:pre-line">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-line"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-line"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-line"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre-line"><span style="white-space:normal"><span style="white-space:pre-line">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-wrap&display=inline-block&command=insertParagraph]
[<span contenteditable style="display:inline-block; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></span>]
@@ -169,24 +97,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre&display=inline&command=insertText]
[<span contenteditable style="display:inline; white-space:pre">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre"><span style="white-space:normal"><span style="white-space:pre">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=normal&display=inline-block&command=insertText]
[<p contenteditable style="display:inline-block; white-space:normal"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -205,64 +121,28 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-line&display=block&command=insertText]
[<p contenteditable style="display:block; white-space:pre-line">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-line"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-line"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-line"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-line"><span style="white-space:normal"><span style="white-space:pre-line">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-line&display=inline&command=insertText]
[<p contenteditable style="display:inline; white-space:pre-line">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-line"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-line"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-line"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-line"><span style="white-space:normal"><span style="white-space:pre-line">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-line&display=inline-block&command=insertText]
[<p contenteditable style="display:inline-block; white-space:pre-line">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-line"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-line"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-line"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-line"><span style="white-space:normal"><span style="white-space:pre-line">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=normal&display=inline-block&command=insertParagraph]
[<p contenteditable style="display:inline-block; white-space:normal"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -302,24 +182,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-wrap&display=block&command=insertText]
[<p contenteditable style="display:block; white-space:pre-wrap">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-wrap"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-wrap"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-wrap"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre-wrap"><span style="white-space:normal"><span style="white-space:pre-wrap">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-line&display=inline-block&command=insertParagraph]
[<span contenteditable style="display:inline-block; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></span>]
@@ -327,24 +195,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-line&display=inline-block&command=insertText]
[<span contenteditable style="display:inline-block; white-space:pre-line">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-line"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-line"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-line"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre-line"><span style="white-space:normal"><span style="white-space:pre-line">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-wrap&display=inline-block&command=insertParagraph]
[<p contenteditable style="display:inline-block; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -362,24 +218,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre&display=block&command=insertText]
[<p contenteditable style="display:block; white-space:pre">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:block; white-space:pre"><span style="white-space:normal"><span style="white-space:pre">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-line&display=inline&command=insertParagraph]
[<p contenteditable style="display:inline; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -387,24 +231,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre&display=inline-block&command=insertText]
[<span contenteditable style="display:inline-block; white-space:pre">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline-block; white-space:pre"><span style="white-space:normal"><span style="white-space:pre">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre&display=inline&command=insertParagraph]
[<p contenteditable style="display:inline; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -428,24 +260,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre-line&display=inline&command=insertText]
[<span contenteditable style="display:inline; white-space:pre-line">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-line"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-line"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-line"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-line"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:inline; white-space:pre-line"><span style="white-space:normal"><span style="white-space:pre-line">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=normal&display=block&command=insertText]
[<p contenteditable style="display:block; white-space:normal"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -459,24 +279,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-wrap&display=inline&command=insertText]
[<p contenteditable style="display:inline; white-space:pre-wrap">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-wrap"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-wrap"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-wrap"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline; white-space:pre-wrap"><span style="white-space:normal"><span style="white-space:pre-wrap">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=normal&display=inline&command=insertParagraph]
[<p contenteditable style="display:inline; white-space:normal"><span style="display:block;white-space:normal">a[\]b</span></p>]
@@ -497,24 +305,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre-wrap&display=inline-block&command=insertText]
[<p contenteditable style="display:inline-block; white-space:pre-wrap">a[\]b</p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-wrap"><span style="display:block;white-space:normal">a[\]b</span></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-wrap"><div>a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-wrap"><div style="display:inline">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-wrap"><div style="display:inline-block">a[\]b</div></p>]
expected: FAIL
[<p contenteditable style="display:inline-block; white-space:pre-wrap"><span style="white-space:normal"><span style="white-space:pre-wrap">a[\]b</span></span></p>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre&display=inline&command=insertParagraph]
[<span contenteditable style="display:inline; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></span>]
@@ -538,24 +334,12 @@
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=span&white-space=pre&display=block&command=insertText]
[<span contenteditable style="display:block; white-space:pre">a[\]b</span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre"><div>a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre"><div style="display:inline">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre"><div style="display:inline-block">a[\]b</div></span>]
expected: FAIL
[<span contenteditable style="display:block; white-space:pre"><span style="white-space:normal"><span style="white-space:pre">a[\]b</span></span></span>]
expected: FAIL
[insertparagraph-in-editing-host-cannot-have-div.tentative.html?host=p&white-space=pre&display=block&command=insertParagraph]
[<p contenteditable style="display:block; white-space:pre"><span style="display:block;white-space:normal">a[\]b</span></p>]

View File

@@ -407,18 +407,9 @@
[<div contenteditable style="white-space:pre-line; display:inline">abc[\]</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline">[\]abc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline">a[\]bc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline">abc[\]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline"><b>abc[\]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline"><div style="white-space:pre-line">abc[\]</div></div> (defaultParagraphSeparator: div)]
expected: FAIL
@@ -476,18 +467,9 @@
[<div contenteditable style="white-space:pre-line; display:inline-block">abc[\]</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block">[\]abc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block">a[\]bc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block">abc[\]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block"><b>abc[\]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline-block"><div style="white-space:pre-line">abc[\]</div></div> (defaultParagraphSeparator: div)]
expected: FAIL
@@ -614,18 +596,9 @@
[<div contenteditable style="white-space:pre-line; display:inline">abc[\]</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline">[\]abc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline">a[\]bc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline">abc[\]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline"><b>abc[\]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline"><div style="white-space:pre-line">abc[\]</div></div> (defaultParagraphSeparator: p)]
expected: FAIL
@@ -683,18 +656,9 @@
[<div contenteditable style="white-space:pre-line; display:inline-block">abc[\]</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block">[\]abc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block">a[\]bc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block">abc[\]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-line; display:inline-block"><b>abc[\]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline-block"><div style="white-space:pre-line">abc[\]</div></div> (defaultParagraphSeparator: p)]
expected: FAIL
@@ -1195,18 +1159,9 @@
[<div contenteditable style="white-space:pre-wrap; display:inline">abc[\]</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline">[\]abc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline">a[\]bc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline">abc[\]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline"><b>abc[\]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline"><div style="white-space:pre-wrap">abc[\]</div></div> (defaultParagraphSeparator: div)]
expected: FAIL
@@ -1264,18 +1219,9 @@
[<div contenteditable style="white-space:pre-wrap; display:inline-block">abc[\]</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block">[\]abc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block">a[\]bc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block">abc[\]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block"><b>abc[\]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline-block"><div style="white-space:pre-wrap">abc[\]</div></div> (defaultParagraphSeparator: div)]
expected: FAIL
@@ -1402,18 +1348,9 @@
[<div contenteditable style="white-space:pre-wrap; display:inline">abc[\]</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline">[\]abc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline">a[\]bc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline">abc[\]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline"><b>abc[\]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline"><div style="white-space:pre-wrap">abc[\]</div></div> (defaultParagraphSeparator: p)]
expected: FAIL
@@ -1471,18 +1408,9 @@
[<div contenteditable style="white-space:pre-wrap; display:inline-block">abc[\]</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block">[\]abc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block">a[\]bc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block">abc[\]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre-wrap; display:inline-block"><b>abc[\]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline-block"><div style="white-space:pre-wrap">abc[\]</div></div> (defaultParagraphSeparator: p)]
expected: FAIL
@@ -1611,18 +1539,9 @@
[<div contenteditable style="white-space:pre; display:inline">abc[\]</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline">[\]abc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline">a[\]bc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline">abc[\]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline"><b>abc[\]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline"><div style="white-space:pre">abc[\]</div></div> (defaultParagraphSeparator: div)]
expected: FAIL
@@ -1680,18 +1599,9 @@
[<div contenteditable style="white-space:pre; display:inline-block">abc[\]</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block">[\]abc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block">a[\]bc</div> (defaultParagraphSeparator: div)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block">abc[\]</div> (defaultParagraphSeparator: div) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block"><b>abc[\]</b></div> (defaultParagraphSeparator: div) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline-block"><div style="white-space:pre">abc[\]</div></div> (defaultParagraphSeparator: div)]
expected: FAIL
@@ -1818,18 +1728,9 @@
[<div contenteditable style="white-space:pre; display:inline">abc[\]</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline">[\]abc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline">a[\]bc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline">abc[\]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline"><b>abc[\]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline"><div style="white-space:pre">abc[\]</div></div> (defaultParagraphSeparator: p)]
expected: FAIL
@@ -1887,18 +1788,9 @@
[<div contenteditable style="white-space:pre; display:inline-block">abc[\]</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block">[\]abc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block">a[\]bc</div> (defaultParagraphSeparator: p)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block">abc[\]</div> (defaultParagraphSeparator: p) (preserving temporary inline style test)]
expected: FAIL
[<div contenteditable style="white-space:pre; display:inline-block"><b>abc[\]</b></div> (defaultParagraphSeparator: p) (preserving inline style test)]
expected: FAIL
[<div contenteditable style="display:inline-block"><div style="white-space:pre">abc[\]</div></div> (defaultParagraphSeparator: p)]
expected: FAIL

View File

@@ -1,43 +0,0 @@
[insertHTML.html?white-space=pre]
[execCommand("insertHTML", false, "<pre>1st line\n2nd line</pre>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc<br>def</div>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc</div><div>def</div>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc<br>def</div><div>ghi<br>jkl</div>") when ""]
expected: FAIL
[insertHTML.html?white-space=pre-line]
[execCommand("insertHTML", false, "<pre>1st line\n2nd line</pre>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc<br>def</div>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc</div><div>def</div>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc<br>def</div><div>ghi<br>jkl</div>") when ""]
expected: FAIL
[insertHTML.html?white-space=pre-wrap]
[execCommand("insertHTML", false, "<pre>1st line\n2nd line</pre>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc<br>def</div>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc</div><div>def</div>") when ""]
expected: FAIL
[execCommand("insertHTML", false, "<div>abc<br>def</div><div>ghi<br>jkl</div>") when ""]
expected: FAIL
[insertHTML.html?white-space=normal]

View File

@@ -1,33 +0,0 @@
[paste.https.html?white-space=pre-line]
[Pasting 2 paragraphs: pasted result]
expected: FAIL
[Pasting 2 paragraphs into <b>: pasted result]
expected: FAIL
[Pasting 2 paragraphs whose text is bold: pasted result]
expected: FAIL
[paste.https.html?white-space=normal]
[paste.https.html?white-space=pre]
[Pasting 2 paragraphs: pasted result]
expected: FAIL
[Pasting 2 paragraphs into <b>: pasted result]
expected: FAIL
[Pasting 2 paragraphs whose text is bold: pasted result]
expected: FAIL
[paste.https.html?white-space=pre-wrap]
[Pasting 2 paragraphs: pasted result]
expected: FAIL
[Pasting 2 paragraphs into <b>: pasted result]
expected: FAIL
[Pasting 2 paragraphs whose text is bold: pasted result]
expected: FAIL

View File

@@ -3,18 +3,12 @@
[Pasting without format: beforeinput]
expected: FAIL
[Pasting as quotation: pasted result]
expected: FAIL
[special-paste.html?white-space=pre]
prefs: [middlemouse.paste:true, general.autoScroll:false, middlemouse.contentLoadURL:false]
[Pasting without format: beforeinput]
expected: FAIL
[Pasting as quotation: pasted result]
expected: FAIL
[special-paste.html?white-space=normal]
prefs: [middlemouse.paste:true, general.autoScroll:false, middlemouse.contentLoadURL:false]
@@ -26,6 +20,3 @@
prefs: [middlemouse.paste:true, general.autoScroll:false, middlemouse.contentLoadURL:false]
[Pasting without format: beforeinput]
expected: FAIL
[Pasting as quotation: pasted result]
expected: FAIL