Bug#385515: Latest Sarge Mozilla-Browser Freezes On Google Maps
Eric Dorland
eric at debian.org
Fri Sep 1 18:04:42 UTC 2006
* Alexander Sack - Debian Bugmail (asac at debian.org) wrote:
>
> Attached a patch for this issue. Its the same patch that was needed
> for thunderbird.
>
> Can someone bring up a test package for firefox and mozilla with this
> patch?
I'll build firefox packages tonight.
> p.s. please take care that the bug is listed as To: or CC: when
> replying to this mail (e.g. /reply-all/).
> --- a/content/base/src/nsGenericElement.cpp
> +++ b/content/base/src/nsGenericElement.cpp
> @@ -2794,9 +2794,7 @@ nsGenericElement::doInsertBefore(nsICont
> */
> return NS_ERROR_DOM_NOT_FOUND_ERR;
> }
> - }
>
> - if(aRefChild) {
> refPos = aElement->IndexOf(refContent);
>
> if (refPos < 0) {
> @@ -2853,11 +2851,7 @@ nsGenericElement::doInsertBefore(nsICont
>
> nsMutationGuard::DidMutate();
>
> - /*
> - * Check if we're inserting a document fragment. If we are, we need
> - * to remove the children of the document fragment and add them
> - * individually (i.e. we don't add the actual document fragment).
> - */
> +
> if (nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
> nsCOMPtr<nsIDocumentFragment> doc_fragment(do_QueryInterface(newContent));
> NS_ENSURE_TRUE(doc_fragment, NS_ERROR_UNEXPECTED);
> @@ -2905,7 +2899,8 @@ nsGenericElement::doInsertBefore(nsICont
> if(guard.Mutated(1))
> {
> refPos = aElement->IndexOf(childContent);
> - refPos++;
> + if(++refPos > aElement->GetChildCount())
> + refPos = aElement->GetChildCount();
> }
> }
>
> @@ -2943,27 +2938,36 @@ nsGenericElement::doInsertBefore(nsICont
> if (oldParent) {
> nsCOMPtr<nsIDOMNode> tmpNode;
>
> - nsMutationGuard guard;
> + PRUint32 origChildCount = aElement->GetChildCount();
>
> /*
> * We don't care here if the return fails or not.
> */
> oldParent->RemoveChild(aNewChild, getter_AddRefs(tmpNode));
>
> + PRUint32 newChildCount = aElement->GetChildCount();
> +
> /*
> * Check if our child count changed during the RemoveChild call, if
> * it did then oldParent is most likely this node. In this case we
> * must check if refPos is still correct (unless it's zero).
> */
> - if (refPos && guard.Mutated(1)) {
> + if (refPos && origChildCount != newChildCount) {
> if (refContent) {
> + /*
> + * If we did get aRefChild we check if that is now at refPos - 1,
> + * this will happend if the new child was one of aRefChilds'
> + * previous siblings.
> + */
> +
> + PRInt32 oldPos = refPos;
> refPos = aElement->IndexOf(refContent);
>
> if (refPos < 0) {
> - return NS_ERROR_DOM_NOT_FOUND_ERR;
> + refPos = newChildCount;
> }
> } else {
> - refPos = aElement->GetChildCount();
> + refPos = newChildCount;
> }
> }
> }
> @@ -3085,7 +3089,7 @@ nsGenericElement::doReplaceChild(nsICont
> * the fragment and inserting it into the child list of its
> * new parent.
> */
> - for (i = 0; i < count; ++i) {
> + for (i = 0; i < count && i < newContent->GetChildCount(); ++i) {
> PRInt32 oldPosTemp;
>
> // Always get and remove the first child, since the child indexes
> _______________________________________________
> pkg-mozilla-maintainers mailing list
> pkg-mozilla-maintainers at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-mozilla-maintainers
--
Eric Dorland <eric at kuroneko.ca>
ICQ: #61138586, Jabber: hooty at jabber.com
1024D/16D970C6 097C 4861 9934 27A0 8E1C 2B0A 61E9 8ECF 16D9 70C6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/attachments/20060901/88e0be18/attachment.pgp
More information about the pkg-mozilla-maintainers
mailing list