зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1683534 - Make `editor` buildable outside of `unified-build` environment. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D100206
This commit is contained in:
Родитель
8dcc17a525
Коммит
b6b336c821
|
@ -77,4 +77,9 @@ dom/worklet/
|
|||
dom/xhr/
|
||||
dom/xml/
|
||||
dom/xslt/
|
||||
dom/xul/
|
||||
dom/xul/
|
||||
editor/composer/
|
||||
editor/libeditor/
|
||||
editor/reftests/
|
||||
editor/spellchecker/
|
||||
editor/txmgr/
|
||||
|
|
|
@ -19,30 +19,31 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsDebug.h" // for NS_ENSURE_SUCCESS, etc
|
||||
#include "nsEditingSession.h"
|
||||
#include "nsError.h" // for NS_ERROR_FAILURE, NS_OK, etc
|
||||
#include "nsIChannel.h" // for nsIChannel
|
||||
#include "nsIContentViewer.h" // for nsIContentViewer
|
||||
#include "nsIControllers.h" // for nsIControllers
|
||||
#include "nsID.h" // for NS_GET_IID, etc
|
||||
#include "nsHTMLDocument.h" // for nsHTMLDocument
|
||||
#include "nsIDocShell.h" // for nsIDocShell
|
||||
#include "mozilla/dom/Document.h" // for Document
|
||||
#include "nsIEditor.h" // for nsIEditor
|
||||
#include "nsIInterfaceRequestorUtils.h" // for do_GetInterface
|
||||
#include "nsIRefreshURI.h" // for nsIRefreshURI
|
||||
#include "nsIRequest.h" // for nsIRequest
|
||||
#include "nsITimer.h" // for nsITimer, etc
|
||||
#include "nsIWeakReference.h" // for nsISupportsWeakReference, etc
|
||||
#include "nsIWebNavigation.h" // for nsIWebNavigation
|
||||
#include "nsIWebProgress.h" // for nsIWebProgress, etc
|
||||
#include "nsLiteralString.h" // for NS_LITERAL_STRING
|
||||
#include "nsPIDOMWindow.h" // for nsPIDOMWindow
|
||||
#include "nsPresContext.h" // for nsPresContext
|
||||
#include "nsReadableUtils.h" // for AppendUTF16toUTF8
|
||||
#include "nsStringFwd.h" // for nsString
|
||||
#include "mozilla/dom/Selection.h" // for AutoHideSelectionChanges, etc
|
||||
#include "nsFrameSelection.h" // for nsFrameSelection
|
||||
#include "nsBaseCommandController.h" // for nsBaseCommandController
|
||||
#include "nsError.h" // for NS_ERROR_FAILURE, NS_OK, etc
|
||||
#include "nsIChannel.h" // for nsIChannel
|
||||
#include "nsIContentViewer.h" // for nsIContentViewer
|
||||
#include "nsIControllers.h" // for nsIControllers
|
||||
#include "nsID.h" // for NS_GET_IID, etc
|
||||
#include "nsHTMLDocument.h" // for nsHTMLDocument
|
||||
#include "nsIDocShell.h" // for nsIDocShell
|
||||
#include "mozilla/dom/Document.h" // for Document
|
||||
#include "nsIEditor.h" // for nsIEditor
|
||||
#include "nsIInterfaceRequestorUtils.h" // for do_GetInterface
|
||||
#include "nsIRefreshURI.h" // for nsIRefreshURI
|
||||
#include "nsIRequest.h" // for nsIRequest
|
||||
#include "nsITimer.h" // for nsITimer, etc
|
||||
#include "nsIWeakReference.h" // for nsISupportsWeakReference, etc
|
||||
#include "nsIWebNavigation.h" // for nsIWebNavigation
|
||||
#include "nsIWebProgress.h" // for nsIWebProgress, etc
|
||||
#include "nsLiteralString.h" // for NS_LITERAL_STRING
|
||||
#include "nsPIDOMWindow.h" // for nsPIDOMWindow
|
||||
#include "nsPresContext.h" // for nsPresContext
|
||||
#include "nsReadableUtils.h" // for AppendUTF16toUTF8
|
||||
#include "nsStringFwd.h" // for nsString
|
||||
#include "mozilla/dom/BrowsingContext.h" // for BrowsingContext
|
||||
#include "mozilla/dom/Selection.h" // for AutoHideSelectionChanges, etc
|
||||
#include "nsFrameSelection.h" // for nsFrameSelection
|
||||
#include "nsBaseCommandController.h" // for nsBaseCommandController
|
||||
#include "mozilla/dom/LoadURIOptionsBinding.h"
|
||||
|
||||
class nsISupports;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "EditAggregateTransaction.h"
|
||||
#include "mozilla/ReverseIterator.h" // for Reversed
|
||||
#include "nsAString.h"
|
||||
#include "nsCOMPtr.h" // for nsCOMPtr
|
||||
#include "nsError.h" // for NS_OK, etc.
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "EditorUtils.h"
|
||||
|
||||
#include "gfxFontUtils.h"
|
||||
#include "WSRunObject.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/ContentIterator.h"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "HTMLEditorEventListener.h"
|
||||
#include "HTMLEditUtils.h"
|
||||
#include "mozilla/EditAction.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/AncestorIterator.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/InternalMutationEvent.h"
|
||||
#include "mozilla/mozInlineSpellChecker.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/StaticPrefs_editor.h"
|
||||
#include "mozilla/StyleSheet.h"
|
||||
|
|
|
@ -7,10 +7,15 @@
|
|||
#define HTMLEditorEventListener_h
|
||||
|
||||
#include "EditorEventListener.h"
|
||||
#include "mozilla/HTMLEditor.h"
|
||||
#include "nscore.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace dom {
|
||||
class Element;
|
||||
}
|
||||
|
||||
class EditorBase;
|
||||
|
||||
class HTMLEditorEventListener final : public EditorEventListener {
|
||||
|
@ -80,12 +85,12 @@ class HTMLEditorEventListener final : public EditorEventListener {
|
|||
bool aForGrabber);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT void MaybeDisplayResizers(HTMLEditor& aHTMLEditor,
|
||||
Element& aElement,
|
||||
MouseEvent& aMouseEvent);
|
||||
dom::Element& aElement,
|
||||
dom::MouseEvent& aMouseEvent);
|
||||
MOZ_CAN_RUN_SCRIPT nsresult HandlePrimaryMouseButtonDown(
|
||||
HTMLEditor& aHTMLEditor, MouseEvent& aMouseEvent);
|
||||
HTMLEditor& aHTMLEditor, dom::MouseEvent& aMouseEvent);
|
||||
MOZ_CAN_RUN_SCRIPT nsresult HandleSecondaryMouseButtonDown(
|
||||
HTMLEditor& aHTMLEditor, MouseEvent& aMouseEvent);
|
||||
HTMLEditor& aHTMLEditor, dom::MouseEvent& aMouseEvent);
|
||||
|
||||
bool mListeningToMouseMoveEventForResizers;
|
||||
bool mListeningToMouseMoveEventForGrabber;
|
||||
|
|
|
@ -82,7 +82,7 @@ ListElementSelectionState::ListElementSelectionState(HTMLEditor& aHTMLEditor,
|
|||
} else if (content->IsHTMLElement(nsGkAtoms::ol)) {
|
||||
mIsOLElementSelected = true;
|
||||
} else if (content->IsHTMLElement(nsGkAtoms::li)) {
|
||||
if (Element* parent = content->GetParentElement()) {
|
||||
if (dom::Element* parent = content->GetParentElement()) {
|
||||
if (parent->IsHTMLElement(nsGkAtoms::ul)) {
|
||||
mIsULElementSelected = true;
|
||||
} else if (parent->IsHTMLElement(nsGkAtoms::ol)) {
|
||||
|
@ -210,7 +210,7 @@ AlignStateAtSelection::AlignStateAtSelection(HTMLEditor& aHTMLEditor,
|
|||
return;
|
||||
}
|
||||
|
||||
OwningNonNull<Element> bodyOrDocumentElement = *aHTMLEditor.GetRoot();
|
||||
OwningNonNull<dom::Element> bodyOrDocumentElement = *aHTMLEditor.GetRoot();
|
||||
EditorRawDOMPoint atBodyOrDocumentElement(bodyOrDocumentElement);
|
||||
|
||||
const nsRange* firstRange = aHTMLEditor.SelectionRefPtr()->GetRangeAt(0);
|
||||
|
@ -281,7 +281,7 @@ AlignStateAtSelection::AlignStateAtSelection(HTMLEditor& aHTMLEditor,
|
|||
editTargetContent = arrayOfContents[0];
|
||||
}
|
||||
|
||||
RefPtr<Element> blockElementAtEditTarget =
|
||||
RefPtr<dom::Element> blockElementAtEditTarget =
|
||||
HTMLEditUtils::GetInclusiveAncestorBlockElement(*editTargetContent);
|
||||
if (NS_WARN_IF(!blockElementAtEditTarget)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
|
@ -468,7 +468,7 @@ ParagraphStateAtSelection::ParagraphStateAtSelection(HTMLEditor& aHTMLEditor,
|
|||
arrayOfContents.AppendElement(*content);
|
||||
}
|
||||
|
||||
Element* bodyOrDocumentElement = aHTMLEditor.GetRoot();
|
||||
dom::Element* bodyOrDocumentElement = aHTMLEditor.GetRoot();
|
||||
if (NS_WARN_IF(!bodyOrDocumentElement)) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
|
@ -518,7 +518,7 @@ ParagraphStateAtSelection::ParagraphStateAtSelection(HTMLEditor& aHTMLEditor,
|
|||
// static
|
||||
void ParagraphStateAtSelection::AppendDescendantFormatNodesAndFirstInlineNode(
|
||||
nsTArray<OwningNonNull<nsIContent>>& aArrayOfContents,
|
||||
Element& aNonFormatBlockElement) {
|
||||
dom::Element& aNonFormatBlockElement) {
|
||||
MOZ_ASSERT(HTMLEditUtils::IsBlockElement(aNonFormatBlockElement));
|
||||
MOZ_ASSERT(!HTMLEditUtils::IsFormatNode(&aNonFormatBlockElement));
|
||||
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
|
||||
namespace mozilla {
|
||||
|
||||
namespace dom {
|
||||
class Element;
|
||||
}
|
||||
|
||||
class WSRunScanner;
|
||||
|
||||
/**
|
||||
|
@ -348,10 +352,10 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
*/
|
||||
template <typename EditorDOMPointType>
|
||||
static EditorDOMPointType GetAfterLastVisiblePoint(
|
||||
Text& aTextNode, const Element* aAncestorLimiter);
|
||||
dom::Text& aTextNode, const dom::Element* aAncestorLimiter);
|
||||
template <typename EditorDOMPointType>
|
||||
static EditorDOMPointType GetFirstVisiblePoint(
|
||||
Text& aTextNode, const Element* aAncestorLimiter);
|
||||
dom::Text& aTextNode, const dom::Element* aAncestorLimiter);
|
||||
|
||||
/**
|
||||
* GetRangeInTextNodesToForwardDeleteFrom() returns the range to remove
|
||||
|
@ -398,8 +402,8 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
* Otherwise, must not be set.
|
||||
*/
|
||||
static EditorDOMRange GetRangeForDeletingBlockElementBoundaries(
|
||||
const HTMLEditor& aHTMLEditor, const Element& aLeftBlockElement,
|
||||
const Element& aRightBlockElement,
|
||||
const HTMLEditor& aHTMLEditor, const dom::Element& aLeftBlockElement,
|
||||
const dom::Element& aRightBlockElement,
|
||||
const EditorDOMPoint& aPointContainingTheOtherBlock);
|
||||
|
||||
/**
|
||||
|
@ -409,7 +413,7 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
*/
|
||||
static Result<bool, nsresult> ShrinkRangeIfStartsFromOrEndsAfterAtomicContent(
|
||||
const HTMLEditor& aHTMLEditor, nsRange& aRange,
|
||||
const Element* aEditingHost);
|
||||
const dom::Element* aEditingHost);
|
||||
|
||||
/**
|
||||
* GetRangeContainingInvisibleWhiteSpacesAtRangeBoundaries() returns
|
||||
|
@ -425,7 +429,7 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
* white-spaces between `<br>` element and aPoint.
|
||||
*/
|
||||
template <typename EditorDOMPointType>
|
||||
MOZ_NEVER_INLINE_DEBUG static HTMLBRElement*
|
||||
MOZ_NEVER_INLINE_DEBUG static dom::HTMLBRElement*
|
||||
GetPrecedingBRElementUnlessVisibleContentFound(
|
||||
const HTMLEditor& aHTMLEditor, const EditorDOMPointType& aPoint) {
|
||||
MOZ_ASSERT(aPoint.IsSetAndValid());
|
||||
|
@ -728,7 +732,7 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
static BoundaryData ScanCollapsibleWhiteSpaceStartFrom(
|
||||
const EditorDOMPointType& aPoint,
|
||||
const nsIContent& aEditableBlockParentOrTopmostEditableInlineContent,
|
||||
const Element* aEditingHost, NoBreakingSpaceData* aNBSPData);
|
||||
const dom::Element* aEditingHost, NoBreakingSpaceData* aNBSPData);
|
||||
|
||||
/**
|
||||
* ScanCollapsibleWhiteSpaceEndFrom() returns end boundary data of
|
||||
|
@ -748,7 +752,7 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
static BoundaryData ScanCollapsibleWhiteSpaceEndFrom(
|
||||
const EditorDOMPointType& aPoint,
|
||||
const nsIContent& aEditableBlockParentOrTopmostEditableInlineContent,
|
||||
const Element* aEditingHost, NoBreakingSpaceData* aNBSPData);
|
||||
const dom::Element* aEditingHost, NoBreakingSpaceData* aNBSPData);
|
||||
|
||||
enum class Preformatted : bool { Yes, No };
|
||||
BoundaryData()
|
||||
|
@ -856,7 +860,7 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
TextFragmentData() = delete;
|
||||
template <typename EditorDOMPointType>
|
||||
TextFragmentData(const EditorDOMPointType& aPoint,
|
||||
const Element* aEditingHost);
|
||||
const dom::Element* aEditingHost);
|
||||
|
||||
bool IsInitialized() const {
|
||||
return mStart.Initialized() && mEnd.Initialized();
|
||||
|
@ -1185,7 +1189,7 @@ class MOZ_STACK_CLASS WSRunScanner final {
|
|||
BoundaryData mStart;
|
||||
BoundaryData mEnd;
|
||||
NoBreakingSpaceData mNBSPData;
|
||||
RefPtr<const Element> mEditingHost;
|
||||
RefPtr<const dom::Element> mEditingHost;
|
||||
mutable Maybe<EditorDOMRange> mLeadingWhiteSpaceRange;
|
||||
mutable Maybe<EditorDOMRange> mTrailingWhiteSpaceRange;
|
||||
mutable Maybe<VisibleWhiteSpacesData> mVisibleWhiteSpacesData;
|
||||
|
@ -1325,8 +1329,9 @@ class WhiteSpaceVisibilityKeeper final {
|
|||
*/
|
||||
[[nodiscard]] MOZ_CAN_RUN_SCRIPT static EditActionResult
|
||||
MergeFirstLineOfRightBlockElementIntoDescendantLeftBlockElement(
|
||||
HTMLEditor& aHTMLEditor, Element& aLeftBlockElement,
|
||||
Element& aRightBlockElement, const EditorDOMPoint& aAtRightBlockChild,
|
||||
HTMLEditor& aHTMLEditor, dom::Element& aLeftBlockElement,
|
||||
dom::Element& aRightBlockElement,
|
||||
const EditorDOMPoint& aAtRightBlockChild,
|
||||
const Maybe<nsAtom*>& aListElementTagName,
|
||||
const dom::HTMLBRElement* aPrecedingInvisibleBRElement);
|
||||
|
||||
|
@ -1352,8 +1357,8 @@ class WhiteSpaceVisibilityKeeper final {
|
|||
*/
|
||||
[[nodiscard]] MOZ_CAN_RUN_SCRIPT static EditActionResult
|
||||
MergeFirstLineOfRightBlockElementIntoAncestorLeftBlockElement(
|
||||
HTMLEditor& aHTMLEditor, Element& aLeftBlockElement,
|
||||
Element& aRightBlockElement, const EditorDOMPoint& aAtLeftBlockChild,
|
||||
HTMLEditor& aHTMLEditor, dom::Element& aLeftBlockElement,
|
||||
dom::Element& aRightBlockElement, const EditorDOMPoint& aAtLeftBlockChild,
|
||||
nsIContent& aLeftContentInBlock,
|
||||
const Maybe<nsAtom*>& aListElementTagName,
|
||||
const dom::HTMLBRElement* aPrecedingInvisibleBRElement);
|
||||
|
@ -1374,8 +1379,9 @@ class WhiteSpaceVisibilityKeeper final {
|
|||
*/
|
||||
[[nodiscard]] MOZ_CAN_RUN_SCRIPT static EditActionResult
|
||||
MergeFirstLineOfRightBlockElementIntoLeftBlockElement(
|
||||
HTMLEditor& aHTMLEditor, Element& aLeftBlockElement,
|
||||
Element& aRightBlockElement, const Maybe<nsAtom*>& aListElementTagName,
|
||||
HTMLEditor& aHTMLEditor, dom::Element& aLeftBlockElement,
|
||||
dom::Element& aRightBlockElement,
|
||||
const Maybe<nsAtom*>& aListElementTagName,
|
||||
const dom::HTMLBRElement* aPrecedingInvisibleBRElement);
|
||||
|
||||
/**
|
||||
|
@ -1391,7 +1397,7 @@ class WhiteSpaceVisibilityKeeper final {
|
|||
* @return The new <br> node. If failed to create new <br>
|
||||
* node, returns nullptr.
|
||||
*/
|
||||
[[nodiscard]] MOZ_CAN_RUN_SCRIPT static Result<RefPtr<Element>, nsresult>
|
||||
[[nodiscard]] MOZ_CAN_RUN_SCRIPT static Result<RefPtr<dom::Element>, nsresult>
|
||||
InsertBRElement(HTMLEditor& aHTMLEditor,
|
||||
const EditorDOMPoint& aPointToInsert);
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "TransactionStack.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsISupportsUtils.h"
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "mozilla/fallible.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче