Script load timing relative to `document.l10n` initialization is different in HTML and XUL documents
Categories
(Core :: Internationalization, defect, P3)
Tracking
()
People
(Reporter: ntim, Unassigned)
References
Details
Attachments
(1 file)
2.59 KB,
patch
|
Details | Diff | Splinter 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.
Reporter | ||
Comment 1•6 years ago
|
||
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.
Comment 2•6 years ago
|
||
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?
Comment 3•6 years ago
|
||
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.
Comment 4•6 years ago
|
||
The priority flag is not set for this bug.
:Pike, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•6 years ago
|
Updated•4 years ago
|
Updated•2 years ago
|
Description
•