Closed Bug 1000130 Opened 10 years ago Closed 10 years ago

Clean up bootstrap mozL10n API use in Gallery

Categories

(Firefox OS Graveyard :: Gaia::Gallery, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stas, Assigned: stas)

References

Details

Attachments

(1 file, 1 obsolete file)

Gallery currently sets document's lang/dir and uses 'localized' event to initialize.

Instead it should use mozL10n.once.
Attached patch Use mozL10n.once (obsolete) — Splinter Review
https://github.com/mozilla-b2g/gaia/pull/18584
Assignee: nobody → stas
Status: NEW → ASSIGNED
Attachment #8411146 - Flags: review?(dflanagan)
Blocks: 1000593
Comment on attachment 8411146 [details] [diff] [review]
Use mozL10n.once

The code looks good to me, and seems to work correctly. In particular, I've tested the open activity.

I still have my fundamental lack of understanding of whether we're waiting for an onload event here, however.
Attachment #8411146 - Flags: review?(dflanagan) → review+
(In reply to David Flanagan [:djf] from comment #2)

> I still have my fundamental lack of understanding of whether we're waiting
> for an onload event here, however.

We're not.  As I mentioned in the other bugs, I'll wait until bug 1000806 is fixed before I move forward here.  The patch works but I'm worried that it might cause race conditions under some rare circumstances.  I'm sorry for the trouble.
Depends on: 1000806
As concluded in bug 1000806, as long as mozL10n.ready and .once are called in deferred scripts, it is safe to assume that the callback will have access to an interactive DOM.  This is the case here.

I rebased the pull request and also made one more small change to js/frames.js.  Namely, I removed languageDirection in favor of navigator.mozL10n.language.direction.

Carrying over the r+.  I'll wait for Travis before landing.
Attachment #8411146 - Attachment is obsolete: true
Attachment #8434106 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: