Closed Bug 1968267 Opened 3 months ago Closed 2 months ago

Copying and pasting text from Microsoft Word creates a broken character

Categories

(Core :: Widget: Win32, defect)

Firefox 140
x86_64
Windows 10
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox-esr128 --- unaffected
firefox138 --- unaffected
firefox139 --- unaffected
firefox140 + disabled
firefox141 + disabled

People

(Reporter: selim, Assigned: handyman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Attached image paste-from-word.jpg

Steps to reproduce

  1. Copy any text from Microsoft Word. (I'm using the latest version: 2504)
  2. Paste into the Firefox location bar or any form field.

Result

A broken character appears at the end of the copied text. See the screenshot attached.

I'm using the latest Nightly on Windows 11 and I can reproduce this on troubleshoot mode. I believe this issue has appeared in the past few days. I cannot reproduce this when copying from Notepad or any other Office apps. It's just Word.

(In reply to Selim Şumlu from comment #0)

I believe this issue has appeared in the past few days. I cannot reproduce this when copying from Notepad or any other Office apps. It's just Word.

Thanks for reporting this issue.
Is it possible that you can help to run mozregression to find the regression window?

Flags: needinfo?(selim)

Thanks! David, could you take a look?

Flags: needinfo?(davidp99)
Keywords: regression
Regressed by: 1966443

Set release status flags based on info from the regressing bug 1966443

Looking at it now.

Assignee: nobody → davidp99
Flags: needinfo?(davidp99)
Severity: -- → S3

Set release status flags based on info from the regressing bug 1966443

Word inserts a stray line feed (0x000a) at the end of strings. Sometimes,
it is preceeded by a null character (0x0000 0x000a). Sometimes the null
character follows the LF (0x000a 0x0000). Line breaks are added as LF-CR
(0x000a 0x000d) and are therefore not removed here.

Pushed by daparks@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/074b407a4761 Ignore stray line feeds at end of clipboard text r=win-reviewers,gstoll
Pushed by ctuns@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/84f820e2dd3e Revert "Bug 1968267: Ignore stray line feeds at end of clipboard text r=win-reviewers,gstoll" for causing multiple failures "clipboard" related

Backed out for causing multiple failures "clipboard" related

Flags: needinfo?(davidp99)

The bug is marked as tracked for firefox140 (beta) and tracked for firefox141 (nightly). However, the bug still has low severity.

:hsinyi, could you please increase the severity for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit BugBot documentation.

Flags: needinfo?(htsai)
Severity: S3 → --
Component: DOM: Copy & Paste and Drag & Drop → Widget: Win32
Flags: needinfo?(htsai)

Instead of trying to do something consistent, which causes the kinds of errors seen in the test failures, we'll just keep the one-character-null removal from before and also ignore 0x0000 0x000a nonsense strings at the end of the buffer. This would not do the "right" thing with every copy from Word but it should do the right thing in most cases and not break clipboard copies from applications that don't have the Word bug. The failure case is copying just one line break from Word -- it copies that as 0x0000 0x000a, which we will obviously reduce to nothing. Two line breaks are copied as 000d 000a 000d 000a 0000, which gets properly pasted as two line breaks. FTR, Edge and Chrome do the same thing -- a copy of one line break is reduced to nothing.

Flags: needinfo?(davidp99)
Attachment #9491053 - Attachment description: Bug 1968267: Ignore stray line feeds at end of clipboard text r=#win-reviewers! → Bug 1968267: Ignore 0x0 0xa combination at end of clipboard text r=#win-reviewers!
Pushed by daparks@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e422931fd17b Ignore 0x0 0xa combination at end of clipboard text r=win-reviewers,gstoll
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch

The patch landed in nightly and beta is affected.
:handyman, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(davidp99)

Comment on attachment 9491053 [details]
Bug 1968267: Ignore 0x0 0xa combination at end of clipboard text r=#win-reviewers!

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Pastes of copies from Word will have an extra nonsense byte appended.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): At most, the patch removes a couple of bytes from the paste.
  • String changes made/needed: N/A
  • Is Android affected?: No
Flags: needinfo?(davidp99)
Attachment #9491053 - Flags: approval-mozilla-beta?

Comment on attachment 9491053 [details]
Bug 1968267: Ignore 0x0 0xa combination at end of clipboard text r=#win-reviewers!

Approved for 140.0b4.

Attachment #9491053 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Backed out from beta, as part of backing out the regressor Bug 1966443

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 141 Branch → ---

Set release status flags based on info from the regressing bug 1966443

The severity field is not set for this bug.
:handyman, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(davidp99)

Fixed by regressor backout.

Status: REOPENED → RESOLVED
Closed: 3 months ago2 months ago
Flags: needinfo?(davidp99)
Resolution: --- → WORKSFORME
Attachment #9491053 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: