Have <img> shadow root ready for span elements for text recognition
Categories
(Core :: DOM: Core & HTML, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: gregtatum, Assigned: emilio)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
As a follow-up to Bug 1759201, we would like to begin experimenting with adding span elements to the shadow root of the <img> element. There are potential issues with this around text selection and img dragging.
It would be nice to begin experimenting with this on a real img element.
Feel free to add more details and clarifications here Emilio.
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
This shares code with the transferable / cursor stuff which are the
other two non-rendering callers that deal with images over IPC.
We're going to introduce a consumer of this new type in a second, but
this was worth getting reviewed separately.
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
There's no need to QI etc to go from nsImageLoadingContent to
nsINode/nsIContent.
Depends on D141110
Assignee | ||
Comment 3•3 years ago
|
||
This is all still unused, but we'll add an JS API to HTMLImageElement
for testing in a bit.
The reason for not having the JS-exposed interface is that dealing with
all the relevant edge cases is pretty hard from JS (think of e.g., the
image source changing mid-recognition, and so on).
The frontend will probably want an "is image recognition available"
boolean, but that doesn't need to be on its own XPCOM component, IMO.
If we need a JS API for unit-testing or something we can always add it
later.
Depends on D141111
Assignee | ||
Comment 4•3 years ago
|
||
We could expose the text recognition values to JS if need be, but
there's no reason to do that for now. We expose them via the UA
widget DOM for now.
We can trivially do that if we want to build the Shadow DOM in JS
or what not. I decided to still return a promise so that we can
expose errors though.
Depends on D141112
Assignee | ||
Updated•3 years ago
|
Comment 6•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a4e1475f2a32
https://hg.mozilla.org/mozilla-central/rev/ba558395ee2f
https://hg.mozilla.org/mozilla-central/rev/0a65a83cf944
https://hg.mozilla.org/mozilla-central/rev/466314d367bb
Description
•