Fix event state changes on some UI buttons by not overwriting a true result from HasStateDependentStyle with a false one. b=137067 r=bzbarsky sr=waterson

git-svn-id: svn://10.0.0.236/trunk@118997 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2002-04-15 22:28:54 +00:00
parent 0b1e282591
commit a1c65dd9f5
2 changed files with 22 additions and 6 deletions

View File

@@ -1448,9 +1448,17 @@ static PRBool SheetHasStatefulStyle(nsISupports* aProcessor, void *aData)
{
nsIStyleRuleProcessor* processor = (nsIStyleRuleProcessor*)aProcessor;
StatefulData* data = (StatefulData*)aData;
processor->HasStateDependentStyle(data, data->mMedium, &data->mStateful);
if (data->mStateful)
return PR_FALSE; // stop iteration
PRBool hasStateful;
processor->HasStateDependentStyle(data, data->mMedium, &hasStateful);
if (hasStateful) {
data->mStateful = PR_TRUE;
// Stop iteration. Note that StyleSetImpl::WalkRuleProcessors uses
// this to stop its own iteration in some cases, but not all (the
// style rule supplier case). Since this optimization is only for
// the case where we have a lot more work to do, it's not worth the
// code needed to make the stopping perfect.
return PR_FALSE;
}
return PR_TRUE; // continue
}

View File

@@ -1448,9 +1448,17 @@ static PRBool SheetHasStatefulStyle(nsISupports* aProcessor, void *aData)
{
nsIStyleRuleProcessor* processor = (nsIStyleRuleProcessor*)aProcessor;
StatefulData* data = (StatefulData*)aData;
processor->HasStateDependentStyle(data, data->mMedium, &data->mStateful);
if (data->mStateful)
return PR_FALSE; // stop iteration
PRBool hasStateful;
processor->HasStateDependentStyle(data, data->mMedium, &hasStateful);
if (hasStateful) {
data->mStateful = PR_TRUE;
// Stop iteration. Note that StyleSetImpl::WalkRuleProcessors uses
// this to stop its own iteration in some cases, but not all (the
// style rule supplier case). Since this optimization is only for
// the case where we have a lot more work to do, it's not worth the
// code needed to make the stopping perfect.
return PR_FALSE;
}
return PR_TRUE; // continue
}