Firefox Translations doesn't deal with Shadow DOM
Categories
(Firefox :: Translations, defect, P3)
Tracking
()
People
(Reporter: mozinet, Assigned: sefeng)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
607.87 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
pascalc
:
approval-mozilla-release+
|
Details | Review |
1.02 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0
Steps to reproduce:
Open https://ko-fi.com/post/If-You-Suffer-from-Urgent-Normal-Syndrome-Ask-for-K3K6MN65U in Firefox Nightly.
Translate the page with the built-in Firefox Translations feature, in French, for example.
Actual results:
The title of the article and the page menus have been translated, however, the article text remains in its original English language.
Expected results:
All the text of the page needs to be translated.
Updated•11 months ago
|
Comment 1•11 months ago
|
||
This is a more general problem. The article contents are inside a shadow root. Greg, Translations don't seem to handle shadow dom at all which seems like it could affect a bunch of pages.
Updated•11 months ago
|
Comment 2•11 months ago
|
||
Seems the TreeWalker class doesn't handle the shadow DOM. I found some discussion here: https://github.com/whatwg/dom/issues/665
I guess we'll need to find a way to recurse into it. The extension also can't handle the shadow DOM.
Comment 3•11 months ago
|
||
We expose .openOrClosedShadowRoot
to extensions and chrome code.
Updated•11 months ago
|
Comment 4•11 months ago
|
||
So it looks like we'll need to call addRootElement for shadow DOMs that we encounter while walking the nodes.
Comment 5•11 months ago
|
||
The problem is also reproducible on https://www.suewag.de/privatkunden.
Comment 6•10 months ago
|
||
The severity field is not set for this bug.
:nordzilla, could you have a look please?
For more information, please visit BugBot documentation.
Updated•10 months ago
|
Updated•10 months ago
|
Updated•9 months ago
|
Assignee | ||
Comment 7•8 months ago
|
||
Updated•8 months ago
|
Comment 8•8 months ago
|
||
The test page isn't loading for me on Nightly. I can't confirm the fix, and I'm having trouble finding examples to try.
Assignee | ||
Comment 9•8 months ago
|
||
Here's a simple test case for this.
I just updated the patch (there's was a bug in my original approach), and have tested it with both sites.
Comment 10•8 months ago
|
||
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c12f569ae50b Make Firefox Translation iterates nodes inside ShadowDOM r=gregtatum
Comment 11•8 months ago
|
||
bugherder |
Comment 12•8 months ago
|
||
Sean, what do you think of uplifting the fix to 119 or even 118?
Assignee | ||
Comment 13•8 months ago
|
||
Macro found out some content on https://www.suewag.de/privatkunden were still not being translated.
It turned out there were two issues. One related to slotted content and the other related to ShadowDOM mutations.
I plan to land a patch in Bug 1855307 to address those. We have an existing bugs open for ShadowDOM mutations as Bug 1842820, unfortunately I tested it with my current approach for ShadowDOM mutations and it didn't fix it. So I'll leave Bug 1842820 as is.
Leave my NI for uplifting this patch along with Bug 1855307.
Assignee | ||
Comment 15•8 months ago
•
|
||
Comment on attachment 9354420 [details]
Bug 1841656 - Make Firefox Translation iterates nodes inside ShadowDOM r=gregtatum
Beta/Release Uplift Approval Request
- User impact if declined: Content in shadow dom won't be translated by Firefox Translation
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: Bug 1855307
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is low risky because the change is trivial and is covered by automated test.
- String changes made/needed:
- Is Android affected?: No
Assignee | ||
Comment 16•8 months ago
|
||
Comment on attachment 9354420 [details]
Bug 1841656 - Make Firefox Translation iterates nodes inside ShadowDOM r=gregtatum
Beta/Release Uplift Approval Request
- User impact if declined: Content in shadow dom will not be translated
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: Bug 1855307
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is low risky because the change is trivial and is covered by automated test
- String changes made/needed:
- Is Android affected?: No
Comment 17•8 months ago
|
||
Comment on attachment 9354420 [details]
Bug 1841656 - Make Firefox Translation iterates nodes inside ShadowDOM r=gregtatum
Approved for 119.0b5
Comment 18•8 months ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/3e8d3c9a4bfb
Updated•8 months ago
|
Comment 19•8 months ago
|
||
Comment on attachment 9354420 [details]
Bug 1841656 - Make Firefox Translation iterates nodes inside ShadowDOM r=gregtatum
Approved for our next 118 dot release, thanks.
Comment 20•8 months ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-release/rev/b59b2ac81d43
Comment 21•8 months ago
|
||
bugherder uplift |
Description
•