forked from mirrors/gecko-dev
Bug 1387143 part 28. Remove nsISelection::AsSelection(). r=mats
This commit is contained in:
parent
21aa32be26
commit
a44e6132ff
20 changed files with 43 additions and 63 deletions
|
|
@ -48,19 +48,16 @@ SelectionManager::SelectionManager() :
|
||||||
void
|
void
|
||||||
SelectionManager::ClearControlSelectionListener()
|
SelectionManager::ClearControlSelectionListener()
|
||||||
{
|
{
|
||||||
|
|
||||||
// Remove 'this' registered as selection listener for the normal selection.
|
// Remove 'this' registered as selection listener for the normal selection.
|
||||||
nsCOMPtr<nsISelection> normalSel = do_QueryReferent(mCurrCtrlNormalSel);
|
if (mCurrCtrlNormalSel) {
|
||||||
if (normalSel) {
|
mCurrCtrlNormalSel->RemoveSelectionListener(this);
|
||||||
normalSel->AsSelection()->RemoveSelectionListener(this);
|
|
||||||
mCurrCtrlNormalSel = nullptr;
|
mCurrCtrlNormalSel = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove 'this' registered as selection listener for the spellcheck
|
// Remove 'this' registered as selection listener for the spellcheck
|
||||||
// selection.
|
// selection.
|
||||||
nsCOMPtr<nsISelection> spellSel = do_QueryReferent(mCurrCtrlSpellSel);
|
if (mCurrCtrlSpellSel) {
|
||||||
if (spellSel) {
|
mCurrCtrlSpellSel->RemoveSelectionListener(this);
|
||||||
spellSel->AsSelection()->RemoveSelectionListener(this);
|
|
||||||
mCurrCtrlSpellSel = nullptr;
|
mCurrCtrlSpellSel = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -85,12 +82,12 @@ SelectionManager::SetControlSelectionListener(dom::Element* aFocusedElm)
|
||||||
// Register 'this' as selection listener for the normal selection.
|
// Register 'this' as selection listener for the normal selection.
|
||||||
Selection* normalSel = frameSel->GetSelection(SelectionType::eNormal);
|
Selection* normalSel = frameSel->GetSelection(SelectionType::eNormal);
|
||||||
normalSel->AddSelectionListener(this);
|
normalSel->AddSelectionListener(this);
|
||||||
mCurrCtrlNormalSel = do_GetWeakReference(normalSel);
|
mCurrCtrlNormalSel = normalSel;
|
||||||
|
|
||||||
// Register 'this' as selection listener for the spell check selection.
|
// Register 'this' as selection listener for the spell check selection.
|
||||||
Selection* spellSel = frameSel->GetSelection(SelectionType::eSpellCheck);
|
Selection* spellSel = frameSel->GetSelection(SelectionType::eSpellCheck);
|
||||||
spellSel->AddSelectionListener(this);
|
spellSel->AddSelectionListener(this);
|
||||||
mCurrCtrlSpellSel = do_GetWeakReference(spellSel);
|
mCurrCtrlSpellSel = spellSel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsISelectionListener.h"
|
#include "nsISelectionListener.h"
|
||||||
|
#include "mozilla/WeakPtr.h"
|
||||||
|
|
||||||
class nsIPresShell;
|
class nsIPresShell;
|
||||||
|
|
||||||
|
|
@ -15,6 +16,7 @@ namespace mozilla {
|
||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
class Element;
|
class Element;
|
||||||
|
class Selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace a11y {
|
namespace a11y {
|
||||||
|
|
@ -123,8 +125,8 @@ private:
|
||||||
// Currently focused control.
|
// Currently focused control.
|
||||||
int32_t mCaretOffset;
|
int32_t mCaretOffset;
|
||||||
HyperTextAccessible* mAccWithCaret;
|
HyperTextAccessible* mAccWithCaret;
|
||||||
nsWeakPtr mCurrCtrlNormalSel;
|
WeakPtr<dom::Selection> mCurrCtrlNormalSel;
|
||||||
nsWeakPtr mCurrCtrlSpellSel;
|
WeakPtr<dom::Selection> mCurrCtrlSpellSel;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
|
|
|
||||||
|
|
@ -783,10 +783,4 @@ ToSelectionTypeMask(SelectionType aSelectionType)
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
inline mozilla::dom::Selection*
|
|
||||||
nsISelection::AsSelection()
|
|
||||||
{
|
|
||||||
return static_cast<mozilla::dom::Selection*>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // mozilla_Selection_h__
|
#endif // mozilla_Selection_h__
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,7 @@ nsCopySupport::GetTransferableForNode(nsINode* aNode,
|
||||||
if (NS_WARN_IF(result.Failed())) {
|
if (NS_WARN_IF(result.Failed())) {
|
||||||
return result.StealNSResult();
|
return result.StealNSResult();
|
||||||
}
|
}
|
||||||
selection->AsSelection()->AddRangeInternal(*range, aDoc, result);
|
selection->AddRangeInternal(*range, aDoc, result);
|
||||||
if (NS_WARN_IF(result.Failed())) {
|
if (NS_WARN_IF(result.Failed())) {
|
||||||
return result.StealNSResult();
|
return result.StealNSResult();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6324,9 +6324,7 @@ nsGlobalWindowOuter::GetSelectionOuter()
|
||||||
if (!presShell) {
|
if (!presShell) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
nsISelection* domSelection =
|
return presShell->GetCurrentSelection(SelectionType::eNormal);
|
||||||
presShell->GetCurrentSelection(SelectionType::eNormal);
|
|
||||||
return domSelection ? domSelection->AsSelection() : nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<Selection>
|
already_AddRefed<Selection>
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,4 @@ class Selection;
|
||||||
[shim(Selection), uuid(e0a4d4b3-f34e-44bd-b1f2-4e3bde9b6915)]
|
[shim(Selection), uuid(e0a4d4b3-f34e-44bd-b1f2-4e3bde9b6915)]
|
||||||
interface nsISelection : nsISupports
|
interface nsISelection : nsISupports
|
||||||
{
|
{
|
||||||
|
|
||||||
%{C++
|
|
||||||
/**
|
|
||||||
* AsSelection() returns a pointer to Selection class.
|
|
||||||
*
|
|
||||||
* In order to avoid circular dependency issues, this method is defined
|
|
||||||
* in mozilla/dom/Selection.h. Consumers need to #include that header.
|
|
||||||
*/
|
|
||||||
inline mozilla::dom::Selection* AsSelection();
|
|
||||||
%}
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3127,11 +3127,11 @@ ContentEventHandler::OnSelectionEvent(WidgetSelectionEvent* aEvent)
|
||||||
// Get selection to manipulate
|
// Get selection to manipulate
|
||||||
// XXX why do we need to get them from ISM? This method should work fine
|
// XXX why do we need to get them from ISM? This method should work fine
|
||||||
// without ISM.
|
// without ISM.
|
||||||
nsCOMPtr<nsISelection> sel;
|
RefPtr<Selection> sel;
|
||||||
nsresult rv =
|
nsresult rv =
|
||||||
IMEStateManager::GetFocusSelectionAndRoot(getter_AddRefs(sel),
|
IMEStateManager::GetFocusSelectionAndRoot(getter_AddRefs(sel),
|
||||||
getter_AddRefs(mRootContent));
|
getter_AddRefs(mRootContent));
|
||||||
mSelection = sel ? sel->AsSelection() : nullptr;
|
mSelection = sel;
|
||||||
if (rv != NS_ERROR_NOT_AVAILABLE) {
|
if (rv != NS_ERROR_NOT_AVAILABLE) {
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -696,7 +696,7 @@ IMEContentObserver::IsEditorComposing() const
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
IMEContentObserver::GetSelectionAndRoot(nsISelection** aSelection,
|
IMEContentObserver::GetSelectionAndRoot(dom::Selection** aSelection,
|
||||||
nsIContent** aRootContent) const
|
nsIContent** aRootContent) const
|
||||||
{
|
{
|
||||||
if (!mEditableNode || !mSelection) {
|
if (!mEditableNode || !mSelection) {
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ public:
|
||||||
void SuppressNotifyingIME();
|
void SuppressNotifyingIME();
|
||||||
void UnsuppressNotifyingIME();
|
void UnsuppressNotifyingIME();
|
||||||
nsPresContext* GetPresContext() const;
|
nsPresContext* GetPresContext() const;
|
||||||
nsresult GetSelectionAndRoot(nsISelection** aSelection,
|
nsresult GetSelectionAndRoot(dom::Selection** aSelection,
|
||||||
nsIContent** aRoot) const;
|
nsIContent** aRoot) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1949,7 +1949,7 @@ IMEStateManager::CreateIMEContentObserver(EditorBase* aEditorBase)
|
||||||
|
|
||||||
// static
|
// static
|
||||||
nsresult
|
nsresult
|
||||||
IMEStateManager::GetFocusSelectionAndRoot(nsISelection** aSelection,
|
IMEStateManager::GetFocusSelectionAndRoot(Selection** aSelection,
|
||||||
nsIContent** aRootContent)
|
nsIContent** aRootContent)
|
||||||
{
|
{
|
||||||
if (!sActiveIMEContentObserver) {
|
if (!sActiveIMEContentObserver) {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@ class IMEContentObserver;
|
||||||
class TextCompositionArray;
|
class TextCompositionArray;
|
||||||
class TextComposition;
|
class TextComposition;
|
||||||
|
|
||||||
|
namespace dom {
|
||||||
|
class Selection;
|
||||||
|
} // namespace dom
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IMEStateManager manages InputContext (e.g., active editor type, IME enabled
|
* IMEStateManager manages InputContext (e.g., active editor type, IME enabled
|
||||||
* state and IME open state) of nsIWidget instances, manages IMEContentObserver
|
* state and IME open state) of nsIWidget instances, manages IMEContentObserver
|
||||||
|
|
@ -151,7 +155,7 @@ public:
|
||||||
// control compared to having the two methods incorporated into OnChangeFocus
|
// control compared to having the two methods incorporated into OnChangeFocus
|
||||||
|
|
||||||
// Get the focused editor's selection and root
|
// Get the focused editor's selection and root
|
||||||
static nsresult GetFocusSelectionAndRoot(nsISelection** aSel,
|
static nsresult GetFocusSelectionAndRoot(dom::Selection** aSel,
|
||||||
nsIContent** aRoot);
|
nsIContent** aRoot);
|
||||||
// This method updates the current IME state. However, if the enabled state
|
// This method updates the current IME state. However, if the enabled state
|
||||||
// isn't changed by the new state, this method does nothing.
|
// isn't changed by the new state, this method does nothing.
|
||||||
|
|
|
||||||
|
|
@ -350,12 +350,12 @@ ComposerCommandsUpdater::SelectionIsCollapsed()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsISelection> domSelection = mDOMWindow->GetSelection();
|
RefPtr<dom::Selection> domSelection = mDOMWindow->GetSelection();
|
||||||
if (NS_WARN_IF(!domSelection)) {
|
if (NS_WARN_IF(!domSelection)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return domSelection->AsSelection()->IsCollapsed();
|
return domSelection->IsCollapsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<nsPICommandUpdater>
|
already_AddRefed<nsPICommandUpdater>
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,7 @@ TextEditRules::CheckBidiLevelForDeletion(
|
||||||
|
|
||||||
nsBidiLevel levelBefore;
|
nsBidiLevel levelBefore;
|
||||||
nsBidiLevel levelAfter;
|
nsBidiLevel levelAfter;
|
||||||
RefPtr<nsFrameSelection> frameSelection =
|
RefPtr<nsFrameSelection> frameSelection = aSelection->GetFrameSelection();
|
||||||
aSelection->AsSelection()->GetFrameSelection();
|
|
||||||
NS_ENSURE_TRUE(frameSelection, NS_ERROR_NULL_POINTER);
|
NS_ENSURE_TRUE(frameSelection, NS_ERROR_NULL_POINTER);
|
||||||
|
|
||||||
nsPrevNextBidiLevels levels = frameSelection->
|
nsPrevNextBidiLevels levels = frameSelection->
|
||||||
|
|
|
||||||
|
|
@ -4979,7 +4979,7 @@ PresShell::CreateRangePaintInfo(nsRange* aRange,
|
||||||
|
|
||||||
already_AddRefed<SourceSurface>
|
already_AddRefed<SourceSurface>
|
||||||
PresShell::PaintRangePaintInfo(const nsTArray<UniquePtr<RangePaintInfo>>& aItems,
|
PresShell::PaintRangePaintInfo(const nsTArray<UniquePtr<RangePaintInfo>>& aItems,
|
||||||
nsISelection* aSelection,
|
Selection* aSelection,
|
||||||
nsIntRegion* aRegion,
|
nsIntRegion* aRegion,
|
||||||
nsRect aArea,
|
nsRect aArea,
|
||||||
const LayoutDeviceIntPoint aPoint,
|
const LayoutDeviceIntPoint aPoint,
|
||||||
|
|
@ -5108,7 +5108,7 @@ PresShell::PaintRangePaintInfo(const nsTArray<UniquePtr<RangePaintInfo>>& aItems
|
||||||
// selection.
|
// selection.
|
||||||
RefPtr<nsFrameSelection> frameSelection;
|
RefPtr<nsFrameSelection> frameSelection;
|
||||||
if (aSelection) {
|
if (aSelection) {
|
||||||
frameSelection = aSelection->AsSelection()->GetFrameSelection();
|
frameSelection = aSelection->GetFrameSelection();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
frameSelection = FrameSelection();
|
frameSelection = FrameSelection();
|
||||||
|
|
|
||||||
|
|
@ -541,7 +541,7 @@ private:
|
||||||
*/
|
*/
|
||||||
already_AddRefed<SourceSurface>
|
already_AddRefed<SourceSurface>
|
||||||
PaintRangePaintInfo(const nsTArray<UniquePtr<RangePaintInfo>>& aItems,
|
PaintRangePaintInfo(const nsTArray<UniquePtr<RangePaintInfo>>& aItems,
|
||||||
nsISelection* aSelection,
|
dom::Selection* aSelection,
|
||||||
nsIntRegion* aRegion,
|
nsIntRegion* aRegion,
|
||||||
nsRect aArea,
|
nsRect aArea,
|
||||||
const LayoutDeviceIntPoint aPoint,
|
const LayoutDeviceIntPoint aPoint,
|
||||||
|
|
|
||||||
|
|
@ -415,22 +415,22 @@ nsCaret::GetFrameAndOffset(Selection* aSelection,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ nsIFrame*
|
/* static */ nsIFrame*
|
||||||
nsCaret::GetGeometry(nsISelection* aSelection, nsRect* aRect)
|
nsCaret::GetGeometry(Selection* aSelection, nsRect* aRect)
|
||||||
{
|
{
|
||||||
int32_t frameOffset;
|
int32_t frameOffset;
|
||||||
Selection* selection = aSelection ? aSelection->AsSelection() : nullptr;
|
nsIFrame* frame = GetFrameAndOffset(aSelection, nullptr, 0, &frameOffset);
|
||||||
nsIFrame* frame = GetFrameAndOffset(selection, nullptr, 0, &frameOffset);
|
|
||||||
if (frame) {
|
if (frame) {
|
||||||
*aRect = GetGeometryForFrame(frame, frameOffset, nullptr);
|
*aRect = GetGeometryForFrame(frame, frameOffset, nullptr);
|
||||||
}
|
}
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsCaret::SchedulePaint(nsISelection* aSelection)
|
void
|
||||||
|
nsCaret::SchedulePaint(Selection* aSelection)
|
||||||
{
|
{
|
||||||
Selection* selection;
|
Selection* selection;
|
||||||
if (aSelection) {
|
if (aSelection) {
|
||||||
selection = aSelection->AsSelection();
|
selection = aSelection;
|
||||||
} else {
|
} else {
|
||||||
selection = GetSelection();
|
selection = GetSelection();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ class nsCaret final : public nsISelectionListener
|
||||||
* Schedule a repaint for the frame where the caret would appear.
|
* Schedule a repaint for the frame where the caret would appear.
|
||||||
* Does not check visibility etc.
|
* Does not check visibility etc.
|
||||||
*/
|
*/
|
||||||
void SchedulePaint(nsISelection* aSelection = nullptr);
|
void SchedulePaint(mozilla::dom::Selection* aSelection = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a frame to paint in, and the bounds of the painted caret
|
* Returns a frame to paint in, and the bounds of the painted caret
|
||||||
|
|
@ -176,7 +176,7 @@ class nsCaret final : public nsISelectionListener
|
||||||
* This rect does not include any extra decorations for bidi.
|
* This rect does not include any extra decorations for bidi.
|
||||||
* @param aRect must be non-null
|
* @param aRect must be non-null
|
||||||
*/
|
*/
|
||||||
static nsIFrame* GetGeometry(nsISelection* aSelection,
|
static nsIFrame* GetGeometry(mozilla::dom::Selection* aSelection,
|
||||||
nsRect* aRect);
|
nsRect* aRect);
|
||||||
static nsresult GetCaretFrameForNodeOffset(nsFrameSelection* aFrameSelection,
|
static nsresult GetCaretFrameForNodeOffset(nsFrameSelection* aFrameSelection,
|
||||||
nsIContent* aContentNode,
|
nsIContent* aContentNode,
|
||||||
|
|
|
||||||
|
|
@ -1739,7 +1739,7 @@ nsFrameSelection::CommonPageMove(bool aForward,
|
||||||
|
|
||||||
// find out where the caret is.
|
// find out where the caret is.
|
||||||
// we should know mDesiredPos value of nsFrameSelection, but I havent seen that behavior in other windows applications yet.
|
// we should know mDesiredPos value of nsFrameSelection, but I havent seen that behavior in other windows applications yet.
|
||||||
nsISelection* domSel = GetSelection(SelectionType::eNormal);
|
Selection* domSel = GetSelection(SelectionType::eNormal);
|
||||||
if (!domSel) {
|
if (!domSel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
#include "nsISelectionController.h"
|
#include "nsISelectionController.h"
|
||||||
#include "nsISelection.h"
|
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsITextControlFrame.h"
|
#include "nsITextControlFrame.h"
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
|
|
@ -485,15 +484,13 @@ nsWebBrowserFind::SetRangeAroundDocument(nsRange* aSearchRange,
|
||||||
nsresult
|
nsresult
|
||||||
nsWebBrowserFind::GetSearchLimits(nsRange* aSearchRange,
|
nsWebBrowserFind::GetSearchLimits(nsRange* aSearchRange,
|
||||||
nsRange* aStartPt, nsRange* aEndPt,
|
nsRange* aStartPt, nsRange* aEndPt,
|
||||||
nsIDOMDocument* aDoc, nsISelection* aSel,
|
nsIDOMDocument* aDoc, Selection* aSel,
|
||||||
bool aWrap)
|
bool aWrap)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aSel);
|
NS_ENSURE_ARG_POINTER(aSel);
|
||||||
|
|
||||||
Selection* sel = aSel->AsSelection();
|
|
||||||
|
|
||||||
// There is a selection.
|
// There is a selection.
|
||||||
uint32_t count = sel->RangeCount();
|
uint32_t count = aSel->RangeCount();
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
return SetRangeAroundDocument(aSearchRange, aStartPt, aEndPt, aDoc);
|
return SetRangeAroundDocument(aSearchRange, aStartPt, aEndPt, aDoc);
|
||||||
}
|
}
|
||||||
|
|
@ -519,7 +516,7 @@ nsWebBrowserFind::GetSearchLimits(nsRange* aSearchRange,
|
||||||
if (!mFindBackwards && !aWrap) {
|
if (!mFindBackwards && !aWrap) {
|
||||||
// This isn't quite right, since the selection's ranges aren't
|
// This isn't quite right, since the selection's ranges aren't
|
||||||
// necessarily in order; but they usually will be.
|
// necessarily in order; but they usually will be.
|
||||||
range = sel->GetRangeAt(count - 1);
|
range = aSel->GetRangeAt(count - 1);
|
||||||
if (!range) {
|
if (!range) {
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
@ -538,7 +535,7 @@ nsWebBrowserFind::GetSearchLimits(nsRange* aSearchRange,
|
||||||
}
|
}
|
||||||
// Backward, not wrapping: DocStart to SelStart
|
// Backward, not wrapping: DocStart to SelStart
|
||||||
else if (mFindBackwards && !aWrap) {
|
else if (mFindBackwards && !aWrap) {
|
||||||
range = sel->GetRangeAt(0);
|
range = aSel->GetRangeAt(0);
|
||||||
if (!range) {
|
if (!range) {
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
@ -557,7 +554,7 @@ nsWebBrowserFind::GetSearchLimits(nsRange* aSearchRange,
|
||||||
}
|
}
|
||||||
// Forward, wrapping: DocStart to SelEnd
|
// Forward, wrapping: DocStart to SelEnd
|
||||||
else if (!mFindBackwards && aWrap) {
|
else if (!mFindBackwards && aWrap) {
|
||||||
range = sel->GetRangeAt(count - 1);
|
range = aSel->GetRangeAt(count - 1);
|
||||||
if (!range) {
|
if (!range) {
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
@ -576,7 +573,7 @@ nsWebBrowserFind::GetSearchLimits(nsRange* aSearchRange,
|
||||||
}
|
}
|
||||||
// Backward, wrapping: SelStart to DocEnd
|
// Backward, wrapping: SelStart to DocEnd
|
||||||
else if (mFindBackwards && aWrap) {
|
else if (mFindBackwards && aWrap) {
|
||||||
range = sel->GetRangeAt(0);
|
range = aSel->GetRangeAt(0);
|
||||||
if (!range) {
|
if (!range) {
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
#define NS_WEB_BROWSER_FIND_CID \
|
#define NS_WEB_BROWSER_FIND_CID \
|
||||||
{0x57cf9383, 0x3405, 0x11d5, {0xbe, 0x5b, 0xaa, 0x20, 0xfa, 0x2c, 0xf3, 0x7c}}
|
{0x57cf9383, 0x3405, 0x11d5, {0xbe, 0x5b, 0xaa, 0x20, 0xfa, 0x2c, 0xf3, 0x7c}}
|
||||||
|
|
||||||
class nsISelection;
|
|
||||||
class nsIDOMWindow;
|
class nsIDOMWindow;
|
||||||
|
|
||||||
class nsIDocShell;
|
class nsIDocShell;
|
||||||
|
|
@ -75,7 +74,7 @@ protected:
|
||||||
nsresult GetRootNode(nsIDOMDocument* aDomDoc, nsIDOMNode** aNode);
|
nsresult GetRootNode(nsIDOMDocument* aDomDoc, nsIDOMNode** aNode);
|
||||||
nsresult GetSearchLimits(nsRange* aRange,
|
nsresult GetSearchLimits(nsRange* aRange,
|
||||||
nsRange* aStartPt, nsRange* aEndPt,
|
nsRange* aStartPt, nsRange* aEndPt,
|
||||||
nsIDOMDocument* aDoc, nsISelection* aSel,
|
nsIDOMDocument* aDoc, mozilla::dom::Selection* aSel,
|
||||||
bool aWrap);
|
bool aWrap);
|
||||||
nsresult SetRangeAroundDocument(nsRange* aSearchRange,
|
nsresult SetRangeAroundDocument(nsRange* aSearchRange,
|
||||||
nsRange* aStartPoint,
|
nsRange* aStartPoint,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue