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.
This commit is contained in:
Ehsan Akhgari 2010-11-09 21:00:26 -05:00
parent cea63fedad
commit 0908325de2
6 changed files with 62 additions and 8 deletions

View File

@ -71,7 +71,7 @@
#include "nsIDocShell.h"
#include "nsIEditorDocShell.h"
#include "nsIEditor.h"
#include "nsIHTMLEditor.h"
#include "nsIHTMLEditor_MOZILLA_2_0_BRANCH.h"
static const PRInt32 kLongLineLen = 128;
@ -105,7 +105,7 @@ IsInvisibleBreak(nsIContent *aNode, nsIAtom *aTag) {
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);

View File

@ -57,6 +57,7 @@ XPIDLSRCS = \
nsIEditorSpellCheck.idl \
nsIEditorStyleSheets.idl \
nsIHTMLEditor.idl \
nsIHTMLEditor_MOZILLA_2_0_BRANCH.idl \
nsIHTMLObjectResizer.idl \
nsIHTMLAbsPosEditor.idl \
nsIHTMLObjectResizeListener.idl \

View File

@ -51,7 +51,7 @@ interface nsIContentFilter;
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
{
@ -608,10 +608,5 @@ interface nsIHTMLEditor : nsISupports
* @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);
};

View File

@ -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);
};

View File

@ -239,6 +239,7 @@ 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)

View File

@ -45,6 +45,7 @@
#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"
@ -90,6 +91,7 @@ struct PropItem;
*/
class nsHTMLEditor : public nsPlaintextEditor,
public nsIHTMLEditor,
public nsIHTMLEditor_MOZILLA_2_0_BRANCH,
public nsIHTMLObjectResizer,
public nsIHTMLAbsPosEditor,
public nsITableEditor,
@ -166,6 +168,10 @@ public:
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