Confirmed users
133
edits
Luke-chang (talk | contribs) m (→Concept) |
Luke-chang (talk | contribs) m (→Proposed API) |
||
Line 62: | Line 62: | ||
== Proposed API == | == Proposed API == | ||
The current "[https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsercontextmenu mozbrowsercontextmenu]" event is not enough for the system app to implement this concept because it can be informed about the details of context menus only when user triggers "[https://developer.mozilla.org/en-US/docs/Web/Events/contextmenu contextmenu]" event actively (e.g. long-tap or right-click). We do need to invent a new "mozbrowser" event to make system app aware of necessary details whenever the definition of context menus is appended, removed or changed. For this reason, | |||
# Introduce a new "'''mozbrowsercontextmenuchange'''" event. This event should be triggered whenever the <menuitem> within the mozbrowser iframe is appended (including first loaded), removed or modified. Also, it should be triggered as well when the focus in the iframe is moved (in or out) to an element whose "contextmenu" is defined to override the parent's one. | |||
# We also need a convention between app and system app in Gaia: If there are two softkeys on the device, the first <menuitem> will be considered LSK (left softkey) and the second one will be RSK (right softkey). If there are more than two <menuitem>s, the first <menuitem> will still be LSK but system app will create an "Option" button to be RSK and display a drop menu to contain the rest <menuitem>s when user clicks RSK. | |||
# If an app doesn't define its own context menu, the default set of softkeys will be involved in system app. |