Fix dynamic style changes resulting from change to href attribute on HTML links. b=194972 r+sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@139036 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2003-03-06 19:19:55 +00:00
parent 089db98924
commit de7999bf43
2 changed files with 26 additions and 0 deletions

View File

@@ -4052,6 +4052,19 @@ CSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
NS_PRECONDITION(aData->mContent->IsContentOfType(nsIContent::eELEMENT),
"content must be element");
// Since we always have :-moz-any-link (and almost always have :link
// and :visited rules from prefs), rather than hacking AddRule below
// to add |href| to the hash, we'll just handle it here.
if (aData->mAttribute == nsHTMLAtoms::href &&
aData->mIsHTMLContent &&
(aData->mContentTag == nsHTMLAtoms::a ||
aData->mContentTag == nsHTMLAtoms::area ||
aData->mContentTag == nsHTMLAtoms::link)) {
*aResult = PR_TRUE;
return NS_OK;
}
// XXX What about XLinks?
RuleCascadeData* cascade = GetRuleCascade(aData->mPresContext, aMedium);
// We do the same thing for attributes that we do for state selectors

View File

@@ -4052,6 +4052,19 @@ CSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
NS_PRECONDITION(aData->mContent->IsContentOfType(nsIContent::eELEMENT),
"content must be element");
// Since we always have :-moz-any-link (and almost always have :link
// and :visited rules from prefs), rather than hacking AddRule below
// to add |href| to the hash, we'll just handle it here.
if (aData->mAttribute == nsHTMLAtoms::href &&
aData->mIsHTMLContent &&
(aData->mContentTag == nsHTMLAtoms::a ||
aData->mContentTag == nsHTMLAtoms::area ||
aData->mContentTag == nsHTMLAtoms::link)) {
*aResult = PR_TRUE;
return NS_OK;
}
// XXX What about XLinks?
RuleCascadeData* cascade = GetRuleCascade(aData->mPresContext, aMedium);
// We do the same thing for attributes that we do for state selectors