Confirmed users
133
edits
Luke-chang (talk | contribs) m (→Concept) |
Luke-chang (talk | contribs) m (→Proposed API) |
||
| Line 63: | Line 63: | ||
== Proposed API == | == Proposed API == | ||
The current "[https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsercontextmenu mozbrowsercontextmenu]" event is not enough for | The current "[https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsercontextmenu mozbrowsercontextmenu]" event is not enough for system app to implement this concept because it can be informed about the details 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 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 | # Introduce a new "'''mozbrowsercontextmenuchange'''" event. This event should be triggered whenever the <menuitem> within a 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. | ||
# The event object of "mozbrowsercontextmenuchange" is identical to "mozbrowsercontextmenu" which includes the attributes "label", "icon", "callback" and so on. | # The event object of "mozbrowsercontextmenuchange" is identical to "mozbrowsercontextmenu" which includes the attributes "label", "icon", "callback" and so on. | ||
# 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. | # 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. | # If an app doesn't define its own context menu, the default set of softkeys will be involved in system app. | ||