PDT+ bug 28928 - correctly handle reflow of hidden inputs. r=rods, a=rickg

This commit is contained in:
karnaze%netscape.com 2000-02-29 13:17:33 +00:00
Родитель ec64db8436
Коммит 5ce5b346e3
2 изменённых файлов: 44 добавлений и 0 удалений

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

@ -540,6 +540,28 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext* aPresContext,
}
#endif
PRInt32 type;
GetType(&type);
// hidden inputs are zero width/height and are finished here
if (NS_FORM_INPUT_HIDDEN == type) {
aDesiredSize.width = aDesiredSize.height = aDesiredSize.ascent = aDesiredSize.descent = 0;
if (aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.maxElementSize->height = 0;
}
// just in case the hidden input is the target of an incremental reflow
if (eReflowReason_Incremental == aReflowState.reason) {
nsIFrame* targetFrame;
aReflowState.reflowCommand->GetTarget(targetFrame);
if (this == targetFrame) {
nsIFrame* nextFrame;
// Remove the next frame from the reflow path
aReflowState.reflowCommand->GetNext(nextFrame);
}
}
aStatus = NS_FRAME_COMPLETE;
return rv;
}
if ((kSuggestedNotSet != mSuggestedWidth) ||
(kSuggestedNotSet != mSuggestedHeight)) {
nsHTMLReflowState suggestedReflowState(aReflowState);

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

@ -540,6 +540,28 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext* aPresContext,
}
#endif
PRInt32 type;
GetType(&type);
// hidden inputs are zero width/height and are finished here
if (NS_FORM_INPUT_HIDDEN == type) {
aDesiredSize.width = aDesiredSize.height = aDesiredSize.ascent = aDesiredSize.descent = 0;
if (aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.maxElementSize->height = 0;
}
// just in case the hidden input is the target of an incremental reflow
if (eReflowReason_Incremental == aReflowState.reason) {
nsIFrame* targetFrame;
aReflowState.reflowCommand->GetTarget(targetFrame);
if (this == targetFrame) {
nsIFrame* nextFrame;
// Remove the next frame from the reflow path
aReflowState.reflowCommand->GetNext(nextFrame);
}
}
aStatus = NS_FRAME_COMPLETE;
return rv;
}
if ((kSuggestedNotSet != mSuggestedWidth) ||
(kSuggestedNotSet != mSuggestedHeight)) {
nsHTMLReflowState suggestedReflowState(aReflowState);