Bug 584494. Avoid creating opacity/transform wrappers for empty lists. r=tnikkel a2.0=blocking2.0:betaN

This commit is contained in:
Robert O'Callahan 2010-09-17 12:29:52 -07:00
Родитель 526db14d17
Коммит a64e116f6b
1 изменённых файлов: 6 добавлений и 4 удалений

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

@ -1527,8 +1527,10 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
} else
#endif
/* If there is any opacity, wrap it up in an opacity list. */
if (disp->mOpacity < 1.0f) {
/* If there is any opacity, wrap it up in an opacity list.
* If there's nothing in the list, don't add anything.
*/
if (disp->mOpacity < 1.0f && !resultList.IsEmpty()) {
rv = resultList.AppendNewToTop(
new (aBuilder) nsDisplayOpacity(aBuilder, this, &resultList));
if (NS_FAILED(rv))
@ -1536,10 +1538,10 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
}
/* If we're going to apply a transformation, wrap everything in an
* nsDisplayTransform.
* nsDisplayTransform. If there's nothing in the list, don't add anything.
*/
if ((mState & NS_FRAME_MAY_BE_TRANSFORMED) &&
disp->HasTransform()) {
disp->HasTransform() && !resultList.IsEmpty()) {
rv = resultList.AppendNewToTop(
new (aBuilder) nsDisplayTransform(aBuilder, this, &resultList));
if (NS_FAILED(rv))