Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / widget / ContentData.cpp
blob529ccc5c0fb75bb5a1c3308537340122f16ab083
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"
10 namespace mozilla {
12 /******************************************************************************
13 * ContentSelection
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()) {
22 mOffsetAndData =
23 Some(OffsetAndData<uint32_t>(aSelectedTextEvent.mReply->StartOffset(),
24 aSelectedTextEvent.mReply->DataRef(),
25 OffsetAndDataFor::SelectedString));
29 } // namespace mozilla