Back out 30e441f7ad9d (bug 759755) and 08286f4e696b (bug 760098) for orange
This commit is contained in:
@@ -38,7 +38,7 @@ nsFontInflationData::FindFontInflationDataFor(const nsIFrame *aFrame)
|
|||||||
bfc->Properties().Get(FontInflationDataProperty()));
|
bfc->Properties().Get(FontInflationDataProperty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool
|
/* static */ void
|
||||||
nsFontInflationData::UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aReflowState)
|
nsFontInflationData::UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aReflowState)
|
||||||
{
|
{
|
||||||
nsIFrame *bfc = aReflowState.frame;
|
nsIFrame *bfc = aReflowState.frame;
|
||||||
@@ -47,22 +47,12 @@ nsFontInflationData::UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aR
|
|||||||
FrameProperties bfcProps(bfc->Properties());
|
FrameProperties bfcProps(bfc->Properties());
|
||||||
nsFontInflationData *data = static_cast<nsFontInflationData*>(
|
nsFontInflationData *data = static_cast<nsFontInflationData*>(
|
||||||
bfcProps.Get(FontInflationDataProperty()));
|
bfcProps.Get(FontInflationDataProperty()));
|
||||||
bool oldInflationEnabled;
|
if (!data) {
|
||||||
nscoord oldNCAWidth;
|
|
||||||
if (data) {
|
|
||||||
oldNCAWidth = data->mNCAWidth;
|
|
||||||
oldInflationEnabled = data->mInflationEnabled;
|
|
||||||
} else {
|
|
||||||
data = new nsFontInflationData(bfc);
|
data = new nsFontInflationData(bfc);
|
||||||
bfcProps.Set(FontInflationDataProperty(), data);
|
bfcProps.Set(FontInflationDataProperty(), data);
|
||||||
oldNCAWidth = -1;
|
|
||||||
oldInflationEnabled = true; /* not relevant */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data->UpdateWidth(aReflowState);
|
data->UpdateWidth(aReflowState);
|
||||||
|
|
||||||
return oldNCAWidth != data->mNCAWidth ||
|
|
||||||
oldInflationEnabled != data->mInflationEnabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void
|
/* static */ void
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ public:
|
|||||||
|
|
||||||
static nsFontInflationData* FindFontInflationDataFor(const nsIFrame *aFrame);
|
static nsFontInflationData* FindFontInflationDataFor(const nsIFrame *aFrame);
|
||||||
|
|
||||||
// Returns whether the effective width changed (which requires the
|
static void
|
||||||
// caller to mark its descendants dirty
|
|
||||||
static bool
|
|
||||||
UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aReflowState);
|
UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aReflowState);
|
||||||
|
|
||||||
static void MarkFontInflationDataTextDirty(nsIFrame *aFrame);
|
static void MarkFontInflationDataTextDirty(nsIFrame *aFrame);
|
||||||
|
|||||||
@@ -94,16 +94,6 @@ nsHTMLScrollFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
|||||||
nsContainerFrame::DestroyFrom(aDestructRoot);
|
nsContainerFrame::DestroyFrom(aDestructRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsHTMLScrollFrame::Init(nsIContent* aContent,
|
|
||||||
nsIFrame* aParent,
|
|
||||||
nsIFrame* aPrevInFlow)
|
|
||||||
{
|
|
||||||
nsresult rv = nsContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
|
||||||
mInner.Init();
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHTMLScrollFrame::SetInitialChildList(ChildListID aListID,
|
nsHTMLScrollFrame::SetInitialChildList(ChildListID aListID,
|
||||||
nsFrameList& aChildList)
|
nsFrameList& aChildList)
|
||||||
@@ -1039,16 +1029,6 @@ nsXULScrollFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
|||||||
nsBoxFrame::DestroyFrom(aDestructRoot);
|
nsBoxFrame::DestroyFrom(aDestructRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsXULScrollFrame::Init(nsIContent* aContent,
|
|
||||||
nsIFrame* aParent,
|
|
||||||
nsIFrame* aPrevInFlow)
|
|
||||||
{
|
|
||||||
nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
|
|
||||||
mInner.Init();
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULScrollFrame::SetInitialChildList(ChildListID aListID,
|
nsXULScrollFrame::SetInitialChildList(ChildListID aListID,
|
||||||
nsFrameList& aChildList)
|
nsFrameList& aChildList)
|
||||||
@@ -1643,14 +1623,6 @@ nsGfxScrollFrameInner::~nsGfxScrollFrameInner()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsGfxScrollFrameInner::Init()
|
|
||||||
{
|
|
||||||
if (mOuter->GetStateBits() & NS_FRAME_FONT_INFLATION_CONTAINER) {
|
|
||||||
mOuter->AddStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Callback function from AsyncScroll, used in nsGfxScrollFrameInner::ScrollTo
|
* Callback function from AsyncScroll, used in nsGfxScrollFrameInner::ScrollTo
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ public:
|
|||||||
nsGfxScrollFrameInner(nsContainerFrame* aOuter, bool aIsRoot);
|
nsGfxScrollFrameInner(nsContainerFrame* aOuter, bool aIsRoot);
|
||||||
~nsGfxScrollFrameInner();
|
~nsGfxScrollFrameInner();
|
||||||
|
|
||||||
void Init();
|
|
||||||
|
|
||||||
typedef nsIScrollableFrame::ScrollbarStyles ScrollbarStyles;
|
typedef nsIScrollableFrame::ScrollbarStyles ScrollbarStyles;
|
||||||
ScrollbarStyles GetScrollbarStylesFromFrame() const;
|
ScrollbarStyles GetScrollbarStylesFromFrame() const;
|
||||||
|
|
||||||
@@ -352,9 +350,6 @@ public:
|
|||||||
|
|
||||||
// Called to set the child frames. We typically have three: the scroll area,
|
// Called to set the child frames. We typically have three: the scroll area,
|
||||||
// the vertical scrollbar, and the horizontal scrollbar.
|
// the vertical scrollbar, and the horizontal scrollbar.
|
||||||
NS_IMETHOD Init(nsIContent* aContent,
|
|
||||||
nsIFrame* aParent,
|
|
||||||
nsIFrame* aPrevInFlow);
|
|
||||||
NS_IMETHOD SetInitialChildList(ChildListID aListID,
|
NS_IMETHOD SetInitialChildList(ChildListID aListID,
|
||||||
nsFrameList& aChildList);
|
nsFrameList& aChildList);
|
||||||
|
|
||||||
@@ -587,9 +582,6 @@ public:
|
|||||||
|
|
||||||
// Called to set the child frames. We typically have three: the scroll area,
|
// Called to set the child frames. We typically have three: the scroll area,
|
||||||
// the vertical scrollbar, and the horizontal scrollbar.
|
// the vertical scrollbar, and the horizontal scrollbar.
|
||||||
NS_IMETHOD Init(nsIContent* aContent,
|
|
||||||
nsIFrame* aParent,
|
|
||||||
nsIFrame* aPrevInFlow);
|
|
||||||
NS_IMETHOD SetInitialChildList(ChildListID aListID,
|
NS_IMETHOD SetInitialChildList(ChildListID aListID,
|
||||||
nsFrameList& aChildList);
|
nsFrameList& aChildList);
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,12 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext,
|
|||||||
"have unconstrained width; this should only result from "
|
"have unconstrained width; this should only result from "
|
||||||
"very large sizes, not attempts at intrinsic width "
|
"very large sizes, not attempts at intrinsic width "
|
||||||
"calculation");
|
"calculation");
|
||||||
|
|
||||||
|
if (frame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) {
|
||||||
|
// Create our font inflation data if we don't have it already, and
|
||||||
|
// give it our current width information.
|
||||||
|
nsFontInflationData::UpdateFontInflationDataWidthFor(*this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsHTMLReflowState::InitCBReflowState()
|
void nsHTMLReflowState::InitCBReflowState()
|
||||||
@@ -358,20 +364,6 @@ IsQuirkContainingBlockHeight(const nsHTMLReflowState* rs, nsIAtom* aFrameType)
|
|||||||
void
|
void
|
||||||
nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
|
||||||
{
|
{
|
||||||
if (frame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) {
|
|
||||||
// Create our font inflation data if we don't have it already, and
|
|
||||||
// give it our current width information.
|
|
||||||
bool dirty = nsFontInflationData::UpdateFontInflationDataWidthFor(*this);
|
|
||||||
if (dirty) {
|
|
||||||
// FIXME: This isn't so great for the cases where
|
|
||||||
// nsHTMLReflowState::SetComputedWith is called, if the first time
|
|
||||||
// we go through InitResizeFlags we set mHResize to true, and then
|
|
||||||
// the second time we'd set it to false even without the
|
|
||||||
// NS_FRAME_IS_DIRTY bit already set.
|
|
||||||
frame->AddStateBits(NS_FRAME_IS_DIRTY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mFlags.mHResize = !(frame->GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
mFlags.mHResize = !(frame->GetStateBits() & NS_FRAME_IS_DIRTY) &&
|
||||||
frame->GetSize().width !=
|
frame->GetSize().width !=
|
||||||
mComputedWidth + mComputedBorderPadding.LeftRight();
|
mComputedWidth + mComputedBorderPadding.LeftRight();
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<style>
|
<style>
|
||||||
div { font-size: 44px; width: 600px }
|
div { font-size: 34px; width: 450px }
|
||||||
div.inner { font-size: 34px; width: 450px; overflow: hidden; }
|
div.inner { width: 300px; overflow: hidden; }
|
||||||
</style>
|
</style>
|
||||||
<div class="outer">
|
<div class="middle">
|
||||||
Text in outer.
|
Text in middle.
|
||||||
<div class="inner">Text in inner.</div>
|
<div class="inner">Text in inner.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<style>
|
<style>
|
||||||
div.outer { font-size: 12px; width: 600px }
|
div.outer { font-size: 12px; width: 600px }
|
||||||
div.inner { width: 450px; overflow: hidden; }
|
div.middle { width: 450px; }
|
||||||
|
div.inner { width: 300px; overflow: hidden; }
|
||||||
</style>
|
</style>
|
||||||
<!--
|
<!--
|
||||||
In a 450px container, the minimum font size at 15em per line is 30px.
|
In a 450px container, the minimum font size at 15em per line is 30px.
|
||||||
This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
|
This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
|
||||||
|
|
||||||
In a 600px container, the minimum font size at 15em per line is 40px.
|
|
||||||
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
|
|
||||||
-->
|
-->
|
||||||
<div class="outer">
|
<div class="outer">
|
||||||
Text in outer.
|
<div class="middle">
|
||||||
|
Text in middle.
|
||||||
<div class="inner">Text in inner.</div>
|
<div class="inner">Text in inner.</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user