diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index 6a6f9a452479..1f6f97ddd604 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -53,8 +53,8 @@ #include "mozilla/dom/CharacterData.h" // for CharacterData #include "mozilla/dom/DataTransfer.h" // for DataTransfer #include "mozilla/InternalMutationEvent.h" // for NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED -#include "mozilla/dom/Element.h" // for Element, nsINode::AsElement -#include "mozilla/dom/EventTarget.h" // for EventTarget +#include "mozilla/dom/Element.h" // for Element, nsINode::AsElement +#include "mozilla/dom/EventTarget.h" // for EventTarget #include "mozilla/dom/HTMLBodyElement.h" #include "mozilla/dom/HTMLBRElement.h" #include "mozilla/dom/Selection.h" // for Selection, etc. @@ -2396,17 +2396,17 @@ nsresult EditorBase::GetPreferredIMEState(IMEState* aState) { NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); switch (frame->StyleUIReset()->mIMEMode) { - case StyleImeMode::Auto: + case NS_STYLE_IME_MODE_AUTO: if (IsPasswordEditor()) aState->mEnabled = IMEState::PASSWORD; break; - case StyleImeMode::Disabled: + case NS_STYLE_IME_MODE_DISABLED: // we should use password state for |ime-mode: disabled;|. aState->mEnabled = IMEState::PASSWORD; break; - case StyleImeMode::Active: + case NS_STYLE_IME_MODE_ACTIVE: aState->mOpen = IMEState::OPEN; break; - case StyleImeMode::Inactive: + case NS_STYLE_IME_MODE_INACTIVE: aState->mOpen = IMEState::CLOSED; break; } diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index a1d275027d6f..82812192cbe2 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -119,7 +119,6 @@ rusty-enums = [ "mozilla::StyleRuleInclusion", "mozilla::StyleGridTrackBreadth", "mozilla::StyleOverscrollBehavior", - "mozilla::StyleImeMode", "mozilla::StyleOverflowAnchor", "mozilla::StyleScrollbarWidth", "mozilla::StyleWhiteSpace", diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index 4368256099dd..20b2709d322a 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -722,13 +722,11 @@ enum class StyleWhiteSpace : uint8_t { #define NS_STYLE_PAGE_BREAK_RIGHT 4 // See nsStyleUIReset -enum class StyleImeMode : uint8_t { - Auto, - Normal, - Active, - Disabled, - Inactive, -}; +#define NS_STYLE_IME_MODE_AUTO 0 +#define NS_STYLE_IME_MODE_NORMAL 1 +#define NS_STYLE_IME_MODE_ACTIVE 2 +#define NS_STYLE_IME_MODE_DISABLED 3 +#define NS_STYLE_IME_MODE_INACTIVE 4 // See nsStyleSVG diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index bef2a64ec71e..166ab9bad9f8 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -3703,7 +3703,7 @@ nsStyleUIReset::nsStyleUIReset(const Document& aDocument) : mUserSelect(StyleUserSelect::Auto), mScrollbarWidth(StyleScrollbarWidth::Auto), mForceBrokenImageIcon(0), - mIMEMode(StyleImeMode::Auto), + mIMEMode(NS_STYLE_IME_MODE_AUTO), mWindowDragging(StyleWindowDragging::Default), mWindowShadow(NS_STYLE_WINDOW_SHADOW_DEFAULT), mWindowOpacity(1.0), diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 5f8a5ca6861d..d79cc1db86b0 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -2074,7 +2074,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset { mozilla::StyleUserSelect mUserSelect; // [reset](selection-style) mozilla::StyleScrollbarWidth mScrollbarWidth; uint8_t mForceBrokenImageIcon; // (0 if not forcing, otherwise forcing) - mozilla::StyleImeMode mIMEMode; + uint8_t mIMEMode; mozilla::StyleWindowDragging mWindowDragging; uint8_t mWindowShadow; float mWindowOpacity; diff --git a/servo/components/style/properties/longhands/ui.mako.rs b/servo/components/style/properties/longhands/ui.mako.rs index 9bb38a150c15..647028559677 100644 --- a/servo/components/style/properties/longhands/ui.mako.rs +++ b/servo/components/style/properties/longhands/ui.mako.rs @@ -15,7 +15,6 @@ ${helpers.single_keyword( "ime-mode", "auto normal active disabled inactive", engines="gecko", - gecko_enum_prefix="StyleImeMode", gecko_ffi_name="mIMEMode", animation_value_type="discrete", spec="https://drafts.csswg.org/css-ui/#input-method-editor",