diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js index d52f3f6c7bbd..55eb5da08a2f 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js +++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/FrameIndent.js @@ -6,6 +6,8 @@ import React from "react"; export default function FrameIndent() { return ( - + +      + ); } diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css index ec5da2230847..5f57f97e5174 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css +++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frames.css @@ -150,10 +150,6 @@ left: -9999px; } -.frames .frame-indent { - white-space: pre; -} - .call-stack-pane [role="listitem"] .location-async-cause { height: 20px; line-height: 20px; diff --git a/devtools/client/inspector/computed/test/browser_computed_select-and-copy-styles-02.js b/devtools/client/inspector/computed/test/browser_computed_select-and-copy-styles-02.js index 99c3bdc0b91c..8df2e25cf41f 100644 --- a/devtools/client/inspector/computed/test/browser_computed_select-and-copy-styles-02.js +++ b/devtools/client/inspector/computed/test/browser_computed_select-and-copy-styles-02.js @@ -20,11 +20,11 @@ add_task(async function() { expectedPattern = "text-align: left;[\\r\\n]+" + "element[\\r\\n]+" + - "Best Match this.style[\\r\\n]+" + + "Best Match this.style[\\r\\n]+" + "left[\\r\\n]+" + "width: 25px;[\\r\\n]+" + "element[\\r\\n]+" + - "Best Match this.style[\\r\\n]+" + + "Best Match this.style[\\r\\n]+" + "25px[\\r\\n]*"; info("Expanding computed view properties"); diff --git a/devtools/client/shared/components/SmartTrace.css b/devtools/client/shared/components/SmartTrace.css index 320869fb2835..270d38949cf6 100644 --- a/devtools/client/shared/components/SmartTrace.css +++ b/devtools/client/shared/components/SmartTrace.css @@ -30,10 +30,6 @@ white-space: normal; } -.frames .frame-indent { - white-space: pre; -} - .frames .title { text-overflow: ellipsis; white-space: nowrap; diff --git a/dom/base/test/test_bug650784.html b/dom/base/test/test_bug650784.html index 368b96acb2f9..aacc3428993c 100644 --- a/dom/base/test/test_bug650784.html +++ b/dom/base/test/test_bug650784.html @@ -23,8 +23,8 @@ is(s.convertToPlainText("foo", c.OutputLFLineBreak, 0), "foo", "Wrong conversion is(s.convertToPlainText("foo foo foo", c.OutputWrap | c.OutputLFLineBreak, 7), "foo foo\nfoo", "Wrong conversion result 2"); is(s.convertToPlainText("foo", c.OutputLFLineBreak, 0), "foo", "Wrong conversion result 3"); is(s.convertToPlainText("foo", c.OutputNoScriptContent, 0), "barfoo", "Wrong conversion result 4"); -is(s.convertToPlainText("foo\u00A0 bar", c.OutputPersistNBSP | c.OutputLFLineBreak, 0), "foo\u00A0 bar", "Wrong conversion result 5"); -is(s.convertToPlainText("foo\u00A0 bar", c.OutputLFLineBreak, 0), "foo bar", "Wrong conversion result 6"); +is(s.convertToPlainText("foo\u00A0bar", c.OutputPersistNBSP | c.OutputLFLineBreak, 0), "foo\u00A0bar", "Wrong conversion result 5"); +is(s.convertToPlainText("foo\u00A0bar", c.OutputLFLineBreak, 0), "foo bar", "Wrong conversion result 6"); is(s.convertToPlainText("barfoo", c.OutputLFLineBreak, 0), "foo", "Wrong conversion result 7"); // OutputNoFramesContent doesn't actually work, because the flag gets overridden in all cases. is(s.convertToPlainText("barfoo", c.OutputNoFramesContent | c.OutputLFLineBreak, 0), "foo", "Wrong conversion result 8"); diff --git a/dom/base/test/test_clipboard_nbsp.html b/dom/base/test/test_clipboard_nbsp.html index ea8658ea8b3a..93d60934bec8 100644 --- a/dom/base/test/test_clipboard_nbsp.html +++ b/dom/base/test/test_clipboard_nbsp.html @@ -2,7 +2,6 @@ @@ -13,51 +12,43 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1769534 Mozilla Bug 359303 -Mozilla Bug 1769534

+preserve non-breaking spaces. --> + value="Input content: This town is 100 km away / « Est-ce Paris ? » / Consecutive non-breaking spaces: '  '">
Content-editable content: - This town is 100 km away. - « Est-ce Paris ? » -- Consecutive non-breaking spaces: '  ' -      Text padded using editor-generated pattern. +- Consecutive non-breaking spaces: "  "
-

Paragraph content: - This town is 100 km away. - « Est-ce Paris ? » -- Consecutive non-breaking spaces: '  ' -      Text padded using editor-generated pattern. +- Consecutive non-breaking spaces: "  "

@@ -93,40 +84,28 @@ async function clipboardTextForElementId(aDomId, aExpectedString) { return copiedText; } -function assertUserNbspPreserved(aCopiedText) { - ok(aCopiedText.includes("100 km"), "NBSP between two characters should be preserved"); - ok(aCopiedText.includes("« "), "A single NBSP near a punctuation mark should be preserved"); - ok(aCopiedText.includes(" »"), "A single NBSP near a punctuation mark should be preserved"); - ok(aCopiedText.includes(" ? "), "NBSPs before *and* after a character should be preserved"); - ok(aCopiedText.includes("'  '"), "Consecutive NBSPs should be preserved"); -} - -function assertEditorGeneratedNbspPreserved(aCopiedText) { - ok(aCopiedText.includes("      Text padded"), "When copying from a plain-text control, editor-generated NBSP (if any) should be preserved"); -} - -function assertEditorGeneratedNbspReplaced(aCopiedText) { - ok(aCopiedText.includes(" Text padded"), "When copying plain-text from a non plain-text control, editor-generated NBSP should be replaced by standard spaces"); -} - /** Test for Bug 359303 **/ SimpleTest.waitForExplicitFinish(); SimpleTest.waitForFocus(async function() { - let textCopiedFromInput = await clipboardTextForElementId("input-with-non-breaking-spaces", "Input"); - assertUserNbspPreserved(textCopiedFromInput); - assertEditorGeneratedNbspPreserved(textCopiedFromInput); + let iValue = await clipboardTextForElementId("input-with-non-breaking-spaces", "Input"); + ok(iValue.includes("100 km"), "NBSP between two characters should be preserved"); + ok(iValue.includes("« "), "A single NBSP near a punctuation mark should be preserved"); + ok(iValue.includes(" »"), "A single NBSP near a punctuation mark should be preserved"); + ok(iValue.includes(" ? "), "NBSPs before *and* after a character should be preserved"); + ok(iValue.includes("  "), "Consecutive NBSPs should be preserved"); - let textCopiedFromTextarea = await clipboardTextForElementId("textarea-with-non-breaking-spaces", "Textarea"); - assertUserNbspPreserved(textCopiedFromTextarea); - assertEditorGeneratedNbspPreserved(textCopiedFromTextarea); + let tValue = await clipboardTextForElementId("textarea-with-non-breaking-spaces", "Textarea"); + ok(tValue.includes("100 km"), "NBSP between two characters should be preserved"); + ok(tValue.includes("« "), "A single NBSP near a punctuation mark should be preserved"); + ok(tValue.includes(" »"), "A single NBSP near a punctuation mark should be preserved"); + ok(tValue.includes(" ? "), "NBSPs before *and* after a character should be preserved"); + ok(tValue.includes("  "), "Consecutive NBSPs should be preserved"); - let textCopiedFromContentEditable = await clipboardTextForElementId("content-editable-with-non-breaking-spaces", "Content-editable"); - assertUserNbspPreserved(textCopiedFromContentEditable); - assertEditorGeneratedNbspReplaced(textCopiedFromContentEditable); + let cValue = await clipboardTextForElementId("content-editable-with-non-breaking-spaces", "Content-editable"); + ok(cValue.includes("100 km"), "NBSP should be replaced by spaces, until brower compatibility issues are sorted out"); - let textCopiedFromNonEditableHtmlContent = await clipboardTextForElementId("paragraph-with-non-breaking-spaces", "Paragraph"); - assertUserNbspPreserved(textCopiedFromNonEditableHtmlContent); - assertEditorGeneratedNbspReplaced(textCopiedFromNonEditableHtmlContent); + let pValue = await clipboardTextForElementId("paragraph-with-non-breaking-spaces", "Paragraph"); + ok(pValue.includes("100 km"), "NBSP should be replaced by spaces, until brower compatibility issues are sorted out"); SimpleTest.finish(); }); diff --git a/dom/serializers/nsIDocumentEncoder.idl b/dom/serializers/nsIDocumentEncoder.idl index b134db8041ba..7c6d453d1f3a 100644 --- a/dom/serializers/nsIDocumentEncoder.idl +++ b/dom/serializers/nsIDocumentEncoder.idl @@ -152,12 +152,9 @@ interface nsIDocumentEncoder : nsISupports const unsigned long OutputEncodeBasicEntities = (1 << 14); /** - * Normally, for non-text-control elements (that is, neither