From f2de9c62defd4456ef8ec4d635423633397f7361 Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Fri, 5 May 2000 02:46:56 +0000 Subject: [PATCH] adding more support for forms --- .../html/forms/src/nsGfxTextControlFrame2.cpp | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/layout/html/forms/src/nsGfxTextControlFrame2.cpp index c80f5fe3846..28cab259282 100644 --- a/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -43,7 +43,7 @@ #include "nsIControllers.h" #include "nsIEditorController.h" #include "nsIElementFactory.h" - +#include "nsIHTMLContent.h" #include "nsIContent.h" @@ -658,3 +658,39 @@ nsGfxTextControlFrame2::GetSelectionController(nsIPresContext *aPresContext, nsI } +nsresult +nsGfxTextControlFrame2::GetColRowSizeAttr(nsIFormControlFrame* aFrame, + nsIAtom * aColSizeAttr, + nsHTMLValue & aColSize, + nsresult & aColStatus, + nsIAtom * aRowSizeAttr, + nsHTMLValue & aRowSize, + nsresult & aRowStatus) +{ + nsIContent* iContent = nsnull; + aFrame->GetFormContent((nsIContent*&) iContent); + if (!iContent) { + return NS_ERROR_FAILURE; + } + nsIHTMLContent* hContent = nsnull; + nsresult result = iContent->QueryInterface(kIHTMLContentIID, (void**)&hContent); + if ((NS_OK != result) || !hContent) { + NS_RELEASE(iContent); + return NS_ERROR_FAILURE; + } + + aColStatus = NS_CONTENT_ATTR_NOT_THERE; + if (nsnull != aColSizeAttr) { + aColStatus = hContent->GetHTMLAttribute(aColSizeAttr, aColSize); + } + + aRowStatus= NS_CONTENT_ATTR_NOT_THERE; + if (nsnull != aRowSizeAttr) { + aRowStatus = hContent->GetHTMLAttribute(aRowSizeAttr, aRowSize); + } + + NS_RELEASE(hContent); + NS_RELEASE(iContent); + + return NS_OK; +}