Open Bug 1542543 Opened 5 years ago Updated 2 years ago

Script load timing relative to `document.l10n` initialization is different in HTML and XUL documents

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

People

(Reporter: ntim, Unassigned)

References

Details

Attachments

(1 file)

Attached patch containers.diffSplinter Review

One thing I noticed is that HTML scripts load earlier than when document.l10n is ready, whereas XUL scripts load later. See the diff for details.

It would be nice to harmonize this.

For more context, in the diff, I had to wrap the setTitle() call into a load event listener to make the dialog work, due to this issue.

Zibi, do you know what the intended behavior here is? Should we expect to change frontend code to wait for load or DOMContentLoaded while migrating to HTML documents, or should we change the l10n impl to initialize earlier?

Flags: needinfo?(gandalf)

So, in theory, there it no strong correlation in XHTML/HTML case, between load even and document.l10n.ready promise being resolved because load can happen before or after it.

In result, in theory, you should block on the thing that you need, rather than implicitly assume that one means the other. If you need to wait for both, Promise.all to the rescue.

In practice, bz believes we should be ok with blocking load on l10n, and bug 1539714 is about making it so. I have not had time to work on it yet, and bz also didn't feel like it's a high priority, but if it blocks you, feel free to tackle it before either of us gets to it.

Flags: needinfo?(gandalf)

The priority flag is not set for this bug.
:Pike, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(l10n)
Flags: needinfo?(l10n)
Priority: -- → P3
Component: Localization → Internationalization
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: