Bug 551704 - Part 5: Move breakIsVisible to nsIHTMLEditor_MOZILLA_2_0_BRANCH to make sure that nsIHTMLEditor does not change for Gecko 2.0; r=bzbarsky a=blocking-betaN+
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 09 Nov 2010 21:00:26 -0500
changeset 57277 e9d979b4b4a08b12587d08e7a3fde77c49c3ed77
parent 57276 c922552a8dbc9f66ed72655090736b68f718c23b
child 57278 6adc19c7a1e4dddceea6b5e72dac1fd3d41ed38a
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky, blocking-betaN
bugs551704
milestone2.0b8pre
Bug 551704 - Part 5: Move breakIsVisible to nsIHTMLEditor_MOZILLA_2_0_BRANCH to make sure that nsIHTMLEditor does not change for Gecko 2.0; r=bzbarsky a=blocking-betaN+ This patch should be backed out on trunk when Gecko 2.0 has been branched.
content/base/src/nsHTMLContentSerializer.cpp
editor/idl/Makefile.in
editor/idl/nsIHTMLEditor.idl
editor/idl/nsIHTMLEditor_MOZILLA_2_0_BRANCH.idl
editor/libeditor/html/nsHTMLEditor.cpp
editor/libeditor/html/nsHTMLEditor.h
--- a/content/base/src/nsHTMLContentSerializer.cpp
+++ b/content/base/src/nsHTMLContentSerializer.cpp
@@ -66,17 +66,17 @@
 #include "nsIParserService.h"
 #include "nsContentUtils.h"
 #include "nsLWBrkCIID.h"
 #include "nsIScriptElement.h"
 #include "nsAttrName.h"
 #include "nsIDocShell.h"
 #include "nsIEditorDocShell.h"
 #include "nsIEditor.h"
