Don't do XUL collapsing stuff with HTML text inputs or HTML scrollframes. Bug
335628, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@218737 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
07c77ee36e
commit
d9d0d2a935
@ -1763,9 +1763,9 @@ nsTextControlFrame::GetMinWidth(nsIRenderingContext* aRenderingContext)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
DO_GLOBAL_REFLOW_COUNT("nsTextControlFrame");
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
||||
@ -1791,12 +1791,6 @@ nsTextControlFrame::GetPrefSize(nsBoxLayoutState& aState)
|
||||
|
||||
nsSize pref(0,0);
|
||||
|
||||
// XXXbz this is almost certainly wrong.
|
||||
PRBool collapsed = PR_FALSE;
|
||||
IsCollapsed(aState, collapsed);
|
||||
if (collapsed)
|
||||
return pref;
|
||||
|
||||
nsresult rv = CalcIntrinsicSize(aState.GetRenderingContext(), pref);
|
||||
NS_ENSURE_SUCCESS(rv, pref);
|
||||
AddBorderAndPadding(pref);
|
||||
@ -1848,6 +1842,15 @@ nsTextControlFrame::GetAscent(nsBoxLayoutState& aState, nscoord& aAscent)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTextControlFrame::IsCollapsed(nsBoxLayoutState& aBoxLayoutState,
|
||||
PRBool& aCollapsed)
|
||||
{
|
||||
// We're never collapsed in the box sense.
|
||||
aCollapsed = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsTextControlFrame::IsLeaf() const
|
||||
{
|
||||
|
||||
@ -90,6 +90,8 @@ public:
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
NS_IMETHOD GetAscent(nsBoxLayoutState& aBoxLayoutState, nscoord& aAscent);
|
||||
NS_IMETHOD IsCollapsed(nsBoxLayoutState& aBoxLayoutState,
|
||||
PRBool& aCollapsed);
|
||||
|
||||
DECL_DO_GLOBAL_REFLOW_COUNT_DSP(nsTextControlFrame, nsStackFrame)
|
||||
|
||||
|
||||
@ -692,6 +692,15 @@ nsHTMLScrollFrame::GetPadding(nsMargin& aMargin)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::IsCollapsed(nsBoxLayoutState& aBoxLayoutState,
|
||||
PRBool& aCollapsed)
|
||||
{
|
||||
// We're never collapsed in the box sense.
|
||||
aCollapsed = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
||||
@ -250,11 +250,13 @@ public:
|
||||
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
|
||||
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
|
||||
NS_IMETHOD GetPadding(nsMargin& aPadding);
|
||||
|
||||
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD IsCollapsed(nsBoxLayoutState& aBoxLayoutState,
|
||||
PRBool& aCollapsed);
|
||||
|
||||
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// Because there can be only one child frame, these two function return
|
||||
// NS_ERROR_FAILURE
|
||||
|
||||
7
mozilla/layout/reftests/bugs/335628-1-ref.html
Normal file
7
mozilla/layout/reftests/bugs/335628-1-ref.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div>a<input type="text" style="visibility: hidden">b</div>
|
||||
<div>a<input type="text" style="visibility: hidden; padding-top: 200px">b</div>
|
||||
</body>
|
||||
</html>
|
||||
7
mozilla/layout/reftests/bugs/335628-1.html
Normal file
7
mozilla/layout/reftests/bugs/335628-1.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div>a<input type="text" style="visibility: collapse">b</div>
|
||||
<div>a<input type="text" style="visibility: collapse; padding-top: 200px">b</div>
|
||||
</body>
|
||||
</html>
|
||||
7
mozilla/layout/reftests/bugs/335628-2-ref.xul
Normal file
7
mozilla/layout/reftests/bugs/335628-2-ref.xul
Normal file
@ -0,0 +1,7 @@
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<hbox orient="horizontal">
|
||||
<label value="a"/>
|
||||
<textbox style="visibility: hidden"/>
|
||||
<label value="b"/>
|
||||
</hbox>
|
||||
</window>
|
||||
7
mozilla/layout/reftests/bugs/335628-2.xul
Normal file
7
mozilla/layout/reftests/bugs/335628-2.xul
Normal file
@ -0,0 +1,7 @@
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<hbox orient="horizontal">
|
||||
<label value="a"/>
|
||||
<textbox style="visibility: collapse"/>
|
||||
<label value="b"/>
|
||||
</hbox>
|
||||
</window>
|
||||
@ -40,6 +40,8 @@ f== bugs/360065-1.html bugs/360065-1-ref.html # bug 18217
|
||||
== bugs/346774-1b.html bugs/346774-1-ref.html
|
||||
== bugs/346774-1c.html bugs/346774-1-ref.html
|
||||
== bugs/273681-1.html bugs/273681-1-ref.html
|
||||
== bugs/335628-1.html bugs/335628-1-ref.html
|
||||
!= bugs/335628-2.xul bugs/335628-2-ref.xul
|
||||
|
||||
# table-dom/
|
||||
== table-dom/appendCells1.html table-dom/appendCells1-ref.html
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user