Closed Bug 1538794 Opened 6 years ago Closed 6 years ago

Content injected with Document.insertAnonymousContent should be able to receive mouse events

Categories

(Core :: Layout, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: mconley, Assigned: smaug)

References

Details

Attachments

(1 file)

I'm using Document.insertAnonymousContent to insert a toggle to open Picture-in-Picture in bug 1535354.

I'm using nsIDOMWindowUtils.loadSheetUsingURIString to use an author stylesheet to style the toggle.

I need this toggle to be able to be styled differently on :hover, and I also need it to be able to respond to click events.

smaug suggested that the latter would be pretty straight-forward. I hope the former is also possible, since I'd rather not do mousemove hacks.

Hey smaug, you said that adding the ability to respond to click events on anonymous content would be straight forward, and only a few lines to add... do you have the ability to do that, or can you coach me on how to do that? And is supporting :hover possible?

Flags: needinfo?(bugs)

html.css or ua.css can use pointer-events: auto; for the inserted content to get events. Not, also selection handling gets enabled, so perhaps better to play with other CSS stuff too.

Flags: needinfo?(bugs)

Triaging to P3 to get this off the AWTY list :)

Assignee: nobody → bugs
Priority: -- → P3

Mike, is the API any good for your use case?

Flags: needinfo?(mconley)

Yep!

Flags: needinfo?(mconley)
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/bd1a81666a6b add AnonymousContent.getTargetIdForEvent to be able to detect the event target in anonymous content, r=baku
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: