Closed Bug 1730723 Opened 3 years ago Closed 20 days ago

selection cant span across an svg that uses xlink href

Categories

(Core :: DOM: Selection, defect, P3)

Firefox 93
All
Unspecified
defect

Tracking

()

RESOLVED DUPLICATE of bug 1455893

People

(Reporter: vinay, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome)

Attachments

(1 file)

Attached file firefox-bug.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Steps to reproduce:

Create a document that:

  • Has an SVG that sets up symbols with their own ids
  • Has an SVG that uses the symbol via xlink href
  • Has text before and after the xlink SVG

I've attached a sample doc as firefox-bug.html

Note: the above process (a svg of symbols + xlink href to refer to the symbols) is the process that webpack uses to create svg sprites for reusable svg icons.

Now -- select the text from before the xlink SVG until after the xlink SVG.

Actual results:

Selection of the inline SVG works normally.
Selection stops abruptly once I try to cross the xlink SVG.

This behavior is non-deterministic. Sometimes I can make the selection, but most of the time it stops abruptly. The non-determinism may be connected to the speed of the mouse movement.

Expected results:

Selection should continue across the xlink SVG just as it would have for an inline SVG.

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

Mirko, do you know what's up here?

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

The same issue occurs with <use href, instead of <use xlink:href. The use of the latter is discouraged but both are still supported: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use#attributes.

The problem here is that <use internally uses Shadow DOM and selection across the Shadow DOM boundary isn't properly supported by Gecko/Firefox.

Chrome uses here Shadow DOM, too.

Blocks: 1590379

(In reply to Vinay from comment #0)

This behavior is non-deterministic. Sometimes I can make the selection, but most of the time it stops abruptly. The non-determinism may be connected to the speed of the mouse movement.

Workaround: to complete desired selection, move mouse in a such way that cursor is never crosses the SVG image. If cursor is upper or lower in intermediate states then temporary wrong par of line may be selected, but as soon as cursor is returned to the target line after passing SVG the selection becomes as the expected one, the image is ignored.

This is fixed in Nightly Firefox.

Status: NEW → RESOLVED
Closed: 20 days ago
Duplicate of bug: 1455893
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: