Provide a way to create a 'UA' shadow root / slots that are not accessible to the page

NEW
Unassigned

Status

()

Core
DOM
P3
normal
a month ago
2 days ago

People

(Reporter: bgrins, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [xbl-in-content])

(Reporter)

Description

a month ago
In order to remove XBL bindings in-content, I'd like to be able to create a shadow root and move content into it without the page seeing it.

For example, the <marquee> element could create a UA shadow root and then put the light dom inside of a wrapper element that moves around. The in-content bindings I suspect this would be useful for are:

1) <marquee>
2) XML pretty printing
3) <videocontrols>
4) plugin problem ui

I believe that (1) and (2) could be implemented just with this feature, while (3) and (4) will require some kind of js environment in addition to this.

Comment 2

a month ago
I wonder if we can modify the stuff used by the DevTools highlighter to support injecting elsewhere than the canvas frame:
 https://dxr.mozilla.org/mozilla-central/source/dom/webidl/AnonymousContent.webidl

Comment 3

a month ago
> 2) XML pretty printing

For XML pretty printing, a possibility is to support XML files similarly to how JSON files are supported by the devtools JSON viewer. Would be interesting to sync this on the DevTools' roadmap.
The JSON viewer has a bunch of problems compared to the XML viewer, starting with the fact that the DOM it exposes is not the right DOM...
(Reporter)

Comment 5

a month ago
FWIW I think we can turn the XML pretty printing into HTML with no JS by modifying the existing XSLT to render out appropriate <details> / <summary> tags. Then we need a way to place to put that DOM - I was thinking this could be in a UA shadow root (attached to the root element), although I believe we also discussed somehow using the existing native anon content / CanvasFrame similar to how the devtools highlighters work.
(Reporter)

Updated

a month ago
See Also: → bug 1432636
(Reporter)

Updated

23 days ago
Whiteboard: [xbl-in-content]
(In reply to Tim Nguyen :ntim from comment #2)
> I wonder if we can modify the stuff used by the DevTools highlighter to
> support injecting elsewhere than the canvas frame:
>  https://dxr.mozilla.org/mozilla-central/source/dom/webidl/AnonymousContent.
> webidl

I'd be interested in considering this for the highlighter use case.  I am tracking various new pathways for highlighters over in bug 1411122.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.