From 9c4f03aa390bd3d28072d3d1e2fa09e72a847c85 Mon Sep 17 00:00:00 2001 From: "pollmann%netscape.com" Date: Fri, 26 Feb 1999 20:01:48 +0000 Subject: [PATCH] Enable dynamic changing of the readonly attribute. Works on Linux now. Win will come on-line later today. git-svn-id: svn://10.0.0.236/trunk@22207 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsTextControlFrame.cpp | 3 +++ mozilla/layout/html/forms/src/nsTextControlFrame.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index 79cd8bfba9c..6d0b8ee286b 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -400,6 +400,9 @@ nsTextControlFrame::AttributeChanged(nsIPresContext* aPresContext, if (NS_CONTENT_ATTR_NOT_THERE != rv) { text->SetMaxTextLength(maxLength); } + } else if ((nsHTMLAtoms::readonly == aAttribute) && (nsnull != text)) { + PRBool oldReadOnly; + text->SetReadOnly(nsFormFrame::GetReadonly(this),oldReadOnly); } // Allow the base class to handle common attributes supported // by all form elements... diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index 79cd8bfba9c..6d0b8ee286b 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -400,6 +400,9 @@ nsTextControlFrame::AttributeChanged(nsIPresContext* aPresContext, if (NS_CONTENT_ATTR_NOT_THERE != rv) { text->SetMaxTextLength(maxLength); } + } else if ((nsHTMLAtoms::readonly == aAttribute) && (nsnull != text)) { + PRBool oldReadOnly; + text->SetReadOnly(nsFormFrame::GetReadonly(this),oldReadOnly); } // Allow the base class to handle common attributes supported // by all form elements...