Closed Bug 1337234 Opened 4 years ago Closed 4 years ago

Add new webAPIs for XBL in child to get calendar terms

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox54 --- affected

People

(Reporter: wesley_huang, Assigned: jessica)

References

(Blocks 1 open bug)

Details

(Whiteboard: [milestone5])

Attachments

(2 files)

https://bugzilla.mozilla.org/show_bug.cgi?id=1287677#c42

Components.classes is for chrome code only, and the input box part for date/time inputs are in content side, implemented using XBL. Do you know if there is any other way I can access these utility functions? (e.g., we usually expose it in webidl and restrict it using [Func="IsChromeOrXBL"]).
:wchen, can you help us with this? I don't know how to expose webidl based on mozIntl.getDisplayNames for XBL.
Flags: needinfo?(wchen)
I can see many examples of XBL being able to use Components.classes (e.g. https://dxr.mozilla.org/mozilla-central/rev/f4f374622111022d41dd8d5eb9220624135c534a/toolkit/content/widgets/datetimepopup.xml#196)

I don't understand the problem we are trying to solve. Why do we need another way to access the utility functions? Why does using WebIDL solve the problem?
Flags: needinfo?(wchen)
Priority: -- → P2
XBL code in child does not have privileges to access mozIMozIntl. After discussing with :smaug, one way to solve this is to expose ChromeOrXBL method in Window, so that XBL code in child can access it. We are not going to expose mozIMozIntl directly, but provide functions that map to mozIMozIntl functions.

For example, for getLocaleInfo() (bug 1312053, not landed yet), we can expose it in Window as:

partial interface Window {
  [Func="IsChromeOrXBL"]
  LocaleInfo getLocaleInfo(sequence<DOMString> locales);
};

getDisplayNames()'s (bug 1287677) parameter and return value are more complicated, we may consider simplify a bit by accepting just one single key.
Summary: Add a new WebIDL for content process to get calendar terms → Add new webAPIs for XBL in child to get calendar terms
I can help with this.

For input type=time input box, we need:
- direction for locale: rtl/ltr (depends on bug 1312053)
- 12/24hr format for locale
Assignee: nobody → jjong
Priority: P2 → P1
Whiteboard: [milestone5]
WIP based on bug 1312053. Exposes window.getLocaleInfo() to chrome or xbl.
Attachment #8837041 - Attachment description: WIP → WIP for getLocaleInfo()
Maybe we should file separate bugs for each function needed, since we may add them one by one, in different time periods.
Blocks: 1340396
Blocks: 1341994
No longer blocks: 1341994
Depends on: 1341994
Depends on: 1346084
can we close this bug since all dependent bugs are done?
(In reply to Wesley Huang [:wesley_huang] (EPM) (NI me) from comment #8)
> can we close this bug since all dependent bugs are done?

Yes, I think I have all the APIs I need now. Will file new bugs if I need any other APIs.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.