Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't mark intrinsic widths dirty for font inflation width changes at…

… box/block boundaries. (Bug 764354) r=bzbarsky a=johnath

--HG--
branch : MOBILE140_2012061216_RELBRANCH
extra : transplant_source : g%E3%E2e%9DL%C5%09%9D%EE%9F%60%B8%87%1E%D5%A51%C5%11
  • Loading branch information...
commit be48fc59163bbb0b03b0ca423a97ee90e39296ac 1 parent 4b1eb13
@dbaron dbaron authored
View
9 layout/generic/nsFrame.cpp
@@ -7577,7 +7577,8 @@ nsFrame::DoLayout(nsBoxLayoutState& aState)
// Set up a |reflowState| to pass into ReflowAbsoluteFrames
nsHTMLReflowState reflowState(aState.PresContext(), this,
aState.GetRenderingContext(),
- nsSize(size.width, NS_UNCONSTRAINEDSIZE));
+ nsSize(size.width, NS_UNCONSTRAINEDSIZE),
+ nsHTMLReflowState::DUMMY_PARENT_REFLOW_STATE);
// Set up a |reflowStatus| to pass into ReflowAbsoluteFrames
// (just a dummy value; hopefully that's OK)
@@ -7682,7 +7683,8 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
nsFrameState savedState = parentFrame->GetStateBits();
nsHTMLReflowState parentReflowState(aPresContext, parentFrame,
aRenderingContext,
- parentSize);
+ parentSize,
+ nsHTMLReflowState::DUMMY_PARENT_REFLOW_STATE);
parentFrame->RemoveStateBits(~nsFrameState(0));
parentFrame->AddStateBits(savedState);
@@ -7702,7 +7704,8 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
// (It used to have a bogus parent, skipping all the boxes).
nsSize availSize(aWidth, NS_INTRINSICSIZE);
nsHTMLReflowState reflowState(aPresContext, this, aRenderingContext,
- availSize);
+ availSize,
+ nsHTMLReflowState::DUMMY_PARENT_REFLOW_STATE);
// Construct the parent chain manually since constructing it normally
// messes up dimensions.
View
17 layout/generic/nsHTMLReflowState.cpp
@@ -86,7 +86,8 @@ static eNormalLineHeightControl sNormalLineHeightControl = eUninitialized;
nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext,
nsIFrame* aFrame,
nsRenderingContext* aRenderingContext,
- const nsSize& aAvailableSpace)
+ const nsSize& aAvailableSpace,
+ PRUint32 aFlags)
: nsCSSOffsetState(aFrame, aRenderingContext)
, mBlockDelta(0)
, mReflowDepth(0)
@@ -102,6 +103,11 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext,
memset(&mFlags, 0, sizeof(mFlags));
mDiscoveredClearance = nsnull;
mPercentHeightObserver = nsnull;
+
+ if (aFlags & DUMMY_PARENT_REFLOW_STATE) {
+ mFlags.mDummyParentReflowState = true;
+ }
+
Init(aPresContext);
}
@@ -162,6 +168,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext,
mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = false;
mFlags.mHasClearance = false;
mFlags.mIsColumnBalancing = false;
+ mFlags.mDummyParentReflowState = false;
mDiscoveredClearance = nsnull;
mPercentHeightObserver = (aParentReflowState.mPercentHeightObserver &&
@@ -401,7 +408,13 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT
nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
// Create our font inflation data if we don't have it already, and
// give it our current width information.
- bool dirty = nsFontInflationData::UpdateFontInflationDataWidthFor(*this);
+ bool dirty = nsFontInflationData::UpdateFontInflationDataWidthFor(*this) &&
+ // Avoid running this at the box-to-block interface
+ // (where we shouldn't be inflating anyway, and where
+ // reflow state construction is probably to construct a
+ // dummy parent reflow state anyway).
+ !mFlags.mDummyParentReflowState;
+
if (dirty || (!frame->GetParent() && isHResize)) {
// When font size inflation is enabled, a change in either:
// * the effective width of a font inflation flow root
View
11 layout/generic/nsHTMLReflowState.h
@@ -368,6 +368,9 @@ struct nsHTMLReflowState : public nsCSSOffsetState {
PRUint16 mHeightDependsOnAncestorCell:1; // Does frame height depend on
// an ancestor table-cell?
PRUint16 mIsColumnBalancing:1; // nsColumnSetFrame is balancing columns
+ PRUint16 mDummyParentReflowState:1; // a "fake" reflow state made
+ // in order to be the parent
+ // of a real one
} mFlags;
// Note: The copy constructor is written by the compiler automatically. You
@@ -379,7 +382,8 @@ struct nsHTMLReflowState : public nsCSSOffsetState {
nsHTMLReflowState(nsPresContext* aPresContext,
nsIFrame* aFrame,
nsRenderingContext* aRenderingContext,
- const nsSize& aAvailableSpace);
+ const nsSize& aAvailableSpace,
+ PRUint32 aFlags = 0);
// Initialize a reflow state for a child frames reflow. Some state
// is copied from the parent reflow state; the remaining state is
@@ -394,6 +398,11 @@ struct nsHTMLReflowState : public nsCSSOffsetState {
nscoord aContainingBlockHeight = -1,
bool aInit = true);
+ // Values for |aFlags| passed to constructor
+ enum {
+ DUMMY_PARENT_REFLOW_STATE = (1<<0)
+ };
+
// This method initializes various data members. It is automatically
// called by the various constructors
void Init(nsPresContext* aPresContext,
Please sign in to comment.
Something went wrong with that request. Please try again.