mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-01 11:27:55 +00:00
Fix for 46505. r=mjudge
This commit is contained in:
parent
b8a1340749
commit
83a557be58
@ -629,6 +629,18 @@ nsBindingManager::WalkRules(nsIStyleSet* aStyleSet,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -5434,6 +5434,14 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell,
|
||||
|
||||
content->SetParent(aParent);
|
||||
content->SetDocument(aDocument, PR_TRUE, PR_TRUE);
|
||||
content->SetBindingParent(content);
|
||||
nsCOMPtr<nsIContent> child;
|
||||
PRInt32 childCount;
|
||||
content->ChildCount(childCount);
|
||||
for (PRInt32 j = 0; j < childCount; j++) {
|
||||
content->ChildAt(j, *getter_AddRefs(child));
|
||||
child->SetParent(content);
|
||||
}
|
||||
|
||||
nsIFrame * newFrame = nsnull;
|
||||
nsresult rv = creator->CreateFrameFor(aPresContext, content, &newFrame);
|
||||
|
@ -5434,6 +5434,14 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell,
|
||||
|
||||
content->SetParent(aParent);
|
||||
content->SetDocument(aDocument, PR_TRUE, PR_TRUE);
|
||||
content->SetBindingParent(content);
|
||||
nsCOMPtr<nsIContent> child;
|
||||
PRInt32 childCount;
|
||||
content->ChildCount(childCount);
|
||||
for (PRInt32 j = 0; j < childCount; j++) {
|
||||
content->ChildAt(j, *getter_AddRefs(child));
|
||||
child->SetParent(content);
|
||||
}
|
||||
|
||||
nsIFrame * newFrame = nsnull;
|
||||
nsresult rv = creator->CreateFrameFor(aPresContext, content, &newFrame);
|
||||
|
@ -629,6 +629,18 @@ nsBindingManager::WalkRules(nsIStyleSet* aStyleSet,
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user