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
This commit is contained in:
bzbarsky@mit.edu
2003-07-11 23:06:26 +00:00
parent 300e771fe3
commit c2b121f09b
11 changed files with 78 additions and 33 deletions

View File

@@ -152,9 +152,12 @@ nsHTMLEditor::CreateAnonymousElement(const nsAString & aTag, nsIDOMNode * aPare
// establish parenthood of the element
newContent->SetNativeAnonymous(PR_TRUE);
newContent->SetParent(parentContent);
newContent->SetDocument(doc, PR_TRUE, PR_TRUE);
// Set the binding parent first, since setting the parent may cause relative
// URIs to change (due to xml:base) and |newContent| may need to be able to
// tell that it's anonymous content as it recomputes its base URI.
newContent->SetBindingParent(newContent);
newContent->SetParent(parentContent);
// display the element
ps->RecreateFramesFor(newContent);