1 /* -*- Mode: C++; tab-width: 40; 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 #include "ContentData.h"
8 #include "TextEvents.h"
12 /******************************************************************************
14 ******************************************************************************/
16 ContentSelection::ContentSelection(
17 const WidgetQueryContentEvent
& aSelectedTextEvent
)
18 : mWritingMode(aSelectedTextEvent
.mReply
->WritingModeRef()) {
19 MOZ_ASSERT(aSelectedTextEvent
.mMessage
== eQuerySelectedText
);
20 MOZ_ASSERT(aSelectedTextEvent
.Succeeded());
21 if (aSelectedTextEvent
.mReply
->mOffsetAndData
.isSome()) {
23 Some(OffsetAndData
<uint32_t>(aSelectedTextEvent
.mReply
->StartOffset(),
24 aSelectedTextEvent
.mReply
->DataRef(),
25 OffsetAndDataFor::SelectedString
));
29 } // namespace mozilla