Bug 596478: delay nsImageFrame's IsPercentageAware check until after we've lazily initialized mIntrinsicSize. r=roc a=dbaron

This commit is contained in:
Daniel Holbert 2011-02-15 13:34:52 -08:00
Родитель 2558ae86f4
Коммит 9784cf45cc
2 изменённых файлов: 12 добавлений и 9 удалений

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

@ -743,14 +743,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
printf("\n");
#endif
// See if this frame depends on the width of its containing block. If
// so, disable resize reflow optimizations for the line. (Note that,
// to be conservative, we do this if we *try* to fit a frame on a
// line, even if we don't succeed.)
if (GetFlag(LL_GOTLINEBOX) && IsPercentageAware(aFrame)) {
mLineBox->DisableResizeReflowOptimization();
}
mTextJustificationNumSpaces = 0;
mTextJustificationNumLetters = 0;
@ -824,6 +816,17 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
// so no need to propagate NS_FRAME_IS_DIRTY from the parent.
}
// See if this frame depends on the width of its containing block. If
// so, disable resize reflow optimizations for the line. (Note that,
// to be conservative, we do this if we *try* to fit a frame on a
// line, even if we don't succeed.) (Note also that we can only make
// this IsPercentageAware check *after* we've constructed our
// nsHTMLReflowState, because that construction may be what forces aFrame
// to lazily initialize its (possibly-percent-valued) intrinsic size.)
if (GetFlag(LL_GOTLINEBOX) && IsPercentageAware(aFrame)) {
mLineBox->DisableResizeReflowOptimization();
}
// Let frame know that are reflowing it. Note that we don't bother
// positioning the frame yet, because we're probably going to end up
// moving it when we do the vertical alignment

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

@ -58,7 +58,7 @@ asserts(72) == img-and-image-1.html img-and-image-1-ref.svg
# More complex <img> tests
random-if(gtk2Widget) == img-anim-1.html lime100x100-ref.html # bug 612214
== img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html
random == img-dyn-1.html img-dyn-1-ref.html # Bug 596478
== img-dyn-1.html img-dyn-1-ref.html
fails-if(d2d) == img-widthAndHeight-meet-1.html img-widthAndHeight-meet-1-ref.html # bug 633072
== img-widthAndHeight-meet-2.html img-widthAndHeight-meet-2-ref.html