зеркало из https://github.com/mozilla/gecko-dev.git
Revert fix for 26947, 27271 due to bad interaction with the 'find' datasource that causes crash-on-exit. a=chofmann.
This commit is contained in:
Родитель
d0f9dcf328
Коммит
725a6b2b3d
|
@ -1416,9 +1416,19 @@ nsXULDocument::AttributeChanged(nsIContent* aElement,
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// Handle "open" and "close" cases. We do this handling before
|
||||
// we've notified the observer, so that content is already created
|
||||
// for the frame system to walk.
|
||||
// Now notify external observers
|
||||
for (PRInt32 i = 0; i < mObservers.Count(); i++) {
|
||||
nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i];
|
||||
observer->AttributeChanged(this, aElement, aNameSpaceID, aAttribute, aHint);
|
||||
if (observer != (nsIDocumentObserver*)mObservers.ElementAt(i)) {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle "special" cases. We do this handling _after_ we've
|
||||
// notified the observer to ensure that any frames that are
|
||||
// caching information (e.g., the tree widget and the 'open'
|
||||
// attribute) will notice things properly.
|
||||
if ((nameSpaceID == kNameSpaceID_XUL) && (aAttribute == kOpenAtom)) {
|
||||
nsAutoString open;
|
||||
rv = aElement->GetAttribute(kNameSpaceID_None, kOpenAtom, open);
|
||||
|
@ -1431,20 +1441,7 @@ nsXULDocument::AttributeChanged(nsIContent* aElement,
|
|||
CloseWidgetItem(aElement);
|
||||
}
|
||||
}
|
||||
|
||||
// Now notify external observers
|
||||
for (PRInt32 i = 0; i < mObservers.Count(); i++) {
|
||||
nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i];
|
||||
observer->AttributeChanged(this, aElement, aNameSpaceID, aAttribute, aHint);
|
||||
if (observer != (nsIDocumentObserver*)mObservers.ElementAt(i)) {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for a change to the 'ref' attribute on an atom, in which
|
||||
// case we may need to nuke and rebuild the entire content model
|
||||
// beneath the element.
|
||||
if (aAttribute == kRefAtom) {
|
||||
else if (aAttribute == kRefAtom) {
|
||||
RebuildWidgetItem(aElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -771,9 +771,7 @@ RDFGenericBuilderImpl::OpenContainer(nsIContent* aElement)
|
|||
rv = CreateContainerContents(aElement, resource, PR_FALSE, getter_AddRefs(container), &newIndex);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (container && IsTreeWidgetItem(aElement)) {
|
||||
// The tree widget is special, and has to be spanked every
|
||||
// time we add content to a container.
|
||||
if (container) {
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);
|
||||
if (! doc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -2464,11 +2462,22 @@ RDFGenericBuilderImpl::CreateContainerContents(nsIContent* aElement,
|
|||
*aNewIndexInContainer = -1;
|
||||
}
|
||||
|
||||
// The tree widget is special. If the item isn't open, then just
|
||||
// "pretend" that there aren't any contents here. We'll create
|
||||
// them when OpenContainer() gets called.
|
||||
if (IsTreeWidgetItem(aElement) && !IsOpen(aElement))
|
||||
return NS_OK;
|
||||
// If it's XUL, then see if the item is even "open" (HTML content
|
||||
// must be generated eagerly). If not, then just pretend it
|
||||
// doesn't have _any_ contents. We check this _before_ checking
|
||||
// the contents-generated attribute so that we don't eagerly set
|
||||
// contents-generated on a closed node.
|
||||
{
|
||||
PRInt32 nameSpaceID;
|
||||
rv = aElement->GetNameSpaceID(nameSpaceID);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get namespace ID");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (nameSpaceID == kNameSpaceID_XUL) {
|
||||
if (! IsOpen(aElement))
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// See if the element's templates contents have been generated:
|
||||
// this prevents a re-entrant call from triggering another
|
||||
|
|
|
@ -771,9 +771,7 @@ RDFGenericBuilderImpl::OpenContainer(nsIContent* aElement)
|
|||
rv = CreateContainerContents(aElement, resource, PR_FALSE, getter_AddRefs(container), &newIndex);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (container && IsTreeWidgetItem(aElement)) {
|
||||
// The tree widget is special, and has to be spanked every
|
||||
// time we add content to a container.
|
||||
if (container) {
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);
|
||||
if (! doc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -2464,11 +2462,22 @@ RDFGenericBuilderImpl::CreateContainerContents(nsIContent* aElement,
|
|||
*aNewIndexInContainer = -1;
|
||||
}
|
||||
|
||||
// The tree widget is special. If the item isn't open, then just
|
||||
// "pretend" that there aren't any contents here. We'll create
|
||||
// them when OpenContainer() gets called.
|
||||
if (IsTreeWidgetItem(aElement) && !IsOpen(aElement))
|
||||
return NS_OK;
|
||||
// If it's XUL, then see if the item is even "open" (HTML content
|
||||
// must be generated eagerly). If not, then just pretend it
|
||||
// doesn't have _any_ contents. We check this _before_ checking
|
||||
// the contents-generated attribute so that we don't eagerly set
|
||||
// contents-generated on a closed node.
|
||||
{
|
||||
PRInt32 nameSpaceID;
|
||||
rv = aElement->GetNameSpaceID(nameSpaceID);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get namespace ID");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (nameSpaceID == kNameSpaceID_XUL) {
|
||||
if (! IsOpen(aElement))
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// See if the element's templates contents have been generated:
|
||||
// this prevents a re-entrant call from triggering another
|
||||
|
|
|
@ -1416,9 +1416,19 @@ nsXULDocument::AttributeChanged(nsIContent* aElement,
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// Handle "open" and "close" cases. We do this handling before
|
||||
// we've notified the observer, so that content is already created
|
||||
// for the frame system to walk.
|
||||
// Now notify external observers
|
||||
for (PRInt32 i = 0; i < mObservers.Count(); i++) {
|
||||
nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i];
|
||||
observer->AttributeChanged(this, aElement, aNameSpaceID, aAttribute, aHint);
|
||||
if (observer != (nsIDocumentObserver*)mObservers.ElementAt(i)) {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle "special" cases. We do this handling _after_ we've
|
||||
// notified the observer to ensure that any frames that are
|
||||
// caching information (e.g., the tree widget and the 'open'
|
||||
// attribute) will notice things properly.
|
||||
if ((nameSpaceID == kNameSpaceID_XUL) && (aAttribute == kOpenAtom)) {
|
||||
nsAutoString open;
|
||||
rv = aElement->GetAttribute(kNameSpaceID_None, kOpenAtom, open);
|
||||
|
@ -1431,20 +1441,7 @@ nsXULDocument::AttributeChanged(nsIContent* aElement,
|
|||
CloseWidgetItem(aElement);
|
||||
}
|
||||
}
|
||||
|
||||
// Now notify external observers
|
||||
for (PRInt32 i = 0; i < mObservers.Count(); i++) {
|
||||
nsIDocumentObserver* observer = (nsIDocumentObserver*)mObservers[i];
|
||||
observer->AttributeChanged(this, aElement, aNameSpaceID, aAttribute, aHint);
|
||||
if (observer != (nsIDocumentObserver*)mObservers.ElementAt(i)) {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for a change to the 'ref' attribute on an atom, in which
|
||||
// case we may need to nuke and rebuild the entire content model
|
||||
// beneath the element.
|
||||
if (aAttribute == kRefAtom) {
|
||||
else if (aAttribute == kRefAtom) {
|
||||
RebuildWidgetItem(aElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -771,9 +771,7 @@ RDFGenericBuilderImpl::OpenContainer(nsIContent* aElement)
|
|||
rv = CreateContainerContents(aElement, resource, PR_FALSE, getter_AddRefs(container), &newIndex);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (container && IsTreeWidgetItem(aElement)) {
|
||||
// The tree widget is special, and has to be spanked every
|
||||
// time we add content to a container.
|
||||
if (container) {
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);
|
||||
if (! doc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -2464,11 +2462,22 @@ RDFGenericBuilderImpl::CreateContainerContents(nsIContent* aElement,
|
|||
*aNewIndexInContainer = -1;
|
||||
}
|
||||
|
||||
// The tree widget is special. If the item isn't open, then just
|
||||
// "pretend" that there aren't any contents here. We'll create
|
||||
// them when OpenContainer() gets called.
|
||||
if (IsTreeWidgetItem(aElement) && !IsOpen(aElement))
|
||||
return NS_OK;
|
||||
// If it's XUL, then see if the item is even "open" (HTML content
|
||||
// must be generated eagerly). If not, then just pretend it
|
||||
// doesn't have _any_ contents. We check this _before_ checking
|
||||
// the contents-generated attribute so that we don't eagerly set
|
||||
// contents-generated on a closed node.
|
||||
{
|
||||
PRInt32 nameSpaceID;
|
||||
rv = aElement->GetNameSpaceID(nameSpaceID);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get namespace ID");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (nameSpaceID == kNameSpaceID_XUL) {
|
||||
if (! IsOpen(aElement))
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// See if the element's templates contents have been generated:
|
||||
// this prevents a re-entrant call from triggering another
|
||||
|
|
Загрузка…
Ссылка в новой задаче