Closed Bug 2049720 Opened 2 months ago Closed 1 month ago

[GTK] text/plain is missing from dataTransfer.types when dropping content from an external application

Categories

(Core :: Widget: Gtk, defect)

Firefox 153
defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox152 --- unaffected
firefox153 --- fixed
firefox154 --- fixed

People

(Reporter: hiroshi, Assigned: stransky)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached file droptest.html

Impact

This causes the following issues:

  • Dropping selected text from another application onto the tab bar or URL bar does not trigger a search.
  • Dropping an item (text, URL, file, etc.) from another application into a textarea or input element is not inserted as plain text.

Tested platforms

  • Affected platforms: Gentoo Linux (without systemd)
    • DE: KDE Plasma 6.6.5 (X11 and Wayland)
    • GTK version: 3.24.51
  • Unaffected platforms: Windows 10 on Oracle VirtualBox

Steps to reproduce

  1. Start Nightly.
  2. Open the attached HTML page in Nightly.
  3. Start another application (e.g. another web browser).
  4. Select any text from the other application and drag and drop it onto the "drop here" area in the test page in Nightly.

Actual result

You will see an alert dialog whose message does not include text/plain, as shown below.

event.dataTransfer.types:

    text/html

Expected result

You will see an alert dialog whose message includes text/plain, as shown below.

event.dataTransfer.types:

    text/html
    text/plain

Regression range

Component: DOM: Copy & Paste and Drag & Drop → Widget: Gtk
Keywords: regression
Regressed by: 2025329

:stransky, since you are the author of the regressor, bug 2025329, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(stransky)
Blocks: linuxdad
Flags: needinfo?(stransky)

Will look at it. We moved back to Gtk implementation here so it should be working...

Severity: -- → S3
Flags: needinfo?(stransky)

gtk_selection_data_get_length() returns data len without trailing null char.
Also we may get UTF-8 string with nested null chars.
There's no point to compare len returned from srtlen() and gtk_selection_data_get_length() as
they return different values. Just use data len we get from Gtk, use use exact text size anyway
as we convert it to UTF-16.

Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Severity: S3 → S2
Flags: needinfo?(stransky)

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

Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch

gtk_selection_data_get_length() returns data len without trailing null char.
Also we may get UTF-8 string with nested null chars.
There's no point to compare len returned from srtlen() and gtk_selection_data_get_length() as
they return different values. Just use data len we get from Gtk, use use exact text size anyway
as we convert it to UTF-16.

Attachment #9606513 - Flags: approval-mozilla-beta?

Comment on attachment 9606513 [details]
Bug 2049720 [Linux] Don't use strlen to check D&D data sizes r?emilio

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Text D&D is broken on Linux.
  • Is this code covered by automated tests?: No
  • 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): Remove newly added text length check.
  • String changes made/needed: none
  • Is Android affected?: No
Attachment #9606513 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: