Open Bug 1741051 Opened 3 years ago Updated 2 years ago

Cannot select content across top-level elements inside a shadow DOM within a custom element

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

Tracking Status
firefox94 --- affected
firefox95 --- affected
firefox96 --- affected

People

(Reporter: xidorn, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file testcase

Steps to reproduce:

  1. open the attached testcase
  2. try to select from the first paragraph to the second paragraph

Expected behavior:
You can select them.

Actual behavior:
You can't.

In this test case, both paragraphs are under the same shadow root, so it's not crossing a shadow boundary like bug 1455893. Also this only happens with custom element + shadow DOM. Simply adding the elements to a custom element or adding the elements to a shadow root of a normal element doesn't have this issue.

Mirko, do you have thoughts about this?

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

Thanks for filing the issue, Xidorn.

Indeed, this works with non-custom elements. Attached a testcase.

Moreover, it's not a a very recent issue, occurs on Firefox 94 as well as Nightly.

I don't see anything very obvious.

Flags: needinfo?(mbrodesser)

For the provided STR, the selection should contain exactly one range, therefore the bug might not be directly in Selection code. Maybe around nsFrameSelection.

Change the status for beta to have the same as nightly and release.
For more information, please visit auto_nag documentation.

FWIW, I did some regression check, and it seems to me that this happens from the very beginning when Firefox started supporting shadow dom and custom element on Firefox 63.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: