1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_a11y_HyperTextAccessible_inl_h__
7 #define mozilla_a11y_HyperTextAccessible_inl_h__
9 #include "HyperTextAccessible.h"
11 #include "nsAccUtils.h"
13 #include "nsIClipboard.h"
14 #include "nsFrameSelection.h"
16 #include "mozilla/EditorBase.h"
21 inline void HyperTextAccessible::SetCaretOffset(int32_t aOffset
) {
22 SetSelectionRange(aOffset
, aOffset
);
23 // XXX: Force cache refresh until a good solution for AT emulation of user
24 // input is implemented (AccessFu caret movement).
25 SelectionMgr()->UpdateCaretOffset(this, aOffset
);
28 inline bool HyperTextAccessible::IsCaretAtEndOfLine() const {
29 RefPtr
<nsFrameSelection
> frameSelection
= FrameSelection();
30 return frameSelection
&& frameSelection
->GetHint() == CARET_ASSOCIATE_BEFORE
;
33 inline already_AddRefed
<nsFrameSelection
> HyperTextAccessible::FrameSelection()
35 nsIFrame
* frame
= GetFrame();
36 return frame
? frame
->GetFrameSelection() : nullptr;
39 inline dom::Selection
* HyperTextAccessible::DOMSelection() const {
40 RefPtr
<nsFrameSelection
> frameSelection
= FrameSelection();
41 return frameSelection
? frameSelection
->GetSelection(SelectionType::eNormal
)
46 } // namespace mozilla