diff --git a/layout/inspector/public/inIDOMUtils.idl b/layout/inspector/public/inIDOMUtils.idl index 3d8882ba0cd6..8d7775e028bb 100644 --- a/layout/inspector/public/inIDOMUtils.idl +++ b/layout/inspector/public/inIDOMUtils.idl @@ -38,7 +38,7 @@ #include "nsISupports.idl" -interface nsISimpleEnumerator; +interface nsIArray; interface nsISupportsArray; interface nsIDOMCharacterData; interface nsIDOMElement; @@ -46,7 +46,7 @@ interface nsIDOMDocument; interface nsIDOMCSSStyleRule; interface nsIDOMNode; -[scriptable, uuid(FFFFD059-13D1-4ef7-ACB1-91188C6E31DD)] +[scriptable, uuid(78fd16c2-bdfb-4b1d-8738-d536d0a8f430)] interface inIDOMUtils : nsISupports { // CSS utilities @@ -62,7 +62,7 @@ interface inIDOMUtils : nsISupports in boolean aShowingAnonymousContent); // XBL utilities - nsISimpleEnumerator getBindingURLs(in nsIDOMElement aElement); + nsIArray getBindingURLs(in nsIDOMElement aElement); // content state utilities long getContentState(in nsIDOMElement aElement); diff --git a/layout/inspector/src/inDOMUtils.cpp b/layout/inspector/src/inDOMUtils.cpp index 5e6f4d034de2..01b173daac0d 100644 --- a/layout/inspector/src/inDOMUtils.cpp +++ b/layout/inspector/src/inDOMUtils.cpp @@ -46,8 +46,6 @@ #include "nsIDOMDocument.h" #include "nsIDOMCharacterData.h" #include "nsITextContent.h" -#include "nsEnumeratorUtils.h" -#include "nsIXBLBinding.h" #include "nsRuleNode.h" #include "nsIStyleRule.h" #include "nsICSSStyleRule.h" @@ -210,40 +208,9 @@ inDOMUtils::GetRuleLine(nsIDOMCSSStyleRule *aRule, PRUint32 *_retval) } NS_IMETHODIMP -inDOMUtils::GetBindingURLs(nsIDOMElement *aElement, nsISimpleEnumerator **_retval) +inDOMUtils::GetBindingURLs(nsIDOMElement *aElement, nsIArray **_retval) { - nsCOMPtr urls; - NS_NewISupportsArray(getter_AddRefs(urls)); - nsCOMPtr e; - NS_NewArrayEnumerator(getter_AddRefs(e), urls); - - *_retval = e; - NS_ADDREF(*_retval); - - nsCOMPtr doc1; - aElement->GetOwnerDocument(getter_AddRefs(doc1)); - if (!doc1) return NS_OK; - - nsCOMPtr doc = do_QueryInterface(doc1); - nsIBindingManager *bindingManager = doc->BindingManager(); - - nsCOMPtr content = do_QueryInterface(aElement); - nsCOMPtr binding; - bindingManager->GetBinding(content, getter_AddRefs(binding)); - - nsCOMPtr tempBinding; - while (binding) { - nsCAutoString uri; - binding->BindingURI()->GetSpec(uri); - - nsCOMPtr atom = do_GetAtom(uri.get()); - urls->AppendElement(atom); - - binding->GetBaseBinding(getter_AddRefs(tempBinding)); - binding = tempBinding; - } - - return NS_OK; + return mCSSUtils->GetBindingURLs(aElement, _retval); } NS_IMETHODIMP