diff -r 000000000000 -r 6474c204b198 toolkit/content/widgets/menu.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolkit/content/widgets/menu.xml Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + for (var parent = this.parentNode; parent; parent = parent.parentNode) { + if (parent instanceof Components.interfaces.nsIDOMXULContainerElement) + return parent; + } + return null; + + + + + + + + + + + + + + + + + + + + + + return this.insertItemAt(-1, aLabel, aValue); + + + + + + + + + const XUL_NS = + "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + + var menupopup = this.menupopup; + if (!menupopup) { + menupopup = this.ownerDocument.createElementNS(XUL_NS, "menupopup"); + this.appendChild(menupopup); + } + + var menuitem = this.ownerDocument.createElementNS(XUL_NS, "menuitem"); + menuitem.setAttribute("label", aLabel); + menuitem.setAttribute("value", aValue); + + var before = this.getItemAtIndex(aIndex); + if (before) + return menupopup.insertBefore(menuitem, before); + return menupopup.appendChild(menuitem); + + + + + + + + + + + + + var menupopup = this.menupopup; + return menupopup ? menupopup.childNodes.length : 0; + + + + + + + + + + + + + + = menupopup.childNodes.length) + return null; + + return menupopup.childNodes[aIndex]; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +