Splitting layout into two libraries, layout and content. r=jst@netscape.com, sr=waterson@netscape.com
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include "nsFormFrame.h"
|
||||
|
||||
|
||||
|
||||
#include "nsIElementFactory.h"
|
||||
#include "nsIContent.h"
|
||||
#include "prtypes.h"
|
||||
#include "nsIAtom.h"
|
||||
@@ -58,7 +58,8 @@
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
||||
|
||||
#include "nsContentCID.h"
|
||||
static NS_DEFINE_CID(kHTMLElementFactoryCID, NS_HTML_ELEMENT_FACTORY_CID);
|
||||
|
||||
nsresult
|
||||
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
@@ -122,7 +123,16 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
nimgr->GetNodeInfo(nsHTMLAtoms::input, nsnull, kNameSpaceID_None,
|
||||
*getter_AddRefs(nodeInfo));
|
||||
|
||||
if (NS_OK == NS_NewHTMLInputElement(&mTextContent, nodeInfo)) {
|
||||
nsCOMPtr<nsIElementFactory> ef(do_CreateInstance(kHTMLElementFactoryCID,&rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
rv = ef->CreateInstanceByTag(nodeInfo,getter_AddRefs(content));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = content->QueryInterface(NS_GET_IID(nsIHTMLContent),(void**)&mTextContent);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mTextContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("text"), PR_FALSE);
|
||||
if (nsFormFrame::GetDisabled(this)) {
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> textControl = do_QueryInterface(mTextContent);
|
||||
@@ -134,7 +144,12 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// create browse button
|
||||
if (NS_OK == NS_NewHTMLInputElement(getter_AddRefs(mBrowse), nodeInfo)) {
|
||||
rv = ef->CreateInstanceByTag(nodeInfo,getter_AddRefs(content));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mBrowse = do_QueryInterface(content,&rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mBrowse->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("button"), PR_FALSE);
|
||||
//browse->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, nsAutoString("browse..."), PR_FALSE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user