From f42124e4bb10c5b9b97530b8580f5e4594090f0b Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Tue, 12 Nov 2002 22:41:16 +0000 Subject: [PATCH] New XBL for editor tag and editorshell removal. b=133598, r=akkana, sr=sfraser git-svn-id: svn://10.0.0.236/trunk@133696 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xul/base/public/nsIEditorBoxObject.idl | 4 - .../layout/xul/base/src/nsEditorBoxObject.cpp | 44 +---------- mozilla/xpfe/global/jar.mn | 1 + .../resources/content/bindings/editor.xml | 75 +++++++++++++++++++ .../resources/content/bindings/general.xml | 22 ------ mozilla/xpfe/global/resources/content/xul.css | 2 +- 6 files changed, 78 insertions(+), 70 deletions(-) create mode 100644 mozilla/xpfe/global/resources/content/bindings/editor.xml diff --git a/mozilla/layout/xul/base/public/nsIEditorBoxObject.idl b/mozilla/layout/xul/base/public/nsIEditorBoxObject.idl index badaa6b0b57..529060ad7b2 100644 --- a/mozilla/layout/xul/base/public/nsIEditorBoxObject.idl +++ b/mozilla/layout/xul/base/public/nsIEditorBoxObject.idl @@ -40,14 +40,10 @@ interface nsIEditor; interface nsIDocShell; -interface nsIEditorShell; [scriptable, uuid(14B3B669-3414-4548-AA03-EDF257D889C8)] interface nsIEditorBoxObject : nsISupports { - readonly attribute nsIEditor editor; - // nsIEditorShell is deprecated and will go away -- please don't use it! - readonly attribute nsIEditorShell editorShell; readonly attribute nsIDocShell docShell; }; diff --git a/mozilla/layout/xul/base/src/nsEditorBoxObject.cpp b/mozilla/layout/xul/base/src/nsEditorBoxObject.cpp index 477df9f3f37..38b1dfa829d 100644 --- a/mozilla/layout/xul/base/src/nsEditorBoxObject.cpp +++ b/mozilla/layout/xul/base/src/nsEditorBoxObject.cpp @@ -40,7 +40,6 @@ #include "nsBoxObject.h" #include "nsIDocument.h" #include "nsIFrame.h" -#include "nsIEditorShell.h" #include "nsIComponentManager.h" #include "nsIDocShell.h" @@ -55,9 +54,6 @@ public: //NS_PIBOXOBJECT interfaces NS_IMETHOD Init(nsIContent* aContent, nsIPresShell* aPresShell); NS_IMETHOD SetDocument(nsIDocument* aDocument); - -protected: - nsCOMPtr mEditorShell; }; /* Implementation file */ @@ -67,18 +63,6 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsEditorBoxObject, nsBoxObject, nsIEditorBoxObject) NS_IMETHODIMP nsEditorBoxObject::SetDocument(nsIDocument* aDocument) { - nsresult rv; - - if (mEditorShell) - { - rv = mEditorShell->Shutdown(); - NS_ASSERTION(NS_SUCCEEDED(rv), "Error from editor->Shutdown"); - } - - // this should only be called with a null document, which indicates - // that we're being torn down. - NS_ASSERTION(aDocument == nsnull, "SetDocument called with non-null document"); - mEditorShell = nsnull; return nsBoxObject::SetDocument(aDocument); } @@ -96,33 +80,7 @@ nsEditorBoxObject::~nsEditorBoxObject() NS_IMETHODIMP nsEditorBoxObject::Init(nsIContent* aContent, nsIPresShell* aPresShell) { - nsresult rv = nsBoxObject::Init(aContent, aPresShell); - if (NS_FAILED(rv)) return rv; - - NS_ASSERTION(!mEditorShell, "Double init of nsEditorBoxObject"); - - // When editorshell goes away, this is what we should be doing: - //mEditor = do_CreateInstance("@mozilla.org/editor/htmleditor;1"); - // but we need an editorshell for the transitional period, so: - mEditorShell = do_CreateInstance("@mozilla.org/editor/editorshell;1"); - if (!mEditorShell) return NS_ERROR_OUT_OF_MEMORY; - - return NS_OK; -} - -NS_IMETHODIMP nsEditorBoxObject::GetEditor(nsIEditor** aResult) -{ - NS_ASSERTION(mEditorShell, "Editor box object not initted"); - return mEditorShell->GetEditor(aResult); -} - -NS_IMETHODIMP nsEditorBoxObject::GetEditorShell(nsIEditorShell** aResult) -{ - NS_ASSERTION(mEditorShell, "Editor box object not initted"); - - *aResult = mEditorShell; - NS_IF_ADDREF(*aResult); - return NS_OK; + return nsBoxObject::Init(aContent, aPresShell); } NS_IMETHODIMP nsEditorBoxObject::GetDocShell(nsIDocShell** aResult) diff --git a/mozilla/xpfe/global/jar.mn b/mozilla/xpfe/global/jar.mn index d8e99d0a3ac..a9e31b1edb9 100644 --- a/mozilla/xpfe/global/jar.mn +++ b/mozilla/xpfe/global/jar.mn @@ -53,6 +53,7 @@ toolkit.jar: content/global/bindings/checkbox.xml (resources/content/bindings/checkbox.xml) content/global/bindings/colorpicker.xml (resources/content/bindings/colorpicker.xml) content/global/bindings/dialog.xml (resources/content/bindings/dialog.xml) + content/global/bindings/editor.xml (resources/content/bindings/editor.xml) content/global/bindings/general.xml (resources/content/bindings/general.xml) content/global/bindings/groupbox.xml (resources/content/bindings/groupbox.xml) content/global/bindings/listbox.xml (resources/content/bindings/listbox.xml) diff --git a/mozilla/xpfe/global/resources/content/bindings/editor.xml b/mozilla/xpfe/global/resources/content/bindings/editor.xml new file mode 100644 index 00000000000..5a8016a5739 --- /dev/null +++ b/mozilla/xpfe/global/resources/content/bindings/editor.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + " + " + + + + + diff --git a/mozilla/xpfe/global/resources/content/bindings/general.xml b/mozilla/xpfe/global/resources/content/bindings/general.xml index 596503e7122..d918275def7 100644 --- a/mozilla/xpfe/global/resources/content/bindings/general.xml +++ b/mozilla/xpfe/global/resources/content/bindings/general.xml @@ -177,28 +177,6 @@ - - - - - - - - - - - diff --git a/mozilla/xpfe/global/resources/content/xul.css b/mozilla/xpfe/global/resources/content/xul.css index 136842ed972..7bd6435d088 100644 --- a/mozilla/xpfe/global/resources/content/xul.css +++ b/mozilla/xpfe/global/resources/content/xul.css @@ -156,7 +156,7 @@ tabbrowser { } editor { - -moz-binding: url("chrome://global/content/bindings/general.xml#editor"); + -moz-binding: url("chrome://global/content/bindings/editor.xml#editor"); } iframe {