HyperTextAccessible-inl.h (1027B)
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/. */ 5 6 #ifndef mozilla_a11y_HyperTextAccessible_inl_h__ 7 #define mozilla_a11y_HyperTextAccessible_inl_h__ 8 9 #include "HyperTextAccessible.h" 10 11 #include "nsAccUtils.h" 12 13 #include "nsIClipboard.h" 14 #include "nsFrameSelection.h" 15 16 #include "mozilla/CaretAssociationHint.h" 17 #include "mozilla/EditorBase.h" 18 19 namespace mozilla::a11y { 20 21 inline already_AddRefed<nsFrameSelection> HyperTextAccessible::FrameSelection() 22 const { 23 nsIFrame* frame = GetFrame(); 24 return frame ? frame->GetFrameSelection() : nullptr; 25 } 26 27 inline dom::Selection* HyperTextAccessible::DOMSelection() const { 28 RefPtr<nsFrameSelection> frameSelection = FrameSelection(); 29 return frameSelection ? &frameSelection->NormalSelection() : nullptr; 30 } 31 32 } // namespace mozilla::a11y 33 34 #endif