From 7487b46e5ff2e69be19164609dd3bc97b976c283 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Wed, 9 Feb 2000 20:19:19 +0000 Subject: [PATCH] ifdef'ing out some new functionality for radio buttons in standard mode a=leaf r=self git-svn-id: svn://10.0.0.236/trunk@60250 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/html/forms/src/nsFormFrame.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/html/forms/src/nsFormFrame.cpp b/mozilla/layout/html/forms/src/nsFormFrame.cpp index 274efb8c3b5..2ae1d489b7a 100644 --- a/mozilla/layout/html/forms/src/nsFormFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFormFrame.cpp @@ -389,6 +389,7 @@ void nsFormFrame::DoDefaultSelection(nsIPresContext* aPresContext, nsRadioControlGroup * aGroup, nsGfxRadioControlFrame * aRadioToIgnore) { +#if 0 // If in standard mode, then a radio group MUST default // to the first item in the group (it must be selected) nsCompatibility mode; @@ -397,15 +398,20 @@ void nsFormFrame::DoDefaultSelection(nsIPresContext* aPresContext, // first find out if any have a default selection PRInt32 i; PRInt32 numItems = aGroup->GetNumRadios(); - PRBool oneIsSelected = PR_FALSE; - for (i=0;iGetRadioAt(i); nsCOMPtr content; radioBtn->GetContent(getter_AddRefs(content)); if (content) { nsCOMPtr input(do_QueryInterface(content)); if (input) { - input->GetDefaultChecked(&oneIsSelected); + input->GetDefaultChecked(&oneIsDefSelected); + PRBool currentValue = radioBtn->GetChecked(PR_FALSE); + if (currentValue != oneIsDefSelected) { + changed = PR_TRUE; + } } } } @@ -414,7 +420,7 @@ void nsFormFrame::DoDefaultSelection(nsIPresContext* aPresContext, // select the firdst one in the group. // if aRadioToIgnore is not null then it is being deleted // so don't select that item, select the next one if there is one. - if (!oneIsSelected && numItems > 0) { + if (!changed && !oneIsDefSelected && numItems > 0) { nsGfxRadioControlFrame * radioBtn = (nsGfxRadioControlFrame*) aGroup->GetRadioAt(0); if (aRadioToIgnore != nsnull && aRadioToIgnore == radioBtn) { if (numItems == 1) { @@ -433,6 +439,7 @@ void nsFormFrame::DoDefaultSelection(nsIPresContext* aPresContext, } } } +#endif }