michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis michael@0: * michael@0: * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and michael@0: * Opera Software ASA. You are granted a license to use, reproduce michael@0: * and create derivative works of this document. michael@0: */ michael@0: michael@0: interface MenuBuilder; michael@0: michael@0: // http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element michael@0: interface HTMLMenuElement : HTMLElement { michael@0: [SetterThrows] michael@0: attribute DOMString type; michael@0: [SetterThrows] michael@0: attribute DOMString label; michael@0: }; michael@0: michael@0: // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis michael@0: partial interface HTMLMenuElement { michael@0: [SetterThrows] michael@0: attribute boolean compact; michael@0: }; michael@0: michael@0: // Mozilla specific stuff michael@0: partial interface HTMLMenuElement { michael@0: /** michael@0: * Creates and dispatches a trusted event named "show". michael@0: * The event is not cancelable and does not bubble. michael@0: * See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus michael@0: */ michael@0: [ChromeOnly] michael@0: void sendShowEvent(); michael@0: michael@0: /** michael@0: * Creates a native menu builder. The builder type is dependent on menu type. michael@0: * Currently, it returns nsXULContextMenuBuilder for context menus. michael@0: * Toolbar menus are not yet supported (the method returns null). michael@0: */ michael@0: [ChromeOnly] michael@0: MenuBuilder createBuilder(); michael@0: michael@0: /* michael@0: * Builds a menu by iterating over menu children. michael@0: * See http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#building-menus-and-toolbars michael@0: * The caller can use a native builder by calling createBuilder() or provide michael@0: * a custom builder that implements the nsIMenuBuilder interface. michael@0: * A custom builder can be used for example to build native context menus michael@0: * that are not defined using . michael@0: */ michael@0: [ChromeOnly] michael@0: void build(MenuBuilder aBuilder); michael@0: };