Open Bug 1664350 Opened 4 years ago Updated 4 years ago

Exporting `<table>` including `<svg>` to the clipboard is broken for "text/html"

Categories

(Core :: DOM: Serializers, defect)

80 Branch
defect

Tracking

()

People

(Reporter: gonghan.zou, Unassigned)

References

(Depends on 3 open bugs, Blocks 1 open bug)

Details

(Keywords: parity-chrome)

Attachments

(1 file)

Attached file table-example.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

Steps to reproduce:

Firefox does not copy html structure of tables correctly, when there are SVG images in table header.

Open table-example.html in attachment in firefox,
Select from "A" to "B"
Inspect "text/html" data in your clipboard.

Actual results:

The "text/html" data in your clipboard does not match the original table structure:
The contents of table header are outside the table, but it should be inside table.

Expected results:

It should preserve the correct html table structure.

Component: Untriaged → DOM: Serializers
Product: Firefox → Core

Just some updates,

  • Seems replace the "SVG" with an "IMG" does not fix this issue.
  • "Control + A" will copy two tables instead of one.

Our current workaround is a DIV with background image.

Flags: needinfo?(mbrodesser)

Reproducible with Nightly on Ubuntu 18.04. Given the old existing bugs in <table>-Selection code, I suspect the bug exists since a longer time (years, presumably). Works with Chrome.

Flags: needinfo?(mbrodesser)
Keywords: parity-chrome
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: -- → S3

This issue isn't <th>-specific, it also happens when changing them to <td>s.

Selecting the whole table by taping Ctrl+a and copying it to the clipboard works with Chrome.

Couldn't reproduce the issue when replacing the <svg> with an <img>.

:gonghan.zou: is it still reproducible for you, when using an <img>? Moreover, it'd be helpful to know the use-cases for copying <table>s including <svg>s.

Flags: needinfo?(gonghan.zou)
Summary: Firefox does not copy html structure of tables correctly → Exporting `<table>` including `<svg>` is broken
Summary: Exporting `<table>` including `<svg>` is broken → Exporting `<table>` including `<svg>` to the clipboard is broken for "text/html"
Assignee: nobody → mbrodesser
Assignee: mbrodesser → nobody
No longer depends on: 1569211

(In reply to Mirko Brodesser (:mbrodesser) from comment #4)

Couldn't reproduce the issue when replacing the <svg> with an <img>.

:gonghan.zou: is it still reproducible for you, when using an <img>?

I suspect the same issue as in bug 1669050 is meant.

Flags: needinfo?(gonghan.zou)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: