Open Bug 1842820 Opened 1 year ago Updated 1 year ago

Mutation not being captured on Reddit

Categories

(Firefox :: Translations, defect, P3)

defect

Tracking

()

People

(Reporter: marco, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR:

  1. Open a Reddit page, such as https://www.reddit.com/r/Banff/
  2. Translate it to a language of your choice

When scrolling enough, new posts are loaded and they are not translated.

This may be a duplicate of Bug 1840705, but requires investigation.

I have a suspicion that we are not able to react to a page's use of the MutationObserver, since we are ourselves using a mutation observer.

We're also not recursing into the Shadow DOM, see Bug 1841656.

The severity field is not set for this bug.
:gregtatum, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(gtatum)
Severity: -- → S3
Flags: needinfo?(gtatum)
Priority: -- → P3
See Also: → 1840705, 1651969
Blocks: 1845772
No longer blocks: 1838721

I wrote a patch to introduce some basic ShadowDOM mutation in Bug 1855307, and I believe it covers most of the ShadowDOM mutation case.

There's one exception though that is when the host element is added to the tree and it's not a shadow host at the time and later it becomes a shadow host, we are not able to detect this. There's no way to observe the attachShadow call. Not sure if we have some thing special for devtools.

I wonder if this is related to this reddit issue.

(In reply to Sean Feng [:sefeng] from comment #4)

I wrote a patch to introduce some basic ShadowDOM mutation in Bug 1842820, and I believe it covers most of the ShadowDOM mutation case.

I assume you meant to say Bug 1855307, not bug 1842820. :)

There's one exception though that is when the host element is added to the tree and it's not a shadow host at the time and later it becomes a shadow host, we are not able to detect this. There's no way to observe the attachShadow call. Not sure if we have some thing special for devtools.

I wonder if this is related to this reddit issue.

yeah sorry!

See Also: 1651969

Hi Marco, can you still see the problem in Reddit after bug 1840705? I just checked again on the latest Nightly and I could find no problem. Also I don't see any shadow trees in Reddit so I don't think comment #4 matters much here, unless I missed something.

Flags: needinfo?(mcastelluccio)

Yes, I can still reproduce by going to https://www.reddit.com/r/Banff/, performing translation, and then scrolling enough to get to posts that haven't been loaded yet (which won't be translated).

Flags: needinfo?(mcastelluccio)

Hmm, that's exactly what I did, do you see any shadow tree in devtools? I don't see any, but maybe there's some new-UI option that I don't know?

Attached image screenshot

Yes, I see a few.

At the moment, only posts up to "'Be prepared to encounter a bear': Warning issued in Banff" are translated. Anything after that isn't.

I don't have a Reddit account, maybe something is different when you are logged-in vs not logged-in?

Oh, oh, yes, now I see that when I sign out, thanks!

There's no way to observe the attachShadow call. Not sure if we have some thing special for devtools.

Again, not sure if this is the root cause of this. However I just noticed there's a special event that we are using for devtools https://searchfox.org/mozilla-central/rev/ac497ae160e664617e2f4286cdce3b03ef912d90/dom/base/Element.cpp#1307-1309 for attachShadow call.

Hi Greg, Please where can i find the file for this bug ?

Flags: needinfo?(gtatum)

Okay thank you i am reading the documentation and trying to understand the code code so i can work on submitting a patch

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: