icecat: add release icecat-140.9.0-1gnu1 for ecne
This commit is contained in:
parent
8eb1f1732f
commit
a5f93cb214
1197 changed files with 30593 additions and 15344 deletions
|
|
@ -54,7 +54,7 @@ enum class SystemGroupOnly { eYes, eNo };
|
|||
* Event messages
|
||||
*/
|
||||
|
||||
typedef uint16_t EventMessageType;
|
||||
using EventMessageType = uint16_t;
|
||||
|
||||
enum EventMessage : EventMessageType {
|
||||
|
||||
|
|
@ -102,19 +102,20 @@ const char* ToChar(EventMessage aEventMessage);
|
|||
* Event class IDs
|
||||
*/
|
||||
|
||||
typedef uint8_t EventClassIDType;
|
||||
using EventClassIDType = uint8_t;
|
||||
|
||||
enum EventClassID : EventClassIDType {
|
||||
// The event class name will be:
|
||||
// eBasicEventClass for WidgetEvent
|
||||
// eFooEventClass for WidgetFooEvent or InternalFooEvent
|
||||
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) eBasic##aName##Class
|
||||
#define NS_EVENT_CLASS(aPrefix, aName) , e##aName##Class
|
||||
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) eBasic##aName##Class,
|
||||
#define NS_EVENT_CLASS(aPrefix, aName) e##aName##Class,
|
||||
|
||||
#include "mozilla/EventClassList.h"
|
||||
|
||||
#undef NS_EVENT_CLASS
|
||||
#undef NS_ROOT_EVENT_CLASS
|
||||
eEventClassID_MaxValue
|
||||
};
|
||||
|
||||
const char* ToChar(EventClassID aEventClassID);
|
||||
|
|
@ -123,8 +124,7 @@ typedef uint16_t Modifiers;
|
|||
|
||||
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) KEY_NAME_INDEX_##aCPPName,
|
||||
|
||||
typedef uint16_t KeyNameIndexType;
|
||||
enum KeyNameIndex : KeyNameIndexType {
|
||||
enum KeyNameIndex : uint16_t {
|
||||
#include "mozilla/KeyNameList.h"
|
||||
// If a DOM keyboard event is synthesized by script, this is used. Then,
|
||||
// specified key name should be stored and use it as .key value.
|
||||
|
|
@ -138,8 +138,7 @@ const nsCString ToString(KeyNameIndex aKeyNameIndex);
|
|||
#define NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName) \
|
||||
CODE_NAME_INDEX_##aCPPName,
|
||||
|
||||
typedef uint8_t CodeNameIndexType;
|
||||
enum CodeNameIndex : CodeNameIndexType {
|
||||
enum CodeNameIndex : uint8_t {
|
||||
#include "mozilla/PhysicalKeyCodeNameList.h"
|
||||
// If a DOM keyboard event is synthesized by script, this is used. Then,
|
||||
// specified code name should be stored and use it as .code value.
|
||||
|
|
|
|||
|
|
@ -283,18 +283,11 @@ class WidgetMouseEvent : public WidgetMouseEventBase,
|
|||
ALLOW_DEPRECATED_READPARAM
|
||||
|
||||
public:
|
||||
typedef bool ReasonType;
|
||||
enum Reason : ReasonType { eReal, eSynthesized };
|
||||
enum Reason : bool { eReal, eSynthesized };
|
||||
|
||||
typedef uint8_t ContextMenuTriggerType;
|
||||
enum ContextMenuTrigger : ContextMenuTriggerType {
|
||||
eNormal,
|
||||
eContextMenuKey,
|
||||
eControlClick
|
||||
};
|
||||
enum ContextMenuTrigger : uint8_t { eNormal, eContextMenuKey, eControlClick };
|
||||
|
||||
typedef uint8_t ExitFromType;
|
||||
enum ExitFrom : ExitFromType {
|
||||
enum ExitFrom : uint8_t {
|
||||
ePlatformChild,
|
||||
ePlatformTopLevel,
|
||||
ePuppet,
|
||||
|
|
|
|||
|
|
@ -586,11 +586,24 @@ class WidgetKeyboardEvent final : public WidgetInputEvent {
|
|||
mEditCommandsForRichTextEditorInitialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this stores one or more edit commands for at least one
|
||||
* editor type. This does not initialize them when they have not been
|
||||
* initialized yet. Therefore, this returns just current status.
|
||||
*/
|
||||
[[nodiscard]] bool HasEditCommands() const {
|
||||
return !mEditCommandsForSingleLineEditor.IsEmpty() ||
|
||||
!mEditCommandsForMultiLineEditor.IsEmpty() ||
|
||||
!mEditCommandsForRichTextEditor.IsEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* EditCommandsConstRef() returns reference to edit commands for aType.
|
||||
*/
|
||||
const nsTArray<CommandInt>& EditCommandsConstRef(
|
||||
NativeKeyBindingsType aType) const {
|
||||
MOZ_ASSERT(!IsHandledInRemoteProcess(),
|
||||
"Editor commands is not available on reply event");
|
||||
return const_cast<WidgetKeyboardEvent*>(this)->EditCommandsRef(aType);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1281,6 +1281,12 @@ bool WidgetKeyboardEvent::ExecuteEditCommands(NativeKeyBindingsType aType,
|
|||
return false;
|
||||
}
|
||||
|
||||
// If this is a reply event, we shouldn't execute the native key bindings in
|
||||
// the parent process.
|
||||
if (NS_WARN_IF(IsHandledInRemoteProcess())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IsEditCommandsInitializedRef(aType)) {
|
||||
Maybe<WritingMode> writingMode;
|
||||
if (RefPtr<widget::TextEventDispatcher> textEventDispatcher =
|
||||
|
|
|
|||
|
|
@ -5571,11 +5571,11 @@ void nsCocoaWindow::HideWindowChrome(bool aShouldHide) {
|
|||
|
||||
// Recreate the window with the right border style.
|
||||
NSRect frameRect = mWindow.frame;
|
||||
BOOL restorable = mWindow.restorable;
|
||||
BOOL isPrivateWindow = !mWindow.restorable;
|
||||
DestroyNativeWindow();
|
||||
nsresult rv = CreateNativeWindow(
|
||||
frameRect, aShouldHide ? BorderStyle::None : mBorderStyle, true,
|
||||
restorable);
|
||||
isPrivateWindow);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
|
||||
// Re-import state.
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@
|
|||
|
||||
NS_IMPL_ISUPPORTS(nsMacSharingService, nsIMacSharingService)
|
||||
|
||||
NSString* const remindersServiceName =
|
||||
NSString* const oldRemindersServiceName =
|
||||
@"com.apple.reminders.RemindersShareExtension";
|
||||
NSString* const newRemindersServiceName =
|
||||
@"com.apple.reminders.sharingextension";
|
||||
|
||||
// These are some undocumented constants also used by Safari
|
||||
// to let us open the preferences window
|
||||
|
|
@ -67,12 +69,14 @@ static bool ShouldIgnoreProvider(NSString* aProviderName) {
|
|||
- (void)sharingService:(NSSharingService*)sharingService
|
||||
didShareItems:(NSArray*)items {
|
||||
[self cleanup];
|
||||
[self release];
|
||||
}
|
||||
|
||||
- (void)sharingService:(NSSharingService*)service
|
||||
didFailToShareItems:(NSArray*)items
|
||||
error:(NSError*)error {
|
||||
[self cleanup];
|
||||
[self release];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
|
|
@ -177,39 +181,44 @@ nsMacSharingService::ShareUrl(const nsAString& aServiceName,
|
|||
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
|
||||
|
||||
NSString* serviceName = nsCocoaUtils::ToNSString(aServiceName);
|
||||
NSURL* pageUrl = nsCocoaUtils::ToNSURL(aPageUrl);
|
||||
NSString* pageTitle = nsCocoaUtils::ToNSString(aPageTitle);
|
||||
NSSharingService* service =
|
||||
[NSSharingService sharingServiceNamed:serviceName];
|
||||
if (!service) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NSString* pageTitle = nsCocoaUtils::ToNSString(aPageTitle);
|
||||
[service setSubject:pageTitle];
|
||||
|
||||
NSURL* pageUrl = nsCocoaUtils::ToNSURL(aPageUrl);
|
||||
if (!pageUrl) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Reminders fetch its data from an activity, not the share data
|
||||
if ([[service name] isEqual:remindersServiceName]) {
|
||||
NSUserActivity* shareActivity = [[NSUserActivity alloc]
|
||||
initWithActivityType:NSUserActivityTypeBrowsingWeb];
|
||||
if ([serviceName isEqual:oldRemindersServiceName] ||
|
||||
[serviceName isEqual:newRemindersServiceName]) {
|
||||
NSUserActivity* shareActivity = [[[NSUserActivity alloc]
|
||||
initWithActivityType:NSUserActivityTypeBrowsingWeb] autorelease];
|
||||
|
||||
if ([pageUrl.scheme hasPrefix:@"http"]) {
|
||||
[shareActivity setWebpageURL:pageUrl];
|
||||
}
|
||||
|
||||
[shareActivity setEligibleForHandoff:NO];
|
||||
[shareActivity setTitle:pageTitle];
|
||||
[shareActivity becomeCurrent];
|
||||
|
||||
// Pass ownership of shareActivity to shareDelegate, which will release the
|
||||
// activity once sharing has completed.
|
||||
SharingServiceDelegate* shareDelegate =
|
||||
[[SharingServiceDelegate alloc] initWithActivity:shareActivity];
|
||||
[shareActivity release];
|
||||
|
||||
[service setDelegate:shareDelegate];
|
||||
[shareDelegate release];
|
||||
[service setDelegate:shareDelegate]; // weak reference
|
||||
}
|
||||
|
||||
// Twitter likes the the title as an additional share item
|
||||
NSArray* toShare = [[service name] isEqual:NSSharingServiceNamePostOnTwitter]
|
||||
NSArray* toShare = [serviceName isEqual:NSSharingServiceNamePostOnTwitter]
|
||||
? @[ pageUrl, pageTitle ]
|
||||
: @[ pageUrl ];
|
||||
|
||||
[service setSubject:pageTitle];
|
||||
[service performWithItems:toShare];
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ already_AddRefed<GdkPixbuf> nsImageToPixbuf::ImageToPixbuf(
|
|||
|
||||
already_AddRefed<GdkPixbuf> nsImageToPixbuf::SourceSurfaceToPixbuf(
|
||||
SourceSurface* aSurface, int32_t aWidth, int32_t aHeight) {
|
||||
using mozilla::gfx::Factory;
|
||||
|
||||
MOZ_ASSERT(aSurface);
|
||||
MOZ_ASSERT(aWidth <= aSurface->GetSize().width &&
|
||||
aHeight <= aSurface->GetSize().height,
|
||||
"Requested rect is bigger than the supplied surface");
|
||||
|
|
@ -72,11 +75,43 @@ already_AddRefed<GdkPixbuf> nsImageToPixbuf::SourceSurfaceToPixbuf(
|
|||
uint32_t destStride = gdk_pixbuf_get_rowstride(pixbuf);
|
||||
guchar* destPixels = gdk_pixbuf_get_pixels(pixbuf);
|
||||
|
||||
RefPtr<DataSourceSurface> dataSurface = aSurface->GetDataSurface();
|
||||
RefPtr<DataSourceSurface> dataSurface;
|
||||
DataSourceSurface::MappedSurface map;
|
||||
if (!dataSurface->Map(DataSourceSurface::MapType::READ, &map)) {
|
||||
return nullptr;
|
||||
|
||||
SurfaceFormat sourceFormat = aSurface->GetFormat();
|
||||
if (MOZ_UNLIKELY(sourceFormat != SurfaceFormat::B8G8R8A8 &&
|
||||
sourceFormat != SurfaceFormat::B8G8R8X8)) {
|
||||
dataSurface = Factory::CreateDataSourceSurface(
|
||||
mozilla::gfx::IntSize(aWidth, aHeight), SurfaceFormat::B8G8R8A8);
|
||||
if (NS_WARN_IF(!dataSurface)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!dataSurface->Map(DataSourceSurface::MapType::READ_WRITE, &map)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<mozilla::gfx::DrawTarget> dt = Factory::CreateDrawTargetForData(
|
||||
mozilla::gfx::BackendType::CAIRO, map.mData, dataSurface->GetSize(),
|
||||
map.mStride, dataSurface->GetFormat());
|
||||
if (!dt) {
|
||||
dataSurface->Unmap();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
dt->FillRect(
|
||||
mozilla::gfx::Rect(0, 0, aWidth, aHeight),
|
||||
mozilla::gfx::SurfacePattern(aSurface, mozilla::gfx::ExtendMode::CLAMP),
|
||||
mozilla::gfx::DrawOptions(1.0f,
|
||||
mozilla::gfx::CompositionOp::OP_SOURCE));
|
||||
} else {
|
||||
dataSurface = aSurface->GetDataSurface();
|
||||
if (!dataSurface->Map(DataSourceSurface::MapType::READ, &map)) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(dataSurface);
|
||||
MOZ_ASSERT(map.mData);
|
||||
|
||||
uint8_t* srcData = map.mData;
|
||||
int32_t srcStride = map.mStride;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,12 @@ struct ParamTraits<mozilla::EventMessage>
|
|||
mozilla::EventMessage, mozilla::EventMessage(0),
|
||||
mozilla::EventMessage::eEventMessage_MaxValue> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::EventClassID>
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::EventClassID, mozilla::EventClassID(0),
|
||||
mozilla::EventClassID::eEventClassID_MaxValue> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::BaseEventFlags> {
|
||||
using paramType = mozilla::BaseEventFlags;
|
||||
|
|
@ -51,7 +57,7 @@ struct ParamTraits<mozilla::WidgetEvent> {
|
|||
// Mark the event as posted to another process.
|
||||
const_cast<mozilla::WidgetEvent&>(aParam).MarkAsPostedToRemoteProcess();
|
||||
|
||||
WriteParam(aWriter, static_cast<mozilla::EventClassIDType>(aParam.mClass));
|
||||
WriteParam(aWriter, aParam.mClass);
|
||||
WriteParam(aWriter, aParam.mMessage);
|
||||
WriteParam(aWriter, aParam.mRefPoint);
|
||||
WriteParam(aWriter, aParam.mFocusSequenceNumber);
|
||||
|
|
@ -61,15 +67,13 @@ struct ParamTraits<mozilla::WidgetEvent> {
|
|||
}
|
||||
|
||||
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||
mozilla::EventClassIDType eventClassID = 0;
|
||||
bool ret = ReadParam(aReader, &eventClassID) &&
|
||||
ReadParam(aReader, &aResult->mMessage) &&
|
||||
ReadParam(aReader, &aResult->mRefPoint) &&
|
||||
ReadParam(aReader, &aResult->mFocusSequenceNumber) &&
|
||||
ReadParam(aReader, &aResult->mTimeStamp) &&
|
||||
ReadParam(aReader, &aResult->mFlags) &&
|
||||
ReadParam(aReader, &aResult->mLayersId);
|
||||
aResult->mClass = static_cast<mozilla::EventClassID>(eventClassID);
|
||||
const bool ret = ReadParam(aReader, &aResult->mClass) &&
|
||||
ReadParam(aReader, &aResult->mMessage) &&
|
||||
ReadParam(aReader, &aResult->mRefPoint) &&
|
||||
ReadParam(aReader, &aResult->mFocusSequenceNumber) &&
|
||||
ReadParam(aReader, &aResult->mTimeStamp) &&
|
||||
ReadParam(aReader, &aResult->mFlags) &&
|
||||
ReadParam(aReader, &aResult->mLayersId);
|
||||
if (ret) {
|
||||
// Reset cross process dispatching state here because the event has not
|
||||
// been dispatched to different process from current process.
|
||||
|
|
@ -131,6 +135,13 @@ struct ParamTraits<mozilla::WidgetMouseEventBase> {
|
|||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::WidgetWheelEvent::ScrollType>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::WidgetWheelEvent::ScrollType,
|
||||
mozilla::WidgetWheelEvent::SCROLL_DEFAULT,
|
||||
mozilla::WidgetWheelEvent::SCROLL_SMOOTHLY> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::WidgetWheelEvent> {
|
||||
using paramType = mozilla::WidgetWheelEvent;
|
||||
|
|
@ -150,7 +161,7 @@ struct ParamTraits<mozilla::WidgetWheelEvent> {
|
|||
WriteParam(aWriter, aParam.mIsNoLineOrPageDelta);
|
||||
WriteParam(aWriter, aParam.mLineOrPageDeltaX);
|
||||
WriteParam(aWriter, aParam.mLineOrPageDeltaY);
|
||||
WriteParam(aWriter, static_cast<uint8_t>(aParam.mScrollType));
|
||||
WriteParam(aWriter, aParam.mScrollType);
|
||||
WriteParam(aWriter, aParam.mOverflowDeltaX);
|
||||
WriteParam(aWriter, aParam.mOverflowDeltaY);
|
||||
WriteParam(aWriter, aParam.mViewPortIsOverscrolled);
|
||||
|
|
@ -160,32 +171,28 @@ struct ParamTraits<mozilla::WidgetWheelEvent> {
|
|||
}
|
||||
|
||||
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||
uint8_t scrollType = 0;
|
||||
bool rv = ReadParam(aReader,
|
||||
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
||||
ReadParam(aReader, &aResult->mDeltaX) &&
|
||||
ReadParam(aReader, &aResult->mDeltaY) &&
|
||||
ReadParam(aReader, &aResult->mDeltaZ) &&
|
||||
ReadParam(aReader, &aResult->mDeltaMode) &&
|
||||
ReadParam(aReader, &aResult->mWheelTicksX) &&
|
||||
ReadParam(aReader, &aResult->mWheelTicksY) &&
|
||||
ReadParam(aReader, &aResult->mCustomizedByUserPrefs) &&
|
||||
ReadParam(aReader, &aResult->mMayHaveMomentum) &&
|
||||
ReadParam(aReader, &aResult->mIsMomentum) &&
|
||||
ReadParam(aReader, &aResult->mIsNoLineOrPageDelta) &&
|
||||
ReadParam(aReader, &aResult->mLineOrPageDeltaX) &&
|
||||
ReadParam(aReader, &aResult->mLineOrPageDeltaY) &&
|
||||
ReadParam(aReader, &scrollType) &&
|
||||
ReadParam(aReader, &aResult->mOverflowDeltaX) &&
|
||||
ReadParam(aReader, &aResult->mOverflowDeltaY) &&
|
||||
ReadParam(aReader, &aResult->mViewPortIsOverscrolled) &&
|
||||
ReadParam(aReader, &aResult->mCanTriggerSwipe) &&
|
||||
ReadParam(aReader, &aResult->mAllowToOverrideSystemScrollSpeed) &&
|
||||
ReadParam(aReader,
|
||||
&aResult->mDeltaValuesHorizontalizedForDefaultHandler);
|
||||
aResult->mScrollType =
|
||||
static_cast<mozilla::WidgetWheelEvent::ScrollType>(scrollType);
|
||||
return rv;
|
||||
return ReadParam(aReader,
|
||||
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
||||
ReadParam(aReader, &aResult->mDeltaX) &&
|
||||
ReadParam(aReader, &aResult->mDeltaY) &&
|
||||
ReadParam(aReader, &aResult->mDeltaZ) &&
|
||||
ReadParam(aReader, &aResult->mDeltaMode) &&
|
||||
ReadParam(aReader, &aResult->mWheelTicksX) &&
|
||||
ReadParam(aReader, &aResult->mWheelTicksY) &&
|
||||
ReadParam(aReader, &aResult->mCustomizedByUserPrefs) &&
|
||||
ReadParam(aReader, &aResult->mMayHaveMomentum) &&
|
||||
ReadParam(aReader, &aResult->mIsMomentum) &&
|
||||
ReadParam(aReader, &aResult->mIsNoLineOrPageDelta) &&
|
||||
ReadParam(aReader, &aResult->mLineOrPageDeltaX) &&
|
||||
ReadParam(aReader, &aResult->mLineOrPageDeltaY) &&
|
||||
ReadParam(aReader, &aResult->mScrollType) &&
|
||||
ReadParam(aReader, &aResult->mOverflowDeltaX) &&
|
||||
ReadParam(aReader, &aResult->mOverflowDeltaY) &&
|
||||
ReadParam(aReader, &aResult->mViewPortIsOverscrolled) &&
|
||||
ReadParam(aReader, &aResult->mCanTriggerSwipe) &&
|
||||
ReadParam(aReader, &aResult->mAllowToOverrideSystemScrollSpeed) &&
|
||||
ReadParam(aReader,
|
||||
&aResult->mDeltaValuesHorizontalizedForDefaultHandler);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -214,6 +221,26 @@ struct ParamTraits<mozilla::WidgetPointerHelper> {
|
|||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::WidgetMouseEvent::Reason>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::WidgetMouseEvent::Reason, mozilla::WidgetMouseEvent::eReal,
|
||||
mozilla::WidgetMouseEvent::eSynthesized> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::WidgetMouseEvent::ContextMenuTrigger>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::WidgetMouseEvent::ContextMenuTrigger,
|
||||
mozilla::WidgetMouseEvent::eNormal,
|
||||
mozilla::WidgetMouseEvent::eControlClick> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::WidgetMouseEvent::ExitFrom>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::WidgetMouseEvent::ExitFrom,
|
||||
mozilla::WidgetMouseEvent::ePlatformChild,
|
||||
mozilla::WidgetMouseEvent::ePuppetParentToPuppetChild> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::WidgetMouseEvent> {
|
||||
using paramType = mozilla::WidgetMouseEvent;
|
||||
|
|
@ -235,40 +262,23 @@ struct ParamTraits<mozilla::WidgetMouseEvent> {
|
|||
static_cast<const mozilla::WidgetPointerHelper&>(aParam));
|
||||
WriteParam(aWriter, aParam.mIgnoreRootScrollFrame);
|
||||
WriteParam(aWriter, aParam.mClickEventPrevented);
|
||||
WriteParam(aWriter, static_cast<paramType::ReasonType>(aParam.mReason));
|
||||
WriteParam(aWriter, static_cast<paramType::ContextMenuTriggerType>(
|
||||
aParam.mContextMenuTrigger));
|
||||
WriteParam(aWriter, aParam.mExitFrom.isSome());
|
||||
if (aParam.mExitFrom.isSome()) {
|
||||
WriteParam(aWriter, static_cast<paramType::ExitFromType>(
|
||||
aParam.mExitFrom.value()));
|
||||
}
|
||||
WriteParam(aWriter, aParam.mReason);
|
||||
WriteParam(aWriter, aParam.mContextMenuTrigger);
|
||||
WriteParam(aWriter, aParam.mExitFrom);
|
||||
WriteParam(aWriter, aParam.mClickCount);
|
||||
}
|
||||
|
||||
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||
bool rv;
|
||||
paramType::ReasonType reason = 0;
|
||||
paramType::ContextMenuTriggerType contextMenuTrigger = 0;
|
||||
bool hasExitFrom = false;
|
||||
rv = ReadParam(aReader,
|
||||
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
||||
ReadParam(aReader,
|
||||
static_cast<mozilla::WidgetPointerHelper*>(aResult)) &&
|
||||
ReadParam(aReader, &aResult->mIgnoreRootScrollFrame) &&
|
||||
ReadParam(aReader, &aResult->mClickEventPrevented) &&
|
||||
ReadParam(aReader, &reason) && ReadParam(aReader, &contextMenuTrigger);
|
||||
aResult->mReason = static_cast<paramType::Reason>(reason);
|
||||
aResult->mContextMenuTrigger =
|
||||
static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger);
|
||||
rv = rv && ReadParam(aReader, &hasExitFrom);
|
||||
if (hasExitFrom) {
|
||||
paramType::ExitFromType exitFrom = 0;
|
||||
rv = rv && ReadParam(aReader, &exitFrom);
|
||||
aResult->mExitFrom = Some(static_cast<paramType::ExitFrom>(exitFrom));
|
||||
}
|
||||
rv = rv && ReadParam(aReader, &aResult->mClickCount);
|
||||
return rv;
|
||||
return ReadParam(aReader,
|
||||
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
||||
ReadParam(aReader,
|
||||
static_cast<mozilla::WidgetPointerHelper*>(aResult)) &&
|
||||
ReadParam(aReader, &aResult->mIgnoreRootScrollFrame) &&
|
||||
ReadParam(aReader, &aResult->mClickEventPrevented) &&
|
||||
ReadParam(aReader, &aResult->mReason) &&
|
||||
ReadParam(aReader, &aResult->mContextMenuTrigger) &&
|
||||
ReadParam(aReader, &aResult->mExitFrom) &&
|
||||
ReadParam(aReader, &aResult->mClickCount);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -423,16 +433,26 @@ struct ParamTraits<mozilla::ShortcutKeyCandidate> {
|
|||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::KeyNameIndex>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::KeyNameIndex, static_cast<mozilla::KeyNameIndex>(0),
|
||||
mozilla::KeyNameIndex::KEY_NAME_INDEX_USE_STRING> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::CodeNameIndex>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::CodeNameIndex, static_cast<mozilla::CodeNameIndex>(0),
|
||||
mozilla::CodeNameIndex::CODE_NAME_INDEX_USE_STRING> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::WidgetKeyboardEvent> {
|
||||
using paramType = mozilla::WidgetKeyboardEvent;
|
||||
|
||||
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||
WriteParam(aWriter, static_cast<const mozilla::WidgetInputEvent&>(aParam));
|
||||
WriteParam(aWriter,
|
||||
static_cast<mozilla::KeyNameIndexType>(aParam.mKeyNameIndex));
|
||||
WriteParam(aWriter,
|
||||
static_cast<mozilla::CodeNameIndexType>(aParam.mCodeNameIndex));
|
||||
WriteParam(aWriter, aParam.mKeyNameIndex);
|
||||
WriteParam(aWriter, aParam.mCodeNameIndex);
|
||||
WriteParam(aWriter, aParam.mKeyValue);
|
||||
WriteParam(aWriter, aParam.mCodeValue);
|
||||
WriteParam(aWriter, aParam.mKeyCode);
|
||||
|
|
@ -457,11 +477,9 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent> {
|
|||
}
|
||||
|
||||
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||
mozilla::KeyNameIndexType keyNameIndex = 0;
|
||||
mozilla::CodeNameIndexType codeNameIndex = 0;
|
||||
if (ReadParam(aReader, static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
|
||||
ReadParam(aReader, &keyNameIndex) &&
|
||||
ReadParam(aReader, &codeNameIndex) &&
|
||||
ReadParam(aReader, &aResult->mKeyNameIndex) &&
|
||||
ReadParam(aReader, &aResult->mCodeNameIndex) &&
|
||||
ReadParam(aReader, &aResult->mKeyValue) &&
|
||||
ReadParam(aReader, &aResult->mCodeValue) &&
|
||||
ReadParam(aReader, &aResult->mKeyCode) &&
|
||||
|
|
@ -482,9 +500,6 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent> {
|
|||
&aResult->mEditCommandsForMultiLineEditorInitialized) &&
|
||||
ReadParam(aReader,
|
||||
&aResult->mEditCommandsForRichTextEditorInitialized)) {
|
||||
aResult->mKeyNameIndex = static_cast<mozilla::KeyNameIndex>(keyNameIndex);
|
||||
aResult->mCodeNameIndex =
|
||||
static_cast<mozilla::CodeNameIndex>(codeNameIndex);
|
||||
aResult->mNativeKeyEvent = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue