Closed Bug 1491549 Opened 3 years ago Closed 11 months ago

Support dynamically inserted localization links in XUL documents when they are inserted during a parsed Custom Element upgrade or during DOMContentLoaded

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: bgrins, Unassigned, NeedInfo)

References

Details

This is something we ran into with the fix in Bug 1490457 (see https://bugzilla.mozilla.org/show_bug.cgi?id=1490457#c6). It didn't affect the findbar since that gets created in JS later, but we'll need to support adding an FTL link for:

1) Custom Elements that are in the markup and add it during their connectedCallback
2) Code run during DOMContentLoaded

I'm not sure if (1) works in HTML docs right now, but I know (2) does.
Priority: -- → P3

Brian - with the landing of bug 1627809 you should now be able to use connectRoot(root, /* translate ASAP*/ true) in connectedCallback and disconnectRoot(root) in disconnectedCallback.

Can you verify that this is fixed now?

Flags: needinfo?(bgrinstead)
Component: Internationalization → DOM: Core & HTML

(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #1)

Brian - with the landing of bug 1627809 you should now be able to use connectRoot(root, /* translate ASAP*/ true) in connectedCallback and disconnectRoot(root) in disconnectedCallback.

Can you verify that this is fixed now?

I couldn't remember the exact details here so I was going to look at the test case added in Bug 1490457 / https://hg.mozilla.org/mozilla-central/rev/5d9bb31b4cf7 but noticed those files are missing now and can't find them in dom/l10n/tests/mochitest either. Am I missing them, or did they become unnecessary at some point and get removed?

Flags: needinfo?(bgrinstead) → needinfo?(gandalf)

Hmm, I think it was my omission. Most of the intl/l10n/dom tests got moved to dom/l10n/tests separating tests for DOMLocalization from tests of DocumentL10n.

Your test should be in the DocumentL10n test directory, but the only tests I see there that verify the insertFTLIfNeeded are now related to Web Components.

Which may not be that bad, since that's what we use it for :)

Is that enough for you to verify the behavior or would you prefer to re-add the tests you wrote?

Flags: needinfo?(gandalf) → needinfo?(bgrinstead)

I'm going to mark this bug as resolved leaving NI on Brian. Reopen if needed.

Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.