diff --git a/dom/public/idl/xul/nsIDOMXULContainerElement.idl b/dom/public/idl/xul/nsIDOMXULContainerElement.idl index 0fb59a0dfb0b..6c9656e16fc0 100755 --- a/dom/public/idl/xul/nsIDOMXULContainerElement.idl +++ b/dom/public/idl/xul/nsIDOMXULContainerElement.idl @@ -37,9 +37,19 @@ * ***** END LICENSE BLOCK ***** */ #include "nsIDOMXULElement.idl" +interface nsIDOMXULContainerElement; -[scriptable, uuid(edfeaf37-3b24-4466-af7a-b3851044f1c1)] -interface nsIDOMXULContainerElement : nsIDOMXULElement +[scriptable, uuid(4650e55f-4777-4271-8b62-9603a7dd4614)] +interface nsIDOMXULContainerItemElement : nsIDOMXULElement +{ + /** + * Returns the parent container if any. + */ + readonly attribute nsIDOMXULContainerElement parentContainer; +}; + +[scriptable, uuid(bc07c626-4294-43ae-9b0a-e726de0adcad)] +interface nsIDOMXULContainerElement : nsIDOMXULContainerItemElement { /** * Creates an item for the given label and value and appends it to the @@ -87,9 +97,5 @@ interface nsIDOMXULContainerElement : nsIDOMXULElement * @param aIndex - the index of the item to return */ nsIDOMXULElement getItemAtIndex(in long aIndex); - - /** - * Returns the parent container if any. - */ - readonly attribute nsIDOMXULElement parentContainer; }; + diff --git a/toolkit/content/widgets/menu.xml b/toolkit/content/widgets/menu.xml index 993fcdf07057..79b4e82b3140 100644 --- a/toolkit/content/widgets/menu.xml +++ b/toolkit/content/widgets/menu.xml @@ -15,7 +15,8 @@ - + + + + @@ -38,6 +41,17 @@ ]]> + + + + + for (var parent = this.parentNode; parent; parent = parent.parentNode) { + if (parent instanceof Components.interfaces.nsIDOMXULContainerElement) + return parent; + } + return null; + + @@ -141,16 +155,6 @@ - - - for (var parent = this.parentNode; parent; parent = parent.parentNode) { - if (parent instanceof Components.interfaces.nsIDOMXULContainerElement) - return parent; - } - return null; - - -