Make scroll frames (i.e., overflow != visible) no longer be font size inflation flow roots. This reverts part of 9499f6b28addcbcd9c480eb80cfe6c4c63a4a3a1. (Bug 747720, patch 7) r=roc

This means that font size inflation will be consistent into a container
with overflow!=visible, which fixes inflation bugs on phoronix.com (bug
747720) and reddit.com (bug 748446, but currently covered up by bug
756518).
This commit is contained in:
L. David Baron 2012-05-20 22:18:28 -07:00
Родитель d9efb3b534
Коммит 8df7a82031
5 изменённых файлов: 26 добавлений и 36 удалений

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

@ -128,16 +128,6 @@ nsHTMLScrollFrame::DestroyFrom(nsIFrame* 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
nsHTMLScrollFrame::SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList)
@ -1073,16 +1063,6 @@ nsXULScrollFrame::DestroyFrom(nsIFrame* 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
nsXULScrollFrame::SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList)
@ -1677,14 +1657,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
*/

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

@ -77,8 +77,6 @@ public:
nsGfxScrollFrameInner(nsContainerFrame* aOuter, bool aIsRoot);
~nsGfxScrollFrameInner();
void Init();
typedef nsIScrollableFrame::ScrollbarStyles ScrollbarStyles;
ScrollbarStyles GetScrollbarStylesFromFrame() const;
@ -384,9 +382,6 @@ public:
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList);
@ -619,9 +614,6 @@ public:
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList);

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

@ -94,3 +94,4 @@ fuzzy-if(gtk2Widget,1,8) test-pref(font.size.inflation.emPerLine,15) test-pref(f
fuzzy-if(gtk2Widget,1,8) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-at-2.html threshold-select-combobox-contents-at-2-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == relevant-width-1.html relevant-width-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == relevant-width-overflow-1.html relevant-width-overflow-1-ref.html

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

@ -0,0 +1,9 @@
<!DOCTYPE HTML>
<style>
div { font-size: 34px; width: 450px }
div.inner { width: 300px; overflow: hidden; }
</style>
<div class="middle">
Text in middle.
<div class="inner">Text in inner.</div>
</div>

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

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<style>
div.outer { font-size: 12px; width: 600px }
div.middle { width: 450px; }
div.inner { width: 300px; overflow: hidden; }
</style>
<!--
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.
-->
<div class="outer">
<div class="middle">
Text in middle.
<div class="inner">Text in inner.</div>
</div>
</div>