From 9e2a1c4966d8379c9c88b430a741740010d16d37 Mon Sep 17 00:00:00 2001 From: Jorg K Date: Mon, 9 May 2016 08:43:00 -0400 Subject: [PATCH] Bug 333064 - Fix space insertion in copy of CJK text. r=enndeakin --- dom/base/nsCopySupport.cpp | 5 ++- dom/base/test/mochitest.ini | 1 + dom/base/test/test_bug333064.html | 59 +++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 dom/base/test/test_bug333064.html diff --git a/dom/base/nsCopySupport.cpp b/dom/base/nsCopySupport.cpp index 9fcc8e093306..1533c6b82d6d 100644 --- a/dom/base/nsCopySupport.cpp +++ b/dom/base/nsCopySupport.cpp @@ -171,8 +171,11 @@ SelectionCopyHelper(nsISelection *aSel, nsIDocument *aDoc, nsAutoString htmlInfoBuf; if (encodedTextHTML) { // Redo the encoding, but this time use the passed-in flags. + // Don't allow wrapping of CJK strings. mimeType.AssignLiteral(kHTMLMime); - rv = docEncoder->Init(domDoc, mimeType, aFlags); + rv = docEncoder->Init(domDoc, mimeType, + aFlags | + nsIDocumentEncoder::OutputDisallowLineBreaking); NS_ENSURE_SUCCESS(rv, rv); rv = docEncoder->SetSelection(aSel); diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index ae080d328d23..47f4b300c67d 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -333,6 +333,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(clipboard undefined) b skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage [test_bug330925.xhtml] [test_bug331959.html] +[test_bug333064.html] [test_bug333198.html] [test_bug333673.html] [test_bug337631.html] diff --git a/dom/base/test/test_bug333064.html b/dom/base/test/test_bug333064.html new file mode 100644 index 000000000000..6e99fed88120 --- /dev/null +++ b/dom/base/test/test_bug333064.html @@ -0,0 +1,59 @@ + + + + + Test for Bug 333064 + + + + + +Mozilla Bug 333064 +

+ +
+
+
안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안안
+ +
+
+ + + + +