From 8c636d19e844a386b0b2542c2bda1de0299e23d8 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Tue, 10 Aug 1999 19:26:10 +0000 Subject: [PATCH] Added check to see if it was disabled so it would ignore events --- layout/html/forms/src/nsCheckboxControlFrame.cpp | 4 ++++ layout/html/forms/src/nsRadioControlFrame.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/layout/html/forms/src/nsCheckboxControlFrame.cpp b/layout/html/forms/src/nsCheckboxControlFrame.cpp index 083a411b7d0..68cdc77df0e 100644 --- a/layout/html/forms/src/nsCheckboxControlFrame.cpp +++ b/layout/html/forms/src/nsCheckboxControlFrame.cpp @@ -22,6 +22,7 @@ #include "nsWidgetsCID.h" #include "nsIContent.h" #include "nsHTMLAtoms.h" +#include "nsFormFrame.h" @@ -115,6 +116,9 @@ NS_METHOD nsCheckboxControlFrame::HandleEvent(nsIPresContext& aPresContext, if (nsEventStatus_eConsumeNoDefault == aEventStatus) { return NS_OK; } + if (nsFormFrame::GetDisabled(this)) { + return NS_OK; + } switch(aEvent->message) { case NS_KEY_PRESS: diff --git a/layout/html/forms/src/nsRadioControlFrame.cpp b/layout/html/forms/src/nsRadioControlFrame.cpp index c0aa59ac8b0..a4e79c5cef1 100644 --- a/layout/html/forms/src/nsRadioControlFrame.cpp +++ b/layout/html/forms/src/nsRadioControlFrame.cpp @@ -24,6 +24,7 @@ #include "nsHTMLAtoms.h" #include "nsFormFrame.h" #include "nsINameSpaceManager.h" +#include "nsFormFrame.h" static NS_DEFINE_IID(kIRadioControlFrameIID, NS_IRADIOCONTROLFRAME_IID); @@ -181,6 +182,10 @@ nsRadioControlFrame::HandleEvent(nsIPresContext& aPresContext, return NS_OK; } + if (nsFormFrame::GetDisabled(this)) { + return NS_OK; + } + switch(aEvent->message) { case NS_KEY_PRESS: if (NS_KEY_EVENT == aEvent->eventStructType) {