Closed
Bug 1421833
Opened 7 years ago
Closed 6 years ago
text inside shadow DOM can be selected, but not copied on Android
Categories
(Firefox for Android Graveyard :: General, defect, P2)
Tracking
(firefox59 affected)
RESOLVED
DUPLICATE
of bug 1472421
Tracking | Status | |
---|---|---|
firefox59 | --- | affected |
People
(Reporter: anaran, Assigned: edgar)
References
Details
Attachments
(2 files)
New minimal testcase now available at
https://raw.githubusercontent.com/anaran/import/9bf3e184ad4bfffb4b5377f0e03ff64018cf6164/shadowy_testcase.js
Just run it in a Scratchpad on a newly opened tab (Ctrl+T) or just about:blank.
Use Scratchpad in WebIDE to remotely debug on Android device via Wifi or USB.
While text can be selected in each element (pre, textarea, input, div), none of these selections bring up the Android popup to operate on the selection, like Cut Copy, Paste, etc.
While Cut and Paste are understandably not possible at this point due to Bug 1421831, Copy should be possible.
Reporter | ||
Updated•7 years ago
|
Summary: contentEditable inside customElement are not editable on Android or Linux → text inside customElement can be selected, but not copied on Android
Comment 1•7 years ago
|
||
This looks like Shadow DOM thing, not Custom Elements.
Updated•7 years ago
|
Updated•7 years ago
|
Summary: text inside customElement can be selected, but not copied on Android → text inside shadow DOM can be selected, but not copied on Android
Comment 2•7 years ago
|
||
minimal testcase would be nice, but I guess I can write such.
Comment 3•7 years ago
|
||
Updated•7 years ago
|
Component: DOM → General
Product: Core → Firefox for Android
Comment 4•7 years ago
|
||
Jan, do you know if someone familiar with FF-android could take a look?
Flags: needinfo?(jh+bugzilla)
Comment 5•7 years ago
|
||
Jim, could you take a look a forward this accordingly? This affects both Fennec and the GeckoView implementation as well.
Flags: needinfo?(jh+bugzilla) → needinfo?(nchen)
Comment 6•7 years ago
|
||
Note, the stuff done in bug 1458694 is possibly useful.
Or https://searchfox.org/mozilla-central/rev/b28b94dc81d60c6d9164315adbd4a5073526d372/dom/webidl/DocumentOrShadowRoot.webidl#20
Comment 7•7 years ago
|
||
Looks like the bug is two fold:
1) CaretStateChangedEvent.selectionVisible [1] is not set to true in AccessibleCaretManager [2] for shadow DOM selections, so we think the selection is not visible and therefore we don't show the copy/paste toolbar. Fixing this alone should make copy/paste work for the GeckoView case.
2) We don't know how to get nsISelection for shadow DOM elements in [3] and [4]. Fixing this and the above should make copy/paste work in Fennec. Fixing this will make the GeckoView implementation behave more correctly as well.
[1] https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/dom/webidl/CaretStateChangedEvent.webidl#36
[2] https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/layout/base/AccessibleCaretManager.cpp#1436-1446
[3] https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/mobile/android/chrome/geckoview/GeckoViewSelectionActionContent.js#93-96
[4] https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/mobile/android/modules/ActionBarHandler.jsm#763-767
Flags: needinfo?(nchen)
Comment 8•6 years ago
|
||
This is one of the few blockers shipping Shadow DOM, so if anyone could take a look at this, great.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → echen
Assignee | ||
Comment 9•6 years ago
|
||
After some investigating, I found this issue is caused by the IsInUncomposedDoc checks in nsRange::CollectClientRectsAndText [1] and bug 1472421 have fixed it. So mark as a duplicated of bug 1472421.
[1] https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/dom/base/nsRange.cpp#3060-3062
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 11•6 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #10)
> Could we add a test?
The test in bug 1472421 also covers this, IMO.
Flags: needinfo?(echen)
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•