moved form registration code to Reflow instead of GetPrefSize, it wasn't being called correctly when wi/h was being set via style

b=45846 r=kin
This commit is contained in:
rods%netscape.com 2000-07-20 21:17:03 +00:00
Родитель dd80cb982c
Коммит 406ab8e512
2 изменённых файлов: 24 добавлений и 7 удалений

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

@ -1766,6 +1766,25 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP
nsGfxTextControlFrame2::Reflow(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsGfxTextControlFrame2", aReflowState.reason);
// make sure the the form registers itself on the initial/first reflow
if (mState & NS_FRAME_FIRST_REFLOW) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this));
mNotifyOnInput = PR_TRUE;//its ok to notify now. all has been prepared.
}
return nsStackFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
}
NS_IMETHODIMP
nsGfxTextControlFrame2::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
{
@ -1797,13 +1816,6 @@ nsGfxTextControlFrame2::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
if (!aReflowState)
return NS_OK;
if (mState & NS_FRAME_FIRST_REFLOW)
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this));
mNotifyOnInput = PR_TRUE;//its ok to notify now. all has been prepared.
}
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
PRBool navQuirksMode = eCompatibility_NavQuirks == mode && nameSpaceID == kNameSpaceID_HTML;

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

@ -61,6 +61,11 @@ public:
NS_IMETHOD Destroy(nsIPresContext* aPresContext);//remove yourself as a form control
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetPrefSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
NS_IMETHOD GetMinSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
NS_IMETHOD GetMaxSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);