Bug 1178382 - Ignore overflow: -moz-hidden-unscrollable on <select size=n> listboxes. r=roc

forms.css sets overflow: -moz-hidden-unscrollable on all select elements.
ApplyOverflowClipping in nsFrame.cpp applies overflow clips that are not managed by scroll frames.
nsCSSFrameConstructor::ConstructSelectFrame creates an nsListControlFrame for listbox select elements.
nsListControlFrame is an nsHTMLScrollFrame.
As a result, the clip as applied twice - once by the nsHTMLScrollFrame, and then again by ApplyOverflowClipping.
Adding an exception for nsListControlFrame to ShouldApplyOverflowClipping gets rid of the double clip.
But we still need to apply the clip when calculating the frame's visual overflow rect, so we add the
list box frame type to the list of special-cased frames in UnionBorderBoxes.
This commit is contained in:
Markus Stange 2015-07-06 17:57:37 -04:00
parent 93ae940ac1
commit f93bc01b67
2 changed files with 5 additions and 2 deletions

View File

@ -7343,6 +7343,7 @@ UnionBorderBoxes(nsIFrame* aFrame, bool aApplyTransform,
nsIAtom* fType = aFrame->GetType();
if (nsFrame::ShouldApplyOverflowClipping(aFrame, disp) ||
fType == nsGkAtoms::scrollFrame ||
fType == nsGkAtoms::listControlFrame ||
fType == nsGkAtoms::svgOuterSVGFrame) {
return u;
}

View File

@ -582,8 +582,10 @@ public:
static bool ShouldApplyOverflowClipping(const nsIFrame* aFrame,
const nsStyleDisplay* aDisp)
{
// clip overflow:-moz-hidden-unscrollable ...
if (MOZ_UNLIKELY(aDisp->mOverflowX == NS_STYLE_OVERFLOW_CLIP)) {
// clip overflow:-moz-hidden-unscrollable, except for nsListControlFrame,
// which is an nsHTMLScrollFrame.
if (MOZ_UNLIKELY(aDisp->mOverflowX == NS_STYLE_OVERFLOW_CLIP &&
aFrame->GetType() != nsGkAtoms::listControlFrame)) {
return true;
}