dom/webidl/HTMLMenuElement.webidl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 4 * You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 5 *
michael@0 6 * The origin of this IDL file is
michael@0 7 * http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element
michael@0 8 * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
michael@0 9 *
michael@0 10 * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
michael@0 11 * Opera Software ASA. You are granted a license to use, reproduce
michael@0 12 * and create derivative works of this document.
michael@0 13 */
michael@0 14
michael@0 15 interface MenuBuilder;
michael@0 16
michael@0 17 // http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element
michael@0 18 interface HTMLMenuElement : HTMLElement {
michael@0 19 [SetterThrows]
michael@0 20 attribute DOMString type;
michael@0 21 [SetterThrows]
michael@0 22 attribute DOMString label;
michael@0 23 };
michael@0 24
michael@0 25 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
michael@0 26 partial interface HTMLMenuElement {
michael@0 27 [SetterThrows]
michael@0 28 attribute boolean compact;
michael@0 29 };
michael@0 30
michael@0 31 // Mozilla specific stuff
michael@0 32 partial interface HTMLMenuElement {
michael@0 33 /**
michael@0 34 * Creates and dispatches a trusted event named "show".
michael@0 35 * The event is not cancelable and does not bubble.
michael@0 36 * See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus
michael@0 37 */
michael@0 38 [ChromeOnly]
michael@0 39 void sendShowEvent();
michael@0 40
michael@0 41 /**
michael@0 42 * Creates a native menu builder. The builder type is dependent on menu type.
michael@0 43 * Currently, it returns nsXULContextMenuBuilder for context menus.
michael@0 44 * Toolbar menus are not yet supported (the method returns null).
michael@0 45 */
michael@0 46 [ChromeOnly]
michael@0 47 MenuBuilder createBuilder();
michael@0 48
michael@0 49 /*
michael@0 50 * Builds a menu by iterating over menu children.
michael@0 51 * See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#building-menus-and-toolbars
michael@0 52 * The caller can use a native builder by calling createBuilder() or provide
michael@0 53 * a custom builder that implements the nsIMenuBuilder interface.
michael@0 54 * A custom builder can be used for example to build native context menus
michael@0 55 * that are not defined using <menupopup>.
michael@0 56 */
michael@0 57 [ChromeOnly]
michael@0 58 void build(MenuBuilder aBuilder);
michael@0 59 };

mercurial