Fixes for several bugs.
This commit is contained in:
Родитель
fee9669b1c
Коммит
5da36a6d57
|
@ -3060,13 +3060,18 @@ XULDocumentImpl::CreatePopupDocument(nsIContent* aPopupElement, nsIDocument** aR
|
|||
return rv;
|
||||
}
|
||||
// Now we need to copy all of the style sheets from the parent document
|
||||
/*PRInt32 count = mStyleSheets.Count();
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
PRInt32 count = mStyleSheets.Count();
|
||||
for (PRInt32 i = 1; i < count-1; i++) {
|
||||
// Don't bother addrefing. We don't live as long as our parent document
|
||||
nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(i);
|
||||
sheet->SetOwningDocument(popupDoc);
|
||||
popupDoc->mStyleSheets.AppendElement(sheet);
|
||||
}*/
|
||||
nsCOMPtr<nsICSSStyleSheet> cssSheet = do_QueryInterface(sheet);
|
||||
if (cssSheet) {
|
||||
nsCOMPtr<nsICSSStyleSheet> clonedSheet;
|
||||
if (NS_SUCCEEDED(cssSheet->Clone(*getter_AddRefs(clonedSheet)))) {
|
||||
popupDoc->AddStyleSheet(clonedSheet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We don't share builders, but we do share the DB that the current
|
||||
// XUL builder has.
|
||||
|
|
|
@ -622,33 +622,6 @@ RDFXULBuilderImpl::CreateContents(nsIContent* aElement)
|
|||
rv = GetContainingNameSpace(aElement, getter_AddRefs(containingNameSpace));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Iterate through all of the element's children, and construct
|
||||
// appropriate children for each arc.
|
||||
nsCOMPtr<nsISimpleEnumerator> children;
|
||||
rv = NS_NewContainerEnumerator(mDB, resource, getter_AddRefs(children));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create cursor for children");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
while (1) {
|
||||
PRBool hasMore;
|
||||
rv = children->HasMoreElements(&hasMore);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (! hasMore)
|
||||
break;
|
||||
|
||||
nsCOMPtr<nsISupports> isupports;
|
||||
rv = children->GetNext(getter_AddRefs(isupports));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "error reading cursor");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIRDFNode> child = do_QueryInterface(isupports);
|
||||
|
||||
rv = AppendChild(containingNameSpace, aElement, child);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "problem appending child to content model");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// If we're the root content, then prepend a special hidden form
|
||||
// element.
|
||||
if (aElement == mRoot.get()) {
|
||||
|
@ -681,6 +654,33 @@ RDFXULBuilderImpl::CreateContents(nsIContent* aElement)
|
|||
}
|
||||
}
|
||||
|
||||
// Iterate through all of the element's children, and construct
|
||||
// appropriate children for each arc.
|
||||
nsCOMPtr<nsISimpleEnumerator> children;
|
||||
rv = NS_NewContainerEnumerator(mDB, resource, getter_AddRefs(children));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create cursor for children");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
while (1) {
|
||||
PRBool hasMore;
|
||||
rv = children->HasMoreElements(&hasMore);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (! hasMore)
|
||||
break;
|
||||
|
||||
nsCOMPtr<nsISupports> isupports;
|
||||
rv = children->GetNext(getter_AddRefs(isupports));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "error reading cursor");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIRDFNode> child = do_QueryInterface(isupports);
|
||||
|
||||
rv = AppendChild(containingNameSpace, aElement, child);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "problem appending child to content model");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// Now that we've built the children, check to see if the includesrc attribute
|
||||
// exists on the node.
|
||||
nsString includeSrc;
|
||||
|
|
|
@ -3060,13 +3060,18 @@ XULDocumentImpl::CreatePopupDocument(nsIContent* aPopupElement, nsIDocument** aR
|
|||
return rv;
|
||||
}
|
||||
// Now we need to copy all of the style sheets from the parent document
|
||||
/*PRInt32 count = mStyleSheets.Count();
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
PRInt32 count = mStyleSheets.Count();
|
||||
for (PRInt32 i = 1; i < count-1; i++) {
|
||||
// Don't bother addrefing. We don't live as long as our parent document
|
||||
nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(i);
|
||||
sheet->SetOwningDocument(popupDoc);
|
||||
popupDoc->mStyleSheets.AppendElement(sheet);
|
||||
}*/
|
||||
nsCOMPtr<nsICSSStyleSheet> cssSheet = do_QueryInterface(sheet);
|
||||
if (cssSheet) {
|
||||
nsCOMPtr<nsICSSStyleSheet> clonedSheet;
|
||||
if (NS_SUCCEEDED(cssSheet->Clone(*getter_AddRefs(clonedSheet)))) {
|
||||
popupDoc->AddStyleSheet(clonedSheet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We don't share builders, but we do share the DB that the current
|
||||
// XUL builder has.
|
||||
|
|
Загрузка…
Ссылка в новой задаче