nsCOMPtr<nsIXBLBinding> binding; GetBinding(aCurrContent, getter_AddRefs(binding)); if (binding) { aData->mScopedRoot = aCurrContent; binding->WalkRules(aFunc, aData);
nsIContent *content = aData->mContent; if (!content) return NS_OK;  nsCOMPtr<nsIContent> parent = GetOutermostStyleScope(content);  WalkRules(aFunc, aData, parent, content);   aData->mScopedRoot = nsnull;  if (parent) {   nsCOMPtr<nsIHTMLContentContainer> container( do_QueryInterface(content->GetDocument())); if (container) { nsCOMPtr<nsIHTMLCSSStyleSheet> inlineSheet; container->GetInlineStyleSheet(getter_AddRefs(inlineSheet)); nsCOMPtr<nsIStyleRuleProcessor> inlineCSS(do_QueryInterface(inlineSheet)); if (inlineCSS) (*aFunc)((nsISupports*)(inlineCSS.get()), aData); }
nsBindingManager::WalkRules(nsISupportsArrayEnumFunc aFunc,                            RuleProcessorData* aData,                            nsIContent* aParent, nsIContent* aCurrContent){  nsCOMPtr<nsIXBLBinding> binding;  GetBinding(aCurrContent, getter_AddRefs(binding));  if (binding) {    aData->mScopedRoot = aCurrContent;    binding->WalkRules(aFunc, aData);  }  if (aParent != aCurrContent) {    nsCOMPtr<nsIContent> par;    GetEnclosingScope(aCurrContent, getter_AddRefs(par));    if (par)      WalkRules(aFunc, aData, aParent, par);  }}