зеркало из https://github.com/mozilla/pjs.git
115804 - nsStyleBorder::CalcDifference not accounting for mBorderColors, r=ben, sr=hyatt
This commit is contained in:
Родитель
251414564d
Коммит
af7305af17
|
@ -318,6 +318,19 @@ struct nsBorderColors {
|
|||
~nsBorderColors() {
|
||||
delete mNext;
|
||||
}
|
||||
|
||||
PRBool Equals(nsBorderColors* aOther) {
|
||||
nsBorderColors* c1 = this;
|
||||
nsBorderColors* c2 = aOther;
|
||||
while (c1 && c2) {
|
||||
if (c1->mColor != c2->mColor ||
|
||||
c1->mTransparent != c2->mTransparent)
|
||||
return PR_FALSE;
|
||||
c1 = c1->mNext;
|
||||
c2 = c2->mNext;
|
||||
}
|
||||
return !c1 && !c2;
|
||||
}
|
||||
};
|
||||
|
||||
struct nsStyleBorder: public nsStyleStruct {
|
||||
|
|
|
@ -572,6 +572,24 @@ PRInt32 nsStyleBorder::CalcDifference(const nsStyleBorder& aOther) const
|
|||
if (mBorderRadius != aOther.mBorderRadius) {
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
}
|
||||
if (mBorderColors && !aOther.mBorderColors ||
|
||||
!mBorderColors && aOther.mBorderColors) {
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
}
|
||||
|
||||
if (mBorderColors && aOther.mBorderColors) {
|
||||
for (ix = 0; ix < 4; ix++) {
|
||||
if (mBorderColors[ix] && !aOther.mBorderColors[ix] ||
|
||||
!mBorderColors[ix] && aOther.mBorderColors[ix]) {
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
} else if (mBorderColors[ix] && aOther.mBorderColors[ix]) {
|
||||
if (!mBorderColors[ix]->Equals(aOther.mBorderColors[ix]))
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_STYLE_HINT_NONE;
|
||||
}
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
|
|
|
@ -572,6 +572,24 @@ PRInt32 nsStyleBorder::CalcDifference(const nsStyleBorder& aOther) const
|
|||
if (mBorderRadius != aOther.mBorderRadius) {
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
}
|
||||
if (mBorderColors && !aOther.mBorderColors ||
|
||||
!mBorderColors && aOther.mBorderColors) {
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
}
|
||||
|
||||
if (mBorderColors && aOther.mBorderColors) {
|
||||
for (ix = 0; ix < 4; ix++) {
|
||||
if (mBorderColors[ix] && !aOther.mBorderColors[ix] ||
|
||||
!mBorderColors[ix] && aOther.mBorderColors[ix]) {
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
} else if (mBorderColors[ix] && aOther.mBorderColors[ix]) {
|
||||
if (!mBorderColors[ix]->Equals(aOther.mBorderColors[ix]))
|
||||
return NS_STYLE_HINT_VISUAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_STYLE_HINT_NONE;
|
||||
}
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
|
|
|
@ -318,6 +318,19 @@ struct nsBorderColors {
|
|||
~nsBorderColors() {
|
||||
delete mNext;
|
||||
}
|
||||
|
||||
PRBool Equals(nsBorderColors* aOther) {
|
||||
nsBorderColors* c1 = this;
|
||||
nsBorderColors* c2 = aOther;
|
||||
while (c1 && c2) {
|
||||
if (c1->mColor != c2->mColor ||
|
||||
c1->mTransparent != c2->mTransparent)
|
||||
return PR_FALSE;
|
||||
c1 = c1->mNext;
|
||||
c2 = c2->mNext;
|
||||
}
|
||||
return !c1 && !c2;
|
||||
}
|
||||
};
|
||||
|
||||
struct nsStyleBorder: public nsStyleStruct {
|
||||
|
|
Загрузка…
Ссылка в новой задаче