mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 407015. Dropdown listboxes should not propagate computed height from the scrollframe to its scrolled content. r+sr=dbaron
This commit is contained in:
parent
58638809df
commit
21900626e0
@ -787,6 +787,12 @@ nsListControlFrame::GetScrollbarStyles() const
|
||||
verticalStyle);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsListControlFrame::ShouldPropagateComputedHeightToScrolledContent() const
|
||||
{
|
||||
return !IsInDropDownMode();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
PRBool
|
||||
nsListControlFrame::IsOptionElement(nsIContent* aContent)
|
||||
|
@ -144,6 +144,7 @@ public:
|
||||
virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
|
||||
|
||||
virtual nsGfxScrollFrameInner::ScrollbarStyles GetScrollbarStyles() const;
|
||||
virtual PRBool ShouldPropagateComputedHeightToScrolledContent() const;
|
||||
|
||||
// for accessibility purposes
|
||||
#ifdef ACCESSIBILITY
|
||||
|
@ -437,6 +437,11 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
|
||||
nscoord computedHeight = aState->mReflowState.ComputedHeight();
|
||||
nscoord computedMinHeight = aState->mReflowState.mComputedMinHeight;
|
||||
nscoord computedMaxHeight = aState->mReflowState.mComputedMaxHeight;
|
||||
if (!ShouldPropagateComputedHeightToScrolledContent()) {
|
||||
computedHeight = NS_UNCONSTRAINEDSIZE;
|
||||
computedMinHeight = 0;
|
||||
computedMaxHeight = NS_UNCONSTRAINEDSIZE;
|
||||
}
|
||||
if (aAssumeHScroll) {
|
||||
nsSize hScrollbarPrefSize =
|
||||
mInner.mHScrollbarBox->GetPrefSize(const_cast<nsBoxLayoutState&>(aState->mBoxState));
|
||||
@ -446,7 +451,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
|
||||
if (computedMaxHeight != NS_UNCONSTRAINEDSIZE)
|
||||
computedMaxHeight = PR_MAX(0, computedMaxHeight - hScrollbarPrefSize.height);
|
||||
}
|
||||
|
||||
|
||||
if (aAssumeVScroll) {
|
||||
nsSize vScrollbarPrefSize =
|
||||
mInner.mVScrollbarBox->GetPrefSize(const_cast<nsBoxLayoutState&>(aState->mBoxState));
|
||||
|
@ -401,6 +401,13 @@ protected:
|
||||
// NS_FRAME_FIRST_REFLOW set are NOT "initial" as far as we're concerned.
|
||||
PRBool InInitialReflow() const;
|
||||
|
||||
/**
|
||||
* Override this to return false if computed height/min-height/max-height
|
||||
* should NOT be propagated to child content.
|
||||
* nsListControlFrame uses this.
|
||||
*/
|
||||
virtual PRBool ShouldPropagateComputedHeightToScrolledContent() const { return PR_TRUE; }
|
||||
|
||||
private:
|
||||
friend class nsGfxScrollFrameInner;
|
||||
nsGfxScrollFrameInner mInner;
|
||||
|
Loading…
Reference in New Issue
Block a user