Bug 482394. Drop the aForStyling check in IsHTMLLink/IsLink: if we change the link state, we need to start tracking the link. r+sr=dbaron

This commit is contained in:
Boris Zbarsky 2009-03-10 09:51:34 -04:00
Родитель eb4ceff899
Коммит 8b2e29fc7f
4 изменённых файлов: 7 добавлений и 15 удалений

Просмотреть файл

@ -40,14 +40,14 @@ var unvisitedColor = document.defaultView.getComputedStyle($("t"), "").color;
var visitedColor;
function afterSecondLoad() {
todo(document.defaultView.getComputedStyle($("t"), "").color == visitedColor,
is(document.defaultView.getComputedStyle($("t"), "").color, visitedColor,
"Should be visited now");
SimpleTest.finish();
}
function afterFirstLoad() {
visitedColor = document.defaultView.getComputedStyle($("t"), "").color;
todo(visitedColor != unvisitedColor, "Why are the colors the same?");
isnot(visitedColor, unvisitedColor, "Why are the colors the same?");
$("newparent").appendChild($("t"));
is($("t").href, "http://www.example.com/" + rand,
"Unexpected href after move");

Просмотреть файл

@ -914,8 +914,7 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext,
mPresContext ? mPresContext->GetLinkHandler() : nsnull;
if (mIsHTMLContent && mHasAttributes) {
// check if it is an HTML Link
if(nsStyleUtil::IsHTMLLink(aContent, mContentTag,
linkHandler, aRuleWalker != nsnull,
if(nsStyleUtil::IsHTMLLink(aContent, mContentTag, linkHandler,
&mLinkState)) {
mIsLink = PR_TRUE;
}
@ -926,8 +925,7 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext,
if(!mIsLink &&
mHasAttributes &&
!(mIsHTMLContent || aContent->IsNodeOfType(nsINode::eXUL)) &&
nsStyleUtil::IsLink(aContent, linkHandler,
aRuleWalker != nsnull, &mLinkState)) {
nsStyleUtil::IsLink(aContent, linkHandler, &mLinkState)) {
mIsLink = PR_TRUE;
}
}

Просмотреть файл

@ -431,7 +431,6 @@ GetLinkStateFromURI(nsIURI* aURI, nsIContent* aContent,
/*static*/
PRBool nsStyleUtil::IsHTMLLink(nsIContent *aContent, nsIAtom *aTag,
nsILinkHandler *aLinkHandler,
PRBool aForStyling,
nsLinkState *aState)
{
NS_ASSERTION(aContent && aState, "null arg in IsHTMLLink");
@ -466,8 +465,7 @@ PRBool nsStyleUtil::IsHTMLLink(nsIContent *aContent, nsIAtom *aTag,
} else {
linkState = eLinkState_NotLink;
}
if (linkState != eLinkState_NotLink && aForStyling &&
aContent->IsInDoc()) {
if (linkState != eLinkState_NotLink && aContent->IsInDoc()) {
aContent->GetCurrentDoc()->AddStyleRelevantLink(aContent, hrefURI);
}
link->SetLinkState(linkState);
@ -485,7 +483,6 @@ PRBool nsStyleUtil::IsHTMLLink(nsIContent *aContent, nsIAtom *aTag,
/*static*/
PRBool nsStyleUtil::IsLink(nsIContent *aContent,
nsILinkHandler *aLinkHandler,
PRBool aForStyling,
nsLinkState *aState)
{
// XXX PERF This function will cause serious performance problems on
@ -500,7 +497,7 @@ PRBool nsStyleUtil::IsLink(nsIContent *aContent,
nsCOMPtr<nsIURI> absURI;
if (aContent->IsLink(getter_AddRefs(absURI))) {
*aState = GetLinkStateFromURI(absURI, aContent, aLinkHandler);
if (aForStyling && aContent->IsInDoc()) {
if (aContent->IsInDoc()) {
aContent->GetCurrentDoc()->AddStyleRelevantLink(aContent, absURI);
}

Просмотреть файл

@ -69,14 +69,11 @@ public:
static PRInt32 ConstrainFontWeight(PRInt32 aWeight);
// If aForStyling is false, don't add the link to the document's
// list of links to notify on history changes.
static PRBool IsHTMLLink(nsIContent *aContent, nsIAtom *aTag,
nsILinkHandler *aLinkHandler,
PRBool aForStyling,
nsLinkState *aState);
static PRBool IsLink(nsIContent *aContent, nsILinkHandler *aLinkHandler,
PRBool aForStyling, nsLinkState *aState);
nsLinkState *aState);
static PRBool DashMatchCompare(const nsAString& aAttributeValue,
const nsAString& aSelectorValue,