Combine the code that tests inlines for dependence on the containing block width in order to disable resize reflow optimizations, and add to that code things that shrink wrap (inline-block, inline-table, buttons, fieldsets). Also move the percentage-height tests out, and into InitResizeFlags. b=163504 r+sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@219046 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2007-01-27 18:40:26 +00:00
parent 3052400d5e
commit c380d24c54
7 changed files with 87 additions and 181 deletions

View File

@@ -515,35 +515,6 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
return rv;
}
static
void SetContainsPercentAwareChild(nsIFrame *aFrame)
{
aFrame->AddStateBits(NS_INLINE_FRAME_CONTAINS_PERCENT_AWARE_CHILD);
}
static
void MarkPercentAwareFrame(nsPresContext *aPresContext,
nsInlineFrame *aInline,
nsIFrame *aFrame)
{
if (aFrame->IsFrameOfType(nsIFrame::eReplaced))
{ // aFrame is a replaced element, check it's style
if (nsLineLayout::IsPercentageAwareReplacedElement(aPresContext, aFrame)) {
SetContainsPercentAwareChild(aInline);
}
}
else
{
if (aFrame->GetFirstChild(nsnull))
{ // aFrame is an inline container frame, check my frame state
if (aFrame->GetStateBits() & NS_INLINE_FRAME_CONTAINS_PERCENT_AWARE_CHILD) {
SetContainsPercentAwareChild(aInline); // if a child container is effected, so am I
}
}
// else frame is a leaf that we don't care about
}
}
nsresult
nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
@@ -557,15 +528,6 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
nsresult rv =
lineLayout->ReflowFrame(aFrame, aStatus, nsnull, pushedFrame);
/* This next block is for bug 28811
Test the child frame for %-awareness,
and mark this frame with a bit if it is %-aware.
Don't bother if this frame is already marked
*/
if (!(mState & NS_INLINE_FRAME_CONTAINS_PERCENT_AWARE_CHILD)) {
MarkPercentAwareFrame(aPresContext, this, aFrame);
}
if (NS_FAILED(rv)) {
return rv;
}