-#include "nsIHTMLEditor.h"
+#include "nsIHTMLEditor_MOZILLA_2_0_BRANCH.h"
 
 static const PRInt32 kLongLineLen = 128;
 
 nsresult NS_NewHTMLContentSerializer(nsIContentSerializer** aSerializer)
 {
   nsHTMLContentSerializer* it = new nsHTMLContentSerializer();
   if (!it) {
     return NS_ERROR_OUT_OF_MEMORY;
@@ -100,17 +100,17 @@ IsInvisibleBreak(nsIContent *aNode, nsIA
     nsPIDOMWindow *window = doc->GetWindow();
     if (window) {
       nsIDocShell *docShell = window->GetDocShell();
       if (docShell) {
         nsCOMPtr<nsIEditorDocShell> editorDocShell = do_QueryInterface(docShell);
         if (editorDocShell) {
           nsCOMPtr<nsIEditor> editor;
           editorDocShell->GetEditor(getter_AddRefs(editor));
-          nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(editor);
+          nsCOMPtr<nsIHTMLEditor_MOZILLA_2_0_BRANCH> htmlEditor = do_QueryInterface(editor);
           if (htmlEditor) {
             PRBool isVisible = PR_FALSE;
             nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(aNode);
             htmlEditor->BreakIsVisible(domNode, &isVisible);
             return !isVisible;
           }
         }
       }
--- a/editor/idl/Makefile.in
+++ b/editor/idl/Makefile.in
@@ -52,16 +52,17 @@ XPIDLSRCS	= \
 		nsIEditor.idl \
 		nsIEditorIMESupport.idl \
 		nsIEditorLogging.idl \
 		nsIEditorMailSupport.idl \
 		nsIEditorObserver.idl \
 		nsIEditorSpellCheck.idl \
 		nsIEditorStyleSheets.idl \
 		nsIHTMLEditor.idl \
+		nsIHTMLEditor_MOZILLA_2_0_BRANCH.idl \
 		nsIHTMLObjectResizer.idl \
 		nsIHTMLAbsPosEditor.idl \
 		nsIHTMLObjectResizeListener.idl \
 		nsIHTMLInlineTableEditor.idl \
 		nsIPlaintextEditor.idl \
 		nsITableEditor.idl \
 		nsIURIRefObject.idl \
 		nsIContentFilter.idl \
--- a/editor/idl/nsIHTMLEditor.idl
+++ b/editor/idl/nsIHTMLEditor.idl
@@ -46,17 +46,17 @@ interface nsISupportsArray;
 interface nsISelection;
 interface nsIContentFilter;
 
 %{C++
 #define NS_EDITOR_ELEMENT_NOT_FOUND \
   NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_EDITOR, 1)
 
 %}
-[scriptable, uuid(c964b8b0-e9e8-11df-9492-0800200c9a66)]
+[scriptable, uuid(afc36593-5787-4420-93d9-b2c0ccbf0cad)]
 
 interface nsIHTMLEditor : nsISupports
 {
 %{C++
   typedef short EAlignment;
 %}
 
   // used by GetAlignment()
@@ -603,15 +603,10 @@ interface nsIHTMLEditor : nsISupports
 
   /**
    * A boolean indicating if a return key pressed in a paragraph creates
    * another paragraph or just inserts a <br> at the caret
    *
    * @return    true if CR in a paragraph creates a new paragraph
    */
   attribute boolean returnInParagraphCreatesNewParagraph;
-
-  /**
-   * Checks whether a BR node is visible to the user.
-   */
-  boolean breakIsVisible(in nsIDOMNode aNode);
 };
 
new file mode 100644
--- /dev/null
+++ b/editor/idl/nsIHTMLEditor_MOZILLA_2_0_BRANCH.idl
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Editor code.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "nsISupports.idl"
+
+interface nsIDOMNode;
+
+[scriptable, uuid(278714d1-2072-440a-bb0f-6522d98d280a)]
+
+interface nsIHTMLEditor_MOZILLA_2_0_BRANCH : nsISupports
+{
+  /**
+   * Checks whether a BR node is visible to the user.
+   */
+  boolean breakIsVisible(in nsIDOMNode aNode);
+};
+
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -234,16 +234,17 @@ nsHTMLEditor::Shutdown()
   NS_IF_RELEASE(sRangeHelper);
 }
 
 NS_IMPL_ADDREF_INHERITED(nsHTMLEditor, nsEditor)
 NS_IMPL_RELEASE_INHERITED(nsHTMLEditor, nsEditor)
 
 NS_INTERFACE_MAP_BEGIN(nsHTMLEditor)
   NS_INTERFACE_MAP_ENTRY(nsIHTMLEditor)
+  NS_INTERFACE_MAP_ENTRY(nsIHTMLEditor_MOZILLA_2_0_BRANCH)
   NS_INTERFACE_MAP_ENTRY(nsIHTMLObjectResizer)
   NS_INTERFACE_MAP_ENTRY(nsIHTMLAbsPosEditor)
   NS_INTERFACE_MAP_ENTRY(nsIHTMLInlineTableEditor)
   NS_INTERFACE_MAP_ENTRY(nsITableEditor)
   NS_INTERFACE_MAP_ENTRY(nsIEditorStyleSheets)
   NS_INTERFACE_MAP_ENTRY(nsICSSLoaderObserver)
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
 NS_INTERFACE_MAP_END_INHERITING(nsPlaintextEditor)
--- a/editor/libeditor/html/nsHTMLEditor.h
+++ b/editor/libeditor/html/nsHTMLEditor.h
@@ -40,16 +40,17 @@
 #ifndef nsHTMLEditor_h__
 #define nsHTMLEditor_h__
 
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsPlaintextEditor.h"
 #include "nsIEditor.h"
 #include "nsIHTMLEditor.h"
+#include "nsIHTMLEditor_MOZILLA_2_0_BRANCH.h"
 #include "nsITableEditor.h"
 #include "nsIEditorMailSupport.h"
 #include "nsIEditorStyleSheets.h"
 #include "nsITextServicesDocument.h"
 
 #include "nsEditor.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventListener.h"
@@ -85,16 +86,17 @@ class nsILinkHandler;
 struct PropItem;
 
 /**
  * The HTML editor implementation.<br>
  * Use to edit HTML document represented as a DOM tree. 
  */
 class nsHTMLEditor : public nsPlaintextEditor,
                      public nsIHTMLEditor,
+                     public nsIHTMLEditor_MOZILLA_2_0_BRANCH,
                      public nsIHTMLObjectResizer,
                      public nsIHTMLAbsPosEditor,
                      public nsITableEditor,
                      public nsIHTMLInlineTableEditor,
                      public nsIEditorStyleSheets,
                      public nsICSSLoaderObserver,
                      public nsStubMutationObserver
 {
@@ -161,16 +163,20 @@ public:
 
   /* ------------ nsIEditorIMESupport overrides ------------ */
   NS_IMETHOD GetPreferredIMEState(PRUint32 *aState);
 
   /* ------------ nsIHTMLEditor methods -------------- */
 
   NS_DECL_NSIHTMLEDITOR
 
+  /* ------------ nsIHTMLEditor_MOZILLA_2_0_BRANCH methods -------------- */
+
+  NS_DECL_NSIHTMLEDITOR_MOZILLA_2_0_BRANCH
+
   /* ------------ nsIHTMLObjectResizer methods -------------- */
   /* -------- Implemented in nsHTMLObjectResizer.cpp -------- */
   NS_DECL_NSIHTMLOBJECTRESIZER
 
   /* ------------ nsIHTMLAbsPosEditor methods -------------- */
   /* -------- Implemented in nsHTMLAbsPosition.cpp --------- */
   NS_DECL_NSIHTMLABSPOSEDITOR