nsCOMPtr<nsIContent> parent; GetOutermostStyleScope(aContent, getter_AddRefs(parent));
nsIContent *content = aData->mContent;  do { nsXBLBinding *binding = nsBindingManager::GetBinding(content); if (binding) { aData->mScopedRoot = content; binding->WalkRules(aFunc, aData);   if (content != aData->mContent) { if (!binding->InheritsStyle()) {  break; } } }
nsBindingManager::WalkRules(nsIStyleSet* aStyleSet,                            nsISupportsArrayEnumFunc aFunc, void* aData,                            nsIContent* aContent){  if (!aContent)    return NS_OK;  nsCOMPtr<nsIContent> parent;  GetOutermostStyleScope(aContent, getter_AddRefs(parent));  WalkRules(aFunc, aData, parent, aContent);  if (parent) {    // We cut ourselves off, but we still need to walk the document's attribute sheet    // so that inline style continues to work on anonymous content.    nsCOMPtr<nsIDocument> document;    aContent->GetDocument(*getter_AddRefs(document));    nsCOMPtr<nsIHTMLContentContainer> container(do_QueryInterface(document));    nsCOMPtr<nsIHTMLCSSStyleSheet> inlineSheet;    container->GetInlineStyleSheet(getter_AddRefs(inlineSheet));      nsCOMPtr<nsIStyleRuleProcessor> inlineCSS(do_QueryInterface(inlineSheet));    (*aFunc)((nsISupports*)(inlineCSS.get()), aData);  }  return NS_OK;}