void nsSVGRenderingObserver::StartListening() { Element* target = GetTarget(); if (target) { target->AddMutationObserver(this); } }
nsresult nsAttributeTextNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent) { MOZ_ASSERT( aParent && aParent->GetParent(), "This node can't be a child of the document or of the document root"); nsresult rv = nsTextNode::BindToTree(aDocument, aParent, aBindingParent); NS_ENSURE_SUCCESS(rv, rv); NS_ASSERTION(!mGrandparent, "We were already bound!"); mGrandparent = aParent->GetParent()->AsElement(); mGrandparent->AddMutationObserver(this); // Note that there is no need to notify here, since we have no // frame yet at this point. UpdateText(false); return NS_OK; }