зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 50be346999f6 (bug 515494). This fix is not what we want.
This commit is contained in:
Родитель
06a77cb9eb
Коммит
66070e1f91
|
@ -2694,6 +2694,10 @@ nsGenericElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
|
||||||
// anonymous content that the document is changing.
|
// anonymous content that the document is changing.
|
||||||
document->BindingManager()->ChangeDocumentFor(this, document, nsnull);
|
document->BindingManager()->ChangeDocumentFor(this, document, nsnull);
|
||||||
|
|
||||||
|
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
||||||
|
document->ForgetLink(this);
|
||||||
|
}
|
||||||
|
|
||||||
document->ClearBoxObjectFor(this);
|
document->ClearBoxObjectFor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4303,6 +4307,20 @@ nsGenericElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
NS_ASSERTION(aNamespaceID != kNameSpaceID_Unknown,
|
NS_ASSERTION(aNamespaceID != kNameSpaceID_Unknown,
|
||||||
"Don't call SetAttr with unknown namespace");
|
"Don't call SetAttr with unknown namespace");
|
||||||
|
|
||||||
|
nsIDocument* doc = GetCurrentDoc();
|
||||||
|
if (kNameSpaceID_XLink == aNamespaceID && nsGkAtoms::href == aName) {
|
||||||
|
// XLink URI(s) might be changing. Drop the link from the map. If it
|
||||||
|
// is still style relevant it will be re-added by
|
||||||
|
// nsStyleUtil::IsLink. Make sure to keep the style system
|
||||||
|
// consistent so this remains true! In particular if the style system
|
||||||
|
// were to get smarter and not restyling an XLink element if the href
|
||||||
|
// doesn't change in a "significant" way, we'd need to do the same
|
||||||
|
// significance check here.
|
||||||
|
if (doc) {
|
||||||
|
doc->ForgetLink(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nsAutoString oldValue;
|
nsAutoString oldValue;
|
||||||
PRBool modification = PR_FALSE;
|
PRBool modification = PR_FALSE;
|
||||||
PRBool hasListeners = aNotify &&
|
PRBool hasListeners = aNotify &&
|
||||||
|
@ -4617,6 +4635,12 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||||
nsIDOMMutationEvent::REMOVAL);
|
nsIDOMMutationEvent::REMOVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (document && kNameSpaceID_XLink == aNameSpaceID &&
|
||||||
|
nsGkAtoms::href == aName) {
|
||||||
|
// XLink URI might be changing.
|
||||||
|
document->ForgetLink(this);
|
||||||
|
}
|
||||||
|
|
||||||
// When notifying, make sure to keep track of states whose value
|
// When notifying, make sure to keep track of states whose value
|
||||||
// depends solely on the value of an attribute.
|
// depends solely on the value of an attribute.
|
||||||
PRUint32 stateMask;
|
PRUint32 stateMask;
|
||||||
|
|
|
@ -103,57 +103,6 @@ nsMathMLElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsMathMLElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
|
|
||||||
{
|
|
||||||
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
|
||||||
nsIDocument* doc = GetCurrentDoc();
|
|
||||||
if (doc) {
|
|
||||||
doc->ForgetLink(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nsMathMLElementBase::UnbindFromTree(aDeep, aNullParent);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
|
||||||
nsMathMLElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
|
||||||
PRBool aNotify)
|
|
||||||
{
|
|
||||||
if (kNameSpaceID_XLink == aNamespaceID && nsGkAtoms::href == aName) {
|
|
||||||
// XLink URI(s) might be changing. Drop the link from the map. If it
|
|
||||||
// is still style relevant it will be re-added by
|
|
||||||
// nsStyleUtil::IsLink. Make sure to keep the style system
|
|
||||||
// consistent so this remains true! In particular if the style system
|
|
||||||
// were to get smarter and not restyling an XLink element if the href
|
|
||||||
// doesn't change in a "significant" way, we'd need to do the same
|
|
||||||
// significance check here.
|
|
||||||
nsIDocument* doc = GetCurrentDoc();
|
|
||||||
if (doc) {
|
|
||||||
doc->ForgetLink(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsMathMLElementBase::SetAttr(aNamespaceID, aName, aPrefix, aValue,
|
|
||||||
aNotify);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
|
||||||
nsMathMLElement::UnsetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|
||||||
PRBool aNotify)
|
|
||||||
{
|
|
||||||
if (kNameSpaceID_XLink == aNamespaceID && nsGkAtoms::href == aName) {
|
|
||||||
nsIDocument* doc = GetCurrentDoc();
|
|
||||||
if (doc) {
|
|
||||||
// XLink URI might be changing.
|
|
||||||
doc->ForgetLink(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsMathMLElementBase::UnsetAttr(aNamespaceID, aName, aNotify);
|
|
||||||
}
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsMathMLElement::ParseAttribute(PRInt32 aNamespaceID,
|
nsMathMLElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
nsIAtom* aAttribute,
|
nsIAtom* aAttribute,
|
||||||
|
|
|
@ -70,16 +70,6 @@ public:
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
PRBool aCompileEventHandlers);
|
PRBool aCompileEventHandlers);
|
||||||
|
|
||||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
|
||||||
PRBool aNullParent = PR_TRUE);
|
|
||||||
|
|
||||||
virtual nsresult SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|
||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
|
||||||
PRBool aNotify);
|
|
||||||
|
|
||||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
|
||||||
PRBool aNotify);
|
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
nsIAtom* aAttribute,
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
|
|
|
@ -122,57 +122,6 @@ nsSVGAElement::GetTarget(nsIDOMSVGAnimatedString * *aTarget)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsIContent methods
|
// nsIContent methods
|
||||||
|
|
||||||
void
|
|
||||||
nsSVGAElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
|
|
||||||
{
|
|
||||||
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
|
||||||
nsIDocument *doc = GetCurrentDoc();
|
|
||||||
if (doc) {
|
|
||||||
doc->ForgetLink(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nsSVGAElementBase::UnbindFromTree(aDeep, aNullParent);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
|
||||||
nsSVGAElement::SetAttr(PRInt32 aNamespaceID, nsIAtom *aName,
|
|
||||||
nsIAtom *aPrefix, const nsAString& aValue,
|
|
||||||
PRBool aNotify)
|
|
||||||
{
|
|
||||||
if (kNameSpaceID_XLink == aNamespaceID && nsGkAtoms::href == aName) {
|
|
||||||
// XLink URI(s) might be changing. Drop the link from the map. If it
|
|
||||||
// is still style relevant it will be re-added by
|
|
||||||
// nsStyleUtil::IsLink. Make sure to keep the style system
|
|
||||||
// consistent so this remains true! In particular if the style system
|
|
||||||
// were to get smarter and not restyling an XLink element if the href
|
|
||||||
// doesn't change in a "significant" way, we'd need to do the same
|
|
||||||
// significance check here.
|
|
||||||
nsIDocument *doc = GetCurrentDoc();
|
|
||||||
if (doc) {
|
|
||||||
doc->ForgetLink(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsSVGAElementBase::SetAttr(aNamespaceID, aName, aPrefix, aValue,
|
|
||||||
aNotify);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
|
||||||
nsSVGAElement::UnsetAttr(PRInt32 aNamespaceID, nsIAtom *aName,
|
|
||||||
PRBool aNotify)
|
|
||||||
{
|
|
||||||
if (kNameSpaceID_XLink == aNamespaceID && nsGkAtoms::href == aName) {
|
|
||||||
nsIDocument *doc = GetCurrentDoc();
|
|
||||||
if (doc) {
|
|
||||||
// XLink URI might be changing.
|
|
||||||
doc->ForgetLink(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsSVGAElementBase::UnsetAttr(aNamespaceID, aName, aNotify);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsLinkState
|
nsLinkState
|
||||||
nsSVGAElement::GetLinkState() const
|
nsSVGAElement::GetLinkState() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,13 +75,6 @@ public:
|
||||||
NS_IMETHOD LinkRemoved() { return NS_OK; }
|
NS_IMETHOD LinkRemoved() { return NS_OK; }
|
||||||
|
|
||||||
// nsIContent
|
// nsIContent
|
||||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
|
||||||
PRBool aNullParent = PR_TRUE);
|
|
||||||
virtual nsresult SetAttr(PRInt32 aNamespaceID, nsIAtom *aName,
|
|
||||||
nsIAtom *aPrefix, const nsAString& aValue,
|
|
||||||
PRBool aNotify);
|
|
||||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom *aName,
|
|
||||||
PRBool aNotify);
|
|
||||||
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
||||||
virtual PRBool IsLink(nsIURI** aURI) const;
|
virtual PRBool IsLink(nsIURI** aURI) const;
|
||||||
virtual void GetLinkTarget(nsAString& aTarget);
|
virtual void GetLinkTarget(nsAString& aTarget);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче