This commit is contained in:
hyatt%netscape.com 1999-06-04 22:05:47 +00:00
Родитель fee9669b1c
Коммит 5da36a6d57
3 изменённых файлов: 47 добавлений и 37 удалений

Просмотреть файл

@ -3060,13 +3060,18 @@ XULDocumentImpl::CreatePopupDocument(nsIContent* aPopupElement, nsIDocument** aR
return rv; return rv;
} }
// Now we need to copy all of the style sheets from the parent document // Now we need to copy all of the style sheets from the parent document
/*PRInt32 count = mStyleSheets.Count(); PRInt32 count = mStyleSheets.Count();
for (PRInt32 i = 0; i < count; i++) { for (PRInt32 i = 1; i < count-1; i++) {
// Don't bother addrefing. We don't live as long as our parent document // Don't bother addrefing. We don't live as long as our parent document
nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(i); nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(i);
sheet->SetOwningDocument(popupDoc); nsCOMPtr<nsICSSStyleSheet> cssSheet = do_QueryInterface(sheet);
popupDoc->mStyleSheets.AppendElement(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 // We don't share builders, but we do share the DB that the current
// XUL builder has. // XUL builder has.

Просмотреть файл

@ -622,33 +622,6 @@ RDFXULBuilderImpl::CreateContents(nsIContent* aElement)
rv = GetContainingNameSpace(aElement, getter_AddRefs(containingNameSpace)); rv = GetContainingNameSpace(aElement, getter_AddRefs(containingNameSpace));
if (NS_FAILED(rv)) return rv; 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 // If we're the root content, then prepend a special hidden form
// element. // element.
if (aElement == mRoot.get()) { 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 // Now that we've built the children, check to see if the includesrc attribute
// exists on the node. // exists on the node.
nsString includeSrc; nsString includeSrc;

Просмотреть файл

@ -3060,13 +3060,18 @@ XULDocumentImpl::CreatePopupDocument(nsIContent* aPopupElement, nsIDocument** aR
return rv; return rv;
} }
// Now we need to copy all of the style sheets from the parent document // Now we need to copy all of the style sheets from the parent document
/*PRInt32 count = mStyleSheets.Count(); PRInt32 count = mStyleSheets.Count();
for (PRInt32 i = 0; i < count; i++) { for (PRInt32 i = 1; i < count-1; i++) {
// Don't bother addrefing. We don't live as long as our parent document // Don't bother addrefing. We don't live as long as our parent document
nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(i); nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(i);
sheet->SetOwningDocument(popupDoc); nsCOMPtr<nsICSSStyleSheet> cssSheet = do_QueryInterface(sheet);
popupDoc->mStyleSheets.AppendElement(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 // We don't share builders, but we do share the DB that the current
// XUL builder has. // XUL builder has.