Make XBL anonymous content get its base URI from the XBL document (the binding
URI) instead of from the document of the bound element. This way relative URIs in a binding are always relative to the binding. Bug 211128, r=caillon, sr=jst git-svn-id: svn://10.0.0.236/trunk@144753 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -5127,23 +5127,26 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell
|
||||
continue;
|
||||
|
||||
content->SetNativeAnonymous(PR_TRUE);
|
||||
content->SetParent(aParent);
|
||||
content->SetDocument(aDocument, PR_TRUE, PR_TRUE);
|
||||
|
||||
// Set the binding parent first, since setting the parent may cause
|
||||
// relative URIs to change (due to xml:base) and |child| may need to be
|
||||
// able to tell that it's anonymous content as it recomputes its base
|
||||
// URI.
|
||||
nsIContent* bindingParent = content;
|
||||
#ifdef MOZ_XUL
|
||||
// Only cut XUL scrollbars off if they're not in a XUL document. This allows
|
||||
// scrollbars to be styled from XUL (although not from XML or HTML).
|
||||
nsCOMPtr<nsIAtom> tag;
|
||||
content->GetTag(getter_AddRefs(tag));
|
||||
if (tag.get() == nsXULAtoms::scrollbar) {
|
||||
if (tag == nsXULAtoms::scrollbar) {
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDoc(do_QueryInterface(aDocument));
|
||||
if (xulDoc)
|
||||
content->SetBindingParent(aParent);
|
||||
else content->SetBindingParent(content);
|
||||
if (xulDoc) {
|
||||
bindingParent = aParent;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
content->SetBindingParent(content);
|
||||
content->SetBindingParent(bindingParent);
|
||||
content->SetParent(aParent);
|
||||
|
||||
nsIFrame * newFrame = nsnull;
|
||||
nsresult rv = creator->CreateFrameFor(aPresContext, content, &newFrame);
|
||||
|
||||
Reference in New Issue
Block a user