Bug 902111 - Forward-declare nsIFrame in nsISelectionPrivate.h; r=bzbarsky
--- a/content/base/public/nsISelectionPrivate.idl
+++ b/content/base/public/nsISelectionPrivate.idl
@@ -9,21 +9,23 @@
interface nsRange;
interface nsIDOMNode;
interface nsISelectionListener;
interface nsIContent;
interface nsINode;
%{C++
+class nsIFrame;
struct nsTextRangeStyle;
struct nsPoint;
struct ScrollAxis;
+#include "nsDirection.h"
#include "nsTArray.h"
-#include "nsIFrame.h"
+#include "nsIPresShell.h" // TODO: Remove this include
%}
[ptr] native nsIFrame(nsIFrame);
[ptr] native RangeArray(nsTArray<nsRange*>);
[ref] native constTextRangeStyleRef(const nsTextRangeStyle);
[ref] native nsPointRef(nsPoint);
native nsDirection(nsDirection);
native ScrollAxis(nsIPresShell::ScrollAxis);
--- a/editor/libeditor/base/IMETextTxn.cpp
+++ b/editor/libeditor/base/IMETextTxn.cpp
@@ -7,16 +7,17 @@
#include "mozilla/mozalloc.h" // for operator new
#include "nsAString.h" // for nsAString_internal::Length, etc
#include "nsAutoPtr.h" // for nsRefPtr
#include "nsDebug.h" // for NS_ASSERTION, etc
#include "nsError.h" // for NS_SUCCEEDED, NS_FAILED, etc
#include "nsGUIEvent.h" // for nsTextRangeStyle
#include "nsIDOMCharacterData.h" // for nsIDOMCharacterData
#include "nsIDOMRange.h" // for nsRange::SetEnd, etc
+#include "nsIContent.h" // for nsIContent
#include "nsIEditor.h" // for nsIEditor
#include "nsIPresShell.h" // for SelectionType
#include "nsIPrivateTextRange.h" // for nsIPrivateTextRange, etc
#include "nsISelection.h" // for nsISelection
#include "nsISelectionController.h" // for nsISelectionController, etc
#include "nsISelectionPrivate.h" // for nsISelectionPrivate
#include "nsISupportsImpl.h" // for nsRange::AddRef, etc
#include "nsISupportsUtils.h" // for NS_ADDREF_THIS, NS_RELEASE
--- a/layout/generic/Selection.h
+++ b/layout/generic/Selection.h
@@ -8,21 +8,23 @@
#define mozilla_Selection_h__
#include "nsIWeakReference.h"
#include "nsISelection.h"
#include "nsISelectionController.h"
#include "nsISelectionPrivate.h"
#include "nsRange.h"
+#include "nsThreadUtils.h"
struct CachedOffsetForFrame;
class nsAutoScrollTimer;
class nsIContentIterator;
class nsIFrame;
+class nsFrameSelection;
struct SelectionDetails;
struct RangeData
{
RangeData(nsRange* aRange)
: mRange(aRange)
{}
--- a/layout/generic/moz.build
+++ b/layout/generic/moz.build
@@ -7,16 +7,17 @@
TEST_DIRS += ['test']
MODULE = 'layout'
EXPORTS += [
'ScrollbarActivity.h',
'Selection.h',
'nsCanvasFrame.h',
+ 'nsDirection.h',
'nsFrameIdList.h',
'nsFrameList.h',
'nsFrameSelection.h',
'nsHTMLParts.h',
'nsHTMLReflowMetrics.h',
'nsHTMLReflowState.h',
'nsIAnonymousContentCreator.h',
'nsIFrame.h',
new file mode 100644
--- /dev/null
+++ b/layout/generic/nsDirection.h
@@ -0,0 +1,19 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 sw=2 et tw=78: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef nsDirection_h___
+#define nsDirection_h___
+
+// This file makes the nsDirection enum present both in nsIFrame.h and
+// nsISelectionPrivate.h.
+
+enum nsDirection {
+ eDirNext = 0,
+ eDirPrevious= 1
+};
+
+#endif
+
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -28,16 +28,17 @@
#include "nsHTMLReflowMetrics.h"
#include "nsFrameList.h"
#include "nsIContent.h"
#include "nsAlgorithm.h"
#include "mozilla/layout/FrameChildList.h"
#include "mozilla/css/ImageLoader.h"
#include "FramePropertyTable.h"
#include "mozilla/TypedEnum.h"
+#include "nsDirection.h"
#include <algorithm>
#ifdef ACCESSIBILITY
#include "mozilla/a11y/AccTypes.h"
#endif
/**
* New rules of reflow:
@@ -350,21 +351,16 @@ enum nsSelectionAmount {
eSelectEndLine = 5,
eSelectNoAmount = 6, // just bounce back current offset.
eSelectParagraph = 7, // select a "paragraph"
eSelectWordNoSpace = 8 // select a "word" without selecting the following
// space, no matter what the default platform
// behavior is
};
-enum nsDirection {
- eDirNext = 0,
- eDirPrevious= 1
-};
-
enum nsSpread {
eSpreadNone = 0,
eSpreadAcross = 1,
eSpreadDown = 2
};
// Carried out margin flags
#define NS_CARRIED_TOP_MARGIN_IS_AUTO 0x1