removed where the input element was telling the rado/checkbox to return the opposite value

now it changes it value before the DOM call (script) and then if the event is cancelled
it sets the value back (which doesn't happen very often)
r=pollmann,jst sr=buster  b=57137,57239,58460
This commit is contained in:
rods@netscape.com
2000-12-10 16:05:29 +00:00
parent c3e242f601
commit 9392c50d60
16 changed files with 217 additions and 281 deletions

View File

@@ -54,8 +54,7 @@ NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
// Initialize GFX-rendered state
nsGfxCheckboxControlFrame::nsGfxCheckboxControlFrame()
: mChecked(eOff),
mCheckButtonFaceStyle(nsnull),
mInClickEvent(PR_FALSE)
mCheckButtonFaceStyle(nsnull)
{
}
@@ -95,14 +94,6 @@ nsGfxCheckboxControlFrame::SetCheckboxFaceStyleContext(nsIStyleContext *aCheckbo
return NS_OK;
}
//--------------------------------------------------------------
NS_IMETHODIMP
nsGfxCheckboxControlFrame::SetIsInClickEvent(PRBool aVal)
{
mInClickEvent = aVal;
return NS_OK;
}
//------------------------------------------------------------
//
// Init
@@ -424,22 +415,6 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext,
nsGfxCheckboxControlFrame::CheckState
nsGfxCheckboxControlFrame::GetCheckboxState ( )
{
// If we are processing an onclick event then
// always return the opposite value
// additional explanantion is in nsICheckboxControlFrame or nsHTMLInputElement.cpp
if (mInClickEvent) {
if (!IsTristateCheckbox()) {
return mChecked == eOn? eOff : eOn;
} else {
switch (mChecked) {
case eOff: return eOn;
case eOn: return eMixed;
case eMixed: return eOff;
default:
break;
}
}
}
return mChecked;
}