Bug 1520154 - Move cursor to cbindgen. r=boris

The only reason it was on style_traits is so that they could use it from some
other crates, but Servo eventually ends up getting the value from an integer, so
may as well pass it around and do that in the end of the process anyway.

Differential Revision: https://phabricator.services.mozilla.com/D16557
This commit is contained in:
Emilio Cobos Álvarez 2019-01-15 15:05:45 +01:00
parent 02cfa7910b
commit b44ff327e9
28 changed files with 209 additions and 425 deletions

View File

@ -8706,8 +8706,8 @@ void Document::ScrollToRef() {
// document's charset.
if (NS_FAILED(rv)) {
const Encoding* encoding = GetDocumentCharacterSet();
rv = encoding->DecodeWithoutBOMHandling(
unescaped ? buff : mScrollToRef, ref);
rv = encoding->DecodeWithoutBOMHandling(unescaped ? buff : mScrollToRef,
ref);
if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
rv = shell->GoToAnchor(ref, mChangeScrollPosWhenScrollingToRef);
}
@ -10699,7 +10699,7 @@ PointerLockRequest::Run() {
if (!error && !mUserInputOrChromeCaller && !doc->GetFullscreenElement()) {
error = "PointerLockDeniedNotInputDriven";
}
if (!error && !doc->SetPointerLock(e, NS_STYLE_CURSOR_NONE)) {
if (!error && !doc->SetPointerLock(e, StyleCursorKind::None)) {
error = "PointerLockDeniedFailedToLock";
}
if (error) {
@ -10737,7 +10737,7 @@ void Document::RequestPointerLock(Element* aElement, CallerType aCallerType) {
Dispatch(TaskCategory::Other, request.forget());
}
bool Document::SetPointerLock(Element* aElement, int aCursorStyle) {
bool Document::SetPointerLock(Element* aElement, StyleCursorKind aCursorStyle) {
MOZ_ASSERT(!aElement || aElement->OwnerDoc() == this,
"We should be either unlocking pointer (aElement is nullptr), "
"or locking pointer to an element in this document");
@ -10797,7 +10797,7 @@ void Document::UnlockPointer(Document* aDoc) {
if (!pointerLockedDoc || (aDoc && aDoc != pointerLockedDoc)) {
return;
}
if (!pointerLockedDoc->SetPointerLock(nullptr, NS_STYLE_CURSOR_AUTO)) {
if (!pointerLockedDoc->SetPointerLock(nullptr, StyleCursorKind::Auto)) {
return;
}
@ -11696,7 +11696,7 @@ void Document::ClearUserGestureActivation() {
Document* doc = this;
while (doc) {
MOZ_LOG(gUserInteractionPRLog, LogLevel::Debug,
("Reset user activation flag for document %p.", this));
("Reset user activation flag for document %p.", this));
doc->mUserGestureActivated = false;
doc = doc->GetSameTypeParentDocument();
}

View File

@ -136,6 +136,7 @@ class FullscreenRequest;
class PendingAnimationTracker;
class ServoStyleSet;
class SMILAnimationController;
enum class StyleCursorKind : uint8_t;
template <typename>
class OwningNonNull;
struct URLExtraData;
@ -445,7 +446,8 @@ class Document : public nsINode,
Document& operator=(const Document&) = delete;
public:
typedef mozilla::dom::ExternalResourceMap::ExternalResourceLoad ExternalResourceLoad;
typedef mozilla::dom::ExternalResourceMap::ExternalResourceLoad
ExternalResourceLoad;
typedef net::ReferrerPolicy ReferrerPolicyEnum;
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID)
@ -1820,8 +1822,8 @@ class Document : public nsINode,
*/
static bool HandlePendingFullscreenRequests(Document* aDocument);
void RequestPointerLock(Element* aElement, mozilla::dom::CallerType);
bool SetPointerLock(Element* aElement, int aCursorStyle);
void RequestPointerLock(Element* aElement, CallerType);
bool SetPointerLock(Element* aElement, StyleCursorKind);
static void UnlockPointer(Document* aDoc = nullptr);
@ -3096,7 +3098,9 @@ class Document : public nsINode,
#ifdef MOZILLA_INTERNAL_API
bool Hidden() const { return mVisibilityState != VisibilityState::Visible; }
mozilla::dom::VisibilityState VisibilityState() const { return mVisibilityState; }
mozilla::dom::VisibilityState VisibilityState() const {
return mVisibilityState;
}
#endif
void GetSelectedStyleSheetSet(nsAString& aSheetSet);
void SetSelectedStyleSheetSet(const nsAString& aSheetSet);

View File

@ -7051,18 +7051,21 @@ nsIDOMWindowUtils* nsGlobalWindowOuter::WindowUtils() {
}
// Note: This call will lock the cursor, it will not change as it moves.
// To unlock, the cursor must be set back to CURSOR_AUTO.
// To unlock, the cursor must be set back to Auto.
void nsGlobalWindowOuter::SetCursorOuter(const nsAString& aCursor,
ErrorResult& aError) {
int32_t cursor;
StyleCursorKind cursor;
if (aCursor.EqualsLiteral("auto"))
cursor = NS_STYLE_CURSOR_AUTO;
else {
if (aCursor.EqualsLiteral("auto")) {
cursor = StyleCursorKind::Auto;
} else {
// TODO(emilio): Use Servo for this instead.
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(aCursor);
if (!nsCSSProps::FindKeyword(keyword, nsCSSProps::kCursorKTable, cursor)) {
int32_t c;
if (!nsCSSProps::FindKeyword(keyword, nsCSSProps::kCursorKTable, c)) {
return;
}
cursor = static_cast<StyleCursorKind>(c);
}
RefPtr<nsPresContext> presContext;

View File

@ -221,12 +221,14 @@ bool EventStateManager::WheelPrefs::sHonoursRootForAutoDir = false;
EventStateManager::DeltaAccumulator*
EventStateManager::DeltaAccumulator::sInstance = nullptr;
constexpr const StyleCursorKind kInvalidCursorKind =
static_cast<StyleCursorKind>(255);
EventStateManager::EventStateManager()
: mLockCursor(0),
: mLockCursor(kInvalidCursorKind),
mLastFrameConsumedSetCursor(false),
mCurrentTarget(nullptr)
mCurrentTarget(nullptr),
// init d&d gesture state machine variables
,
mGestureDownPoint(0, 0),
mGestureModifiers(0),
mGestureDownButtons(0),
@ -3612,13 +3614,13 @@ void EventStateManager::UpdateCursor(nsPresContext* aPresContext,
return;
}
int32_t cursor = NS_STYLE_CURSOR_DEFAULT;
auto cursor = StyleCursorKind::Default;
imgIContainer* container = nullptr;
bool haveHotspot = false;
float hotspotX = 0.0f, hotspotY = 0.0f;
// If cursor is locked just use the locked one
if (mLockCursor) {
if (mLockCursor != kInvalidCursorKind) {
cursor = mLockCursor;
}
// If not locked, look for correct cursor
@ -3663,8 +3665,8 @@ void EventStateManager::UpdateCursor(nsPresContext* aPresContext,
// Show busy cursor everywhere before page loads
// and just replace the arrow cursor after page starts loading
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY &&
(cursor == NS_STYLE_CURSOR_AUTO || cursor == NS_STYLE_CURSOR_DEFAULT)) {
cursor = NS_STYLE_CURSOR_SPINNING;
(cursor == StyleCursorKind::Auto || cursor == StyleCursorKind::Default)) {
cursor = StyleCursorKind::Progress;
container = nullptr;
}
}
@ -3676,7 +3678,7 @@ void EventStateManager::UpdateCursor(nsPresContext* aPresContext,
gLastCursorUpdateTime = TimeStamp::NowLoRes();
}
if (mLockCursor || NS_STYLE_CURSOR_AUTO != cursor) {
if (mLockCursor != kInvalidCursorKind || StyleCursorKind::Auto != cursor) {
*aStatus = nsEventStatus_eConsumeDoDefault;
}
}
@ -3692,7 +3694,7 @@ void EventStateManager::ClearCachedWidgetCursor(nsIFrame* aTargetFrame) {
aWidget->ClearCachedCursor();
}
nsresult EventStateManager::SetCursor(int32_t aCursor,
nsresult EventStateManager::SetCursor(StyleCursorKind aCursor,
imgIContainer* aContainer,
bool aHaveHotspot, float aHotspotX,
float aHotspotY, nsIWidget* aWidget,
@ -3705,119 +3707,119 @@ nsresult EventStateManager::SetCursor(int32_t aCursor,
NS_ENSURE_TRUE(aWidget, NS_ERROR_FAILURE);
if (aLockCursor) {
if (NS_STYLE_CURSOR_AUTO != aCursor) {
if (StyleCursorKind::Auto != aCursor) {
mLockCursor = aCursor;
} else {
// If cursor style is set to auto we unlock the cursor again.
mLockCursor = 0;
mLockCursor = kInvalidCursorKind;
}
}
switch (aCursor) {
default:
case NS_STYLE_CURSOR_AUTO:
case NS_STYLE_CURSOR_DEFAULT:
case StyleCursorKind::Auto:
case StyleCursorKind::Default:
c = eCursor_standard;
break;
case NS_STYLE_CURSOR_POINTER:
case StyleCursorKind::Pointer:
c = eCursor_hyperlink;
break;
case NS_STYLE_CURSOR_CROSSHAIR:
case StyleCursorKind::Crosshair:
c = eCursor_crosshair;
break;
case NS_STYLE_CURSOR_MOVE:
case StyleCursorKind::Move:
c = eCursor_move;
break;
case NS_STYLE_CURSOR_TEXT:
case StyleCursorKind::Text:
c = eCursor_select;
break;
case NS_STYLE_CURSOR_WAIT:
case StyleCursorKind::Wait:
c = eCursor_wait;
break;
case NS_STYLE_CURSOR_HELP:
case StyleCursorKind::Help:
c = eCursor_help;
break;
case NS_STYLE_CURSOR_N_RESIZE:
case StyleCursorKind::NResize:
c = eCursor_n_resize;
break;
case NS_STYLE_CURSOR_S_RESIZE:
case StyleCursorKind::SResize:
c = eCursor_s_resize;
break;
case NS_STYLE_CURSOR_W_RESIZE:
case StyleCursorKind::WResize:
c = eCursor_w_resize;
break;
case NS_STYLE_CURSOR_E_RESIZE:
case StyleCursorKind::EResize:
c = eCursor_e_resize;
break;
case NS_STYLE_CURSOR_NW_RESIZE:
case StyleCursorKind::NwResize:
c = eCursor_nw_resize;
break;
case NS_STYLE_CURSOR_SE_RESIZE:
case StyleCursorKind::SeResize:
c = eCursor_se_resize;
break;
case NS_STYLE_CURSOR_NE_RESIZE:
case StyleCursorKind::NeResize:
c = eCursor_ne_resize;
break;
case NS_STYLE_CURSOR_SW_RESIZE:
case StyleCursorKind::SwResize:
c = eCursor_sw_resize;
break;
case NS_STYLE_CURSOR_COPY: // CSS3
case StyleCursorKind::Copy: // CSS3
c = eCursor_copy;
break;
case NS_STYLE_CURSOR_ALIAS:
case StyleCursorKind::Alias:
c = eCursor_alias;
break;
case NS_STYLE_CURSOR_CONTEXT_MENU:
case StyleCursorKind::ContextMenu:
c = eCursor_context_menu;
break;
case NS_STYLE_CURSOR_CELL:
case StyleCursorKind::Cell:
c = eCursor_cell;
break;
case NS_STYLE_CURSOR_GRAB:
case StyleCursorKind::Grab:
c = eCursor_grab;
break;
case NS_STYLE_CURSOR_GRABBING:
case StyleCursorKind::Grabbing:
c = eCursor_grabbing;
break;
case NS_STYLE_CURSOR_SPINNING:
case StyleCursorKind::Progress:
c = eCursor_spinning;
break;
case NS_STYLE_CURSOR_ZOOM_IN:
case StyleCursorKind::ZoomIn:
c = eCursor_zoom_in;
break;
case NS_STYLE_CURSOR_ZOOM_OUT:
case StyleCursorKind::ZoomOut:
c = eCursor_zoom_out;
break;
case NS_STYLE_CURSOR_NOT_ALLOWED:
case StyleCursorKind::NotAllowed:
c = eCursor_not_allowed;
break;
case NS_STYLE_CURSOR_COL_RESIZE:
case StyleCursorKind::ColResize:
c = eCursor_col_resize;
break;
case NS_STYLE_CURSOR_ROW_RESIZE:
case StyleCursorKind::RowResize:
c = eCursor_row_resize;
break;
case NS_STYLE_CURSOR_NO_DROP:
case StyleCursorKind::NoDrop:
c = eCursor_no_drop;
break;
case NS_STYLE_CURSOR_VERTICAL_TEXT:
case StyleCursorKind::VerticalText:
c = eCursor_vertical_text;
break;
case NS_STYLE_CURSOR_ALL_SCROLL:
case StyleCursorKind::AllScroll:
c = eCursor_all_scroll;
break;
case NS_STYLE_CURSOR_NESW_RESIZE:
case StyleCursorKind::NeswResize:
c = eCursor_nesw_resize;
break;
case NS_STYLE_CURSOR_NWSE_RESIZE:
case StyleCursorKind::NwseResize:
c = eCursor_nwse_resize;
break;
case NS_STYLE_CURSOR_NS_RESIZE:
case StyleCursorKind::NsResize:
c = eCursor_ns_resize;
break;
case NS_STYLE_CURSOR_EW_RESIZE:
case StyleCursorKind::EwResize:
c = eCursor_ew_resize;
break;
case NS_STYLE_CURSOR_NONE:
case StyleCursorKind::None:
c = eCursor_none;
break;
}

View File

@ -231,7 +231,7 @@ class EventStateManager : public nsSupportsWeakReference, public nsIObserver {
bool CheckIfEventMatchesAccessKey(WidgetKeyboardEvent* aEvent,
nsPresContext* aPresContext);
nsresult SetCursor(int32_t aCursor, imgIContainer* aContainer,
nsresult SetCursor(StyleCursorKind aCursor, imgIContainer* aContainer,
bool aHaveHotspot, float aHotspotX, float aHotspotY,
nsIWidget* aWidget, bool aLockCursor);
@ -1171,7 +1171,7 @@ class EventStateManager : public nsSupportsWeakReference, public nsIObserver {
already_AddRefed<EventStateManager> ESMFromContentOrThis(
nsIContent* aContent);
int32_t mLockCursor;
StyleCursorKind mLockCursor;
bool mLastFrameConsumedSetCursor;
// Last mouse event mRefPoint (the offset from the widget's origin in

View File

@ -155,8 +155,8 @@ nsresult nsImageControlFrame::GetCursor(const nsPoint& aPoint,
// the cursor style is "auto" we use the pointer cursor.
FillCursorInformationFromStyle(StyleUI(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
aCursor.mCursor = NS_STYLE_CURSOR_POINTER;
if (StyleCursorKind::Auto == aCursor.mCursor) {
aCursor.mCursor = StyleCursorKind::Pointer;
}
return NS_OK;

View File

@ -5042,17 +5042,17 @@ void nsIFrame::AssociateImage(const nsStyleImage& aImage,
nsresult nsFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) {
FillCursorInformationFromStyle(StyleUI(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
if (StyleCursorKind::Auto == aCursor.mCursor) {
// If this is editable, I-beam cursor is better for most elements.
aCursor.mCursor = (mContent && mContent->IsEditable())
? NS_STYLE_CURSOR_TEXT
: NS_STYLE_CURSOR_DEFAULT;
? StyleCursorKind::Text
: StyleCursorKind::Default;
}
if (NS_STYLE_CURSOR_TEXT == aCursor.mCursor &&
if (StyleCursorKind::Text == aCursor.mCursor &&
GetWritingMode().IsVertical()) {
// Per CSS UI spec, UA may treat value 'text' as
// 'vertical-text' for vertical text.
aCursor.mCursor = NS_STYLE_CURSOR_VERTICAL_TEXT;
aCursor.mCursor = StyleCursorKind::VerticalText;
}
return NS_OK;

View File

@ -632,10 +632,10 @@ nsresult nsHTMLFramesetFrame::GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor) {
aCursor.mLoading = false;
if (mDragger) {
aCursor.mCursor = (mDragger->mVertical) ? NS_STYLE_CURSOR_EW_RESIZE
: NS_STYLE_CURSOR_NS_RESIZE;
aCursor.mCursor = (mDragger->mVertical) ? StyleCursorKind::EwResize
: StyleCursorKind::NsResize;
} else {
aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
aCursor.mCursor = StyleCursorKind::Default;
}
return NS_OK;
}
@ -1468,10 +1468,10 @@ nsresult nsHTMLFramesetBorderFrame::GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor) {
aCursor.mLoading = false;
if (!mCanResize) {
aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
aCursor.mCursor = StyleCursorKind::Default;
} else {
aCursor.mCursor =
(mVertical) ? NS_STYLE_CURSOR_EW_RESIZE : NS_STYLE_CURSOR_NS_RESIZE;
(mVertical) ? StyleCursorKind::EwResize: StyleCursorKind::NsResize;
}
return NS_OK;
}

View File

@ -1985,7 +1985,7 @@ class nsIFrame : public nsQueryFrame {
*/
struct MOZ_STACK_CLASS Cursor {
nsCOMPtr<imgIContainer> mContainer;
int32_t mCursor = NS_STYLE_CURSOR_AUTO;
mozilla::StyleCursorKind mCursor = mozilla::StyleCursorKind::Auto;
bool mHaveHotspot = false;
bool mLoading = false;
float mHotspotX = 0.0f, mHotspotY = 0.0f;

View File

@ -1618,8 +1618,7 @@ ImgDrawResult nsImageFrame::DisplayAltFeedbackWithoutLayer(
size);
const int32_t factor = PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect destRect(
LayoutDeviceRect::FromAppUnits(dest, factor));
LayoutDeviceRect destRect(LayoutDeviceRect::FromAppUnits(dest, factor));
destRect.Round();
Maybe<SVGImageContext> svgContext;
@ -1627,8 +1626,9 @@ ImgDrawResult nsImageFrame::DisplayAltFeedbackWithoutLayer(
nsLayoutUtils::ComputeImageContainerDrawingParameters(
imgCon, this, destRect, aSc, aFlags, svgContext);
RefPtr<ImageContainer> container;
result = imgCon->GetImageContainerAtSize(
aManager->LayerManager(), decodeSize, svgContext, aFlags, getter_AddRefs(container));
result = imgCon->GetImageContainerAtSize(aManager->LayerManager(),
decodeSize, svgContext, aFlags,
getter_AddRefs(container));
if (container) {
bool wrResult = aManager->CommandBuilder().PushImage(
aItem, container, aBuilder, aResources, aSc, destRect, bounds);
@ -2311,8 +2311,8 @@ nsresult nsImageFrame::GetCursor(const nsPoint& aPoint,
PresShell()->StyleSet()->ResolveStyleFor(area->AsElement(),
LazyComputeBehavior::Allow);
FillCursorInformationFromStyle(areaStyle->StyleUI(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
if (StyleCursorKind::Auto == aCursor.mCursor) {
aCursor.mCursor = StyleCursorKind::Default;
}
return NS_OK;
}

View File

@ -4590,13 +4590,13 @@ nsTextFrame::~nsTextFrame() {}
nsresult nsTextFrame::GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor) {
FillCursorInformationFromStyle(StyleUI(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
if (StyleCursorKind::Auto == aCursor.mCursor) {
if (!IsSelectable(nullptr)) {
aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
aCursor.mCursor = StyleCursorKind::Default;
} else {
aCursor.mCursor = GetWritingMode().IsVertical()
? NS_STYLE_CURSOR_VERTICAL_TEXT
: NS_STYLE_CURSOR_TEXT;
? StyleCursorKind::VerticalText
: StyleCursorKind::Text;
}
return NS_OK;
} else {

View File

@ -389,6 +389,7 @@ cbindgen-types = [
{ gecko = "StyleComputedFontStyleDescriptor", servo = "font_face::ComputedFontStyleDescriptor" },
{ gecko = "StyleComputedFontWeightRange", servo = "font_face::ComputedFontWeightRange" },
{ gecko = "StyleComputedTimingFunction", servo = "values::computed::easing::TimingFunction" },
{ gecko = "StyleCursorKind", servo = "values::computed::ui::CursorKind" },
{ gecko = "StyleDisplay", servo = "values::specified::Display" },
{ gecko = "StyleDisplayMode", servo = "gecko::media_features::DisplayMode" },
{ gecko = "StyleExtremumLength", servo = "values::computed::length::ExtremumLength" },

View File

@ -82,6 +82,7 @@ SERIALIZED_PREDEFINED_TYPES = [
"Content",
"CounterIncrement",
"CounterReset",
"Cursor",
"FillRule",
"Float",
"FontFamily",

View File

@ -177,49 +177,49 @@ const KTableEntry nsCSSProps::kBoxShadowTypeKTable[] = {
const KTableEntry nsCSSProps::kCursorKTable[] = {
// CSS 2.0
{eCSSKeyword_auto, NS_STYLE_CURSOR_AUTO},
{eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR},
{eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT},
{eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER},
{eCSSKeyword_move, NS_STYLE_CURSOR_MOVE},
{eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE},
{eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE},
{eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE},
{eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE},
{eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE},
{eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE},
{eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE},
{eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE},
{eCSSKeyword_text, NS_STYLE_CURSOR_TEXT},
{eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT},
{eCSSKeyword_help, NS_STYLE_CURSOR_HELP},
{eCSSKeyword_auto, StyleCursorKind::Auto},
{eCSSKeyword_crosshair, StyleCursorKind::Crosshair},
{eCSSKeyword_default, StyleCursorKind::Default},
{eCSSKeyword_pointer, StyleCursorKind::Pointer},
{eCSSKeyword_move, StyleCursorKind::Move},
{eCSSKeyword_e_resize, StyleCursorKind::EResize},
{eCSSKeyword_ne_resize, StyleCursorKind::NeResize},
{eCSSKeyword_nw_resize, StyleCursorKind::NwResize},
{eCSSKeyword_n_resize, StyleCursorKind::NResize},
{eCSSKeyword_se_resize, StyleCursorKind::SeResize},
{eCSSKeyword_sw_resize, StyleCursorKind::SwResize},
{eCSSKeyword_s_resize, StyleCursorKind::SResize},
{eCSSKeyword_w_resize, StyleCursorKind::WResize},
{eCSSKeyword_text, StyleCursorKind::Text},
{eCSSKeyword_wait, StyleCursorKind::Wait},
{eCSSKeyword_help, StyleCursorKind::Help},
// CSS 2.1
{eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING},
{eCSSKeyword_progress, StyleCursorKind::Progress},
// CSS3 basic user interface module
{eCSSKeyword_copy, NS_STYLE_CURSOR_COPY},
{eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS},
{eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU},
{eCSSKeyword_cell, NS_STYLE_CURSOR_CELL},
{eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED},
{eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE},
{eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE},
{eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP},
{eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT},
{eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL},
{eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE},
{eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE},
{eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE},
{eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE},
{eCSSKeyword_none, NS_STYLE_CURSOR_NONE},
{eCSSKeyword_grab, NS_STYLE_CURSOR_GRAB},
{eCSSKeyword_grabbing, NS_STYLE_CURSOR_GRABBING},
{eCSSKeyword_zoom_in, NS_STYLE_CURSOR_ZOOM_IN},
{eCSSKeyword_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT},
{eCSSKeyword_copy, StyleCursorKind::Copy},
{eCSSKeyword_alias, StyleCursorKind::Alias},
{eCSSKeyword_context_menu, StyleCursorKind::ContextMenu},
{eCSSKeyword_cell, StyleCursorKind::Cell},
{eCSSKeyword_not_allowed, StyleCursorKind::NotAllowed},
{eCSSKeyword_col_resize, StyleCursorKind::ColResize},
{eCSSKeyword_row_resize, StyleCursorKind::RowResize},
{eCSSKeyword_no_drop, StyleCursorKind::NoDrop},
{eCSSKeyword_vertical_text, StyleCursorKind::VerticalText},
{eCSSKeyword_all_scroll, StyleCursorKind::AllScroll},
{eCSSKeyword_nesw_resize, StyleCursorKind::NeswResize},
{eCSSKeyword_nwse_resize, StyleCursorKind::NwseResize},
{eCSSKeyword_ns_resize, StyleCursorKind::NsResize},
{eCSSKeyword_ew_resize, StyleCursorKind::EwResize},
{eCSSKeyword_none, StyleCursorKind::None},
{eCSSKeyword_grab, StyleCursorKind::Grab},
{eCSSKeyword_grabbing, StyleCursorKind::Grabbing},
{eCSSKeyword_zoom_in, StyleCursorKind::ZoomIn},
{eCSSKeyword_zoom_out, StyleCursorKind::ZoomOut},
// -moz- prefixed vendor specific
{eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB},
{eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING},
{eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_ZOOM_IN},
{eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT},
{eCSSKeyword__moz_grab, StyleCursorKind::Grab},
{eCSSKeyword__moz_grabbing, StyleCursorKind::Grabbing},
{eCSSKeyword__moz_zoom_in, StyleCursorKind::ZoomIn},
{eCSSKeyword__moz_zoom_out, StyleCursorKind::ZoomOut},
{eCSSKeyword_UNKNOWN, -1}};
KTableEntry nsCSSProps::kDisplayKTable[] = {

View File

@ -2261,38 +2261,6 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetCaretColor() {
return val.forget();
}
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetCursor() {
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(true);
const nsStyleUI* ui = StyleUI();
for (const nsCursorImage& item : ui->mCursorImages) {
RefPtr<nsDOMCSSValueList> itemList = GetROCSSValueList(false);
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
SetValueToURLValue(item.mImage->GetImageValue(), val);
itemList->AppendCSSValue(val.forget());
if (item.mHaveHotspot) {
RefPtr<nsROCSSPrimitiveValue> valX = new nsROCSSPrimitiveValue;
RefPtr<nsROCSSPrimitiveValue> valY = new nsROCSSPrimitiveValue;
valX->SetNumber(item.mHotspotX);
valY->SetNumber(item.mHotspotY);
itemList->AppendCSSValue(valX.forget());
itemList->AppendCSSValue(valY.forget());
}
valueList->AppendCSSValue(itemList.forget());
}
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
val->SetIdent(
nsCSSProps::ValueToKeywordEnum(ui->mCursor, nsCSSProps::kCursorKTable));
valueList->AppendCSSValue(val.forget());
return valueList.forget();
}
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetBoxFlex() {
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
val->SetNumber(StyleXUL()->mBoxFlex);

View File

@ -344,7 +344,6 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
/* User interface properties */
already_AddRefed<CSSValue> DoGetCaretColor();
already_AddRefed<CSSValue> DoGetCursor();
already_AddRefed<CSSValue> DoGetForceBrokenImageIcon();
/* Column properties */

View File

@ -297,44 +297,6 @@ enum class StyleContent : uint8_t {
AltContent
};
// See nsStyleUI
#define NS_STYLE_CURSOR_AUTO 1
#define NS_STYLE_CURSOR_CROSSHAIR 2
#define NS_STYLE_CURSOR_DEFAULT 3 // ie: an arrow
#define NS_STYLE_CURSOR_POINTER 4 // for links
#define NS_STYLE_CURSOR_MOVE 5
#define NS_STYLE_CURSOR_E_RESIZE 6
#define NS_STYLE_CURSOR_NE_RESIZE 7
#define NS_STYLE_CURSOR_NW_RESIZE 8
#define NS_STYLE_CURSOR_N_RESIZE 9
#define NS_STYLE_CURSOR_SE_RESIZE 10
#define NS_STYLE_CURSOR_SW_RESIZE 11
#define NS_STYLE_CURSOR_S_RESIZE 12
#define NS_STYLE_CURSOR_W_RESIZE 13
#define NS_STYLE_CURSOR_TEXT 14 // ie: i-beam
#define NS_STYLE_CURSOR_WAIT 15
#define NS_STYLE_CURSOR_HELP 16
#define NS_STYLE_CURSOR_COPY 17 // CSS3
#define NS_STYLE_CURSOR_ALIAS 18
#define NS_STYLE_CURSOR_CONTEXT_MENU 19
#define NS_STYLE_CURSOR_CELL 20
#define NS_STYLE_CURSOR_GRAB 21
#define NS_STYLE_CURSOR_GRABBING 22
#define NS_STYLE_CURSOR_SPINNING 23
#define NS_STYLE_CURSOR_ZOOM_IN 24
#define NS_STYLE_CURSOR_ZOOM_OUT 25
#define NS_STYLE_CURSOR_NOT_ALLOWED 26
#define NS_STYLE_CURSOR_COL_RESIZE 27
#define NS_STYLE_CURSOR_ROW_RESIZE 28
#define NS_STYLE_CURSOR_NO_DROP 29
#define NS_STYLE_CURSOR_VERTICAL_TEXT 30
#define NS_STYLE_CURSOR_ALL_SCROLL 31
#define NS_STYLE_CURSOR_NESW_RESIZE 32
#define NS_STYLE_CURSOR_NWSE_RESIZE 33
#define NS_STYLE_CURSOR_NS_RESIZE 34
#define NS_STYLE_CURSOR_EW_RESIZE 35
#define NS_STYLE_CURSOR_NONE 36
// See nsStyleVisibility
#define NS_STYLE_DIRECTION_LTR 0
#define NS_STYLE_DIRECTION_RTL 1

View File

@ -3999,7 +3999,7 @@ nsStyleUI::nsStyleUI(const nsPresContext* aContext)
mUserModify(StyleUserModify::ReadOnly),
mUserFocus(StyleUserFocus::None),
mPointerEvents(NS_STYLE_POINTER_EVENTS_AUTO),
mCursor(NS_STYLE_CURSOR_AUTO),
mCursor(StyleCursorKind::Auto),
mCaretColor(StyleComplexColor::Auto()),
mScrollbarFaceColor(StyleComplexColor::Auto()),
mScrollbarTrackColor(StyleComplexColor::Auto()) {

View File

@ -2574,7 +2574,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI {
mozilla::StyleUserFocus mUserFocus; // (auto-select)
uint8_t mPointerEvents; // NS_STYLE_POINTER_EVENTS_*
uint8_t mCursor; // NS_STYLE_CURSOR_*
mozilla::StyleCursorKind mCursor;
nsTArray<nsCursorImage> mCursorImages; // images and coords
mozilla::StyleComplexColor mCaretColor;

View File

@ -2233,8 +2233,8 @@ nsresult nsTreeBodyFrame::GetCursor(const nsPoint& aPoint,
ComputedStyle* childContext = GetPseudoComputedStyle(child);
FillCursorInformationFromStyle(childContext->StyleUI(), aCursor);
if (aCursor.mCursor == NS_STYLE_CURSOR_AUTO)
aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
if (aCursor.mCursor == StyleCursorKind::Auto)
aCursor.mCursor = StyleCursorKind::Default;
return NS_OK;
}

View File

@ -48,6 +48,7 @@ include = [
"ComputedFontStyleDescriptor",
"ComputedFontWeightRange",
"ComputedTimingFunction",
"CursorKind",
"Display",
"DisplayMode",
"ExtremumLength",

View File

@ -5162,52 +5162,7 @@ clip-path
<%self:impl_trait style_struct_name="InheritedUI"
skip_longhands="cursor scrollbar-color">
pub fn set_cursor(&mut self, v: longhands::cursor::computed_value::T) {
use style_traits::cursor::CursorKind;
self.gecko.mCursor = match v.keyword {
CursorKind::Auto => structs::NS_STYLE_CURSOR_AUTO,
CursorKind::None => structs::NS_STYLE_CURSOR_NONE,
CursorKind::Default => structs::NS_STYLE_CURSOR_DEFAULT,
CursorKind::Pointer => structs::NS_STYLE_CURSOR_POINTER,
CursorKind::ContextMenu => structs::NS_STYLE_CURSOR_CONTEXT_MENU,
CursorKind::Help => structs::NS_STYLE_CURSOR_HELP,
CursorKind::Progress => structs::NS_STYLE_CURSOR_SPINNING,
CursorKind::Wait => structs::NS_STYLE_CURSOR_WAIT,
CursorKind::Cell => structs::NS_STYLE_CURSOR_CELL,
CursorKind::Crosshair => structs::NS_STYLE_CURSOR_CROSSHAIR,
CursorKind::Text => structs::NS_STYLE_CURSOR_TEXT,
CursorKind::VerticalText => structs::NS_STYLE_CURSOR_VERTICAL_TEXT,
CursorKind::Alias => structs::NS_STYLE_CURSOR_ALIAS,
CursorKind::Copy => structs::NS_STYLE_CURSOR_COPY,
CursorKind::Move => structs::NS_STYLE_CURSOR_MOVE,
CursorKind::NoDrop => structs::NS_STYLE_CURSOR_NO_DROP,
CursorKind::NotAllowed => structs::NS_STYLE_CURSOR_NOT_ALLOWED,
CursorKind::Grab => structs::NS_STYLE_CURSOR_GRAB,
CursorKind::Grabbing => structs::NS_STYLE_CURSOR_GRABBING,
CursorKind::EResize => structs::NS_STYLE_CURSOR_E_RESIZE,
CursorKind::NResize => structs::NS_STYLE_CURSOR_N_RESIZE,
CursorKind::NeResize => structs::NS_STYLE_CURSOR_NE_RESIZE,
CursorKind::NwResize => structs::NS_STYLE_CURSOR_NW_RESIZE,
CursorKind::SResize => structs::NS_STYLE_CURSOR_S_RESIZE,
CursorKind::SeResize => structs::NS_STYLE_CURSOR_SE_RESIZE,
CursorKind::SwResize => structs::NS_STYLE_CURSOR_SW_RESIZE,
CursorKind::WResize => structs::NS_STYLE_CURSOR_W_RESIZE,
CursorKind::EwResize => structs::NS_STYLE_CURSOR_EW_RESIZE,
CursorKind::NsResize => structs::NS_STYLE_CURSOR_NS_RESIZE,
CursorKind::NeswResize => structs::NS_STYLE_CURSOR_NESW_RESIZE,
CursorKind::NwseResize => structs::NS_STYLE_CURSOR_NWSE_RESIZE,
CursorKind::ColResize => structs::NS_STYLE_CURSOR_COL_RESIZE,
CursorKind::RowResize => structs::NS_STYLE_CURSOR_ROW_RESIZE,
CursorKind::AllScroll => structs::NS_STYLE_CURSOR_ALL_SCROLL,
CursorKind::ZoomIn => structs::NS_STYLE_CURSOR_ZOOM_IN,
CursorKind::ZoomOut => structs::NS_STYLE_CURSOR_ZOOM_OUT,
// note: the following properties are gecko-only.
CursorKind::MozGrab => structs::NS_STYLE_CURSOR_GRAB,
CursorKind::MozGrabbing => structs::NS_STYLE_CURSOR_GRABBING,
CursorKind::MozZoomIn => structs::NS_STYLE_CURSOR_ZOOM_IN,
CursorKind::MozZoomOut => structs::NS_STYLE_CURSOR_ZOOM_OUT,
} as u8;
self.gecko.mCursor = v.keyword;
unsafe {
Gecko_SetCursorArrayLength(&mut self.gecko, v.images.len());
}
@ -5246,47 +5201,8 @@ clip-path
pub fn clone_cursor(&self) -> longhands::cursor::computed_value::T {
use crate::values::computed::ui::CursorImage;
use crate::values::computed::url::ComputedImageUrl;
use style_traits::cursor::CursorKind;
let keyword = match self.gecko.mCursor as u32 {
structs::NS_STYLE_CURSOR_AUTO => CursorKind::Auto,
structs::NS_STYLE_CURSOR_NONE => CursorKind::None,
structs::NS_STYLE_CURSOR_DEFAULT => CursorKind::Default,
structs::NS_STYLE_CURSOR_POINTER => CursorKind::Pointer,
structs::NS_STYLE_CURSOR_CONTEXT_MENU => CursorKind::ContextMenu,
structs::NS_STYLE_CURSOR_HELP => CursorKind::Help,
structs::NS_STYLE_CURSOR_SPINNING => CursorKind::Progress,
structs::NS_STYLE_CURSOR_WAIT => CursorKind::Wait,
structs::NS_STYLE_CURSOR_CELL => CursorKind::Cell,
structs::NS_STYLE_CURSOR_CROSSHAIR => CursorKind::Crosshair,
structs::NS_STYLE_CURSOR_TEXT => CursorKind::Text,
structs::NS_STYLE_CURSOR_VERTICAL_TEXT => CursorKind::VerticalText,
structs::NS_STYLE_CURSOR_ALIAS => CursorKind::Alias,
structs::NS_STYLE_CURSOR_COPY => CursorKind::Copy,
structs::NS_STYLE_CURSOR_MOVE => CursorKind::Move,
structs::NS_STYLE_CURSOR_NO_DROP => CursorKind::NoDrop,
structs::NS_STYLE_CURSOR_NOT_ALLOWED => CursorKind::NotAllowed,
structs::NS_STYLE_CURSOR_GRAB => CursorKind::Grab,
structs::NS_STYLE_CURSOR_GRABBING => CursorKind::Grabbing,
structs::NS_STYLE_CURSOR_E_RESIZE => CursorKind::EResize,
structs::NS_STYLE_CURSOR_N_RESIZE => CursorKind::NResize,
structs::NS_STYLE_CURSOR_NE_RESIZE => CursorKind::NeResize,
structs::NS_STYLE_CURSOR_NW_RESIZE => CursorKind::NwResize,
structs::NS_STYLE_CURSOR_S_RESIZE => CursorKind::SResize,
structs::NS_STYLE_CURSOR_SE_RESIZE => CursorKind::SeResize,
structs::NS_STYLE_CURSOR_SW_RESIZE => CursorKind::SwResize,
structs::NS_STYLE_CURSOR_W_RESIZE => CursorKind::WResize,
structs::NS_STYLE_CURSOR_EW_RESIZE => CursorKind::EwResize,
structs::NS_STYLE_CURSOR_NS_RESIZE => CursorKind::NsResize,
structs::NS_STYLE_CURSOR_NESW_RESIZE => CursorKind::NeswResize,
structs::NS_STYLE_CURSOR_NWSE_RESIZE => CursorKind::NwseResize,
structs::NS_STYLE_CURSOR_COL_RESIZE => CursorKind::ColResize,
structs::NS_STYLE_CURSOR_ROW_RESIZE => CursorKind::RowResize,
structs::NS_STYLE_CURSOR_ALL_SCROLL => CursorKind::AllScroll,
structs::NS_STYLE_CURSOR_ZOOM_IN => CursorKind::ZoomIn,
structs::NS_STYLE_CURSOR_ZOOM_OUT => CursorKind::ZoomOut,
_ => panic!("Found unexpected value in style struct for cursor property"),
};
let keyword = self.gecko.mCursor;
let images = self.gecko.mCursorImages.iter().map(|gecko_cursor_image| {
let url = unsafe {

View File

@ -28,7 +28,6 @@ use std::cell::RefCell;
use std::cmp;
use std::f32;
use std::fmt::{self, Write};
use style_traits::cursor::CursorKind;
use style_traits::{CssWriter, ToCss};
#[cfg(feature = "gecko")]
@ -452,7 +451,6 @@ trivial_to_computed_value!(u8);
trivial_to_computed_value!(u16);
trivial_to_computed_value!(u32);
trivial_to_computed_value!(Atom);
trivial_to_computed_value!(CursorKind);
#[cfg(feature = "servo")]
trivial_to_computed_value!(Prefix);
trivial_to_computed_value!(String);

View File

@ -10,6 +10,7 @@ use crate::values::computed::Number;
use crate::values::generics::ui as generics;
use crate::values::{Auto, Either};
pub use crate::values::specified::ui::CursorKind;
pub use crate::values::specified::ui::{MozForceBrokenImageIcon, UserSelect};
/// auto | <color>

View File

@ -5,7 +5,7 @@
//! Generic values for UI properties.
use std::fmt::{self, Write};
use style_traits::cursor::CursorKind;
use values::specified::ui::CursorKind;
use style_traits::{CssWriter, ToCss};
/// A generic value for the `cursor` property.

View File

@ -12,7 +12,6 @@ use crate::values::specified::Number;
use crate::values::{Auto, Either};
use cssparser::Parser;
use std::fmt::{self, Write};
use style_traits::cursor::CursorKind;
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
/// auto | <color>
@ -40,23 +39,11 @@ impl Parse for Cursor {
}
Ok(Self {
images: images.into_boxed_slice(),
keyword: CursorKind::parse(context, input)?,
keyword: CursorKind::parse(input)?,
})
}
}
impl Parse for CursorKind {
fn parse<'i, 't>(
_context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
let location = input.current_source_location();
let ident = input.expect_ident()?;
CursorKind::from_css_keyword(&ident)
.map_err(|_| location.new_custom_error(StyleParseErrorKind::UnspecifiedError))
}
}
impl Parse for CursorImage {
fn parse<'i, 't>(
context: &ParserContext,
@ -166,3 +153,63 @@ pub enum UserSelect {
/// Force selection of all children.
All,
}
/// The keywords allowed in the Cursor property.
///
/// https://drafts.csswg.org/css-ui-4/#propdef-cursor
#[allow(missing_docs)]
#[derive(
Clone,
Copy,
Debug,
Eq,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
)]
#[repr(u8)]
pub enum CursorKind {
None,
Default,
Pointer,
ContextMenu,
Help,
Progress,
Wait,
Cell,
Crosshair,
Text,
VerticalText,
Alias,
Copy,
Move,
NoDrop,
NotAllowed,
Grab,
Grabbing,
EResize,
NResize,
NeResize,
NwResize,
SResize,
SeResize,
SwResize,
WResize,
EwResize,
NsResize,
NeswResize,
NwseResize,
ColResize,
RowResize,
AllScroll,
ZoomIn,
ZoomOut,
Auto,
MozGrab,
MozGrabbing,
MozZoomIn,
MozZoomOut,
}

View File

@ -1,118 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! A list of common mouse cursors per CSS3-UI § 8.1.1.
use super::{CssWriter, KeywordsCollectFn, SpecifiedValueInfo, ToCss};
macro_rules! define_cursor {
(
common properties = [
$( $c_css: expr => $c_variant: ident = $c_value: expr, )+
]
gecko properties = [
$( $g_css: expr => $g_variant: ident = $g_value: expr, )+
]
) => {
/// <https://drafts.csswg.org/css-ui/#cursor>
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[repr(u8)]
#[allow(missing_docs)]
pub enum CursorKind {
$( $c_variant = $c_value, )+
$( #[cfg(feature = "gecko")] $g_variant = $g_value, )+
}
impl CursorKind {
/// Given a CSS keyword, get the corresponding cursor enum.
pub fn from_css_keyword(keyword: &str) -> Result<Self, ()> {
match_ignore_ascii_case! { &keyword,
$( $c_css => Ok(CursorKind::$c_variant), )+
$( #[cfg(feature = "gecko")] $g_css => Ok(CursorKind::$g_variant), )+
_ => Err(())
}
}
/// From the C u8 value, get the corresponding Cursor enum.
pub fn from_u8(value: u8) -> Result<Self, ()> {
match value {
$( $c_value => Ok(CursorKind::$c_variant), )+
$( #[cfg(feature = "gecko")] $g_value => Ok(CursorKind::$g_variant), )+
_ => Err(())
}
}
}
impl ToCss for CursorKind {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> ::std::fmt::Result where W: ::std::fmt::Write {
match *self {
$(CursorKind::$c_variant => {
::std::fmt::Write::write_str(dest, $c_css)
})+
$(#[cfg(feature = "gecko")] CursorKind::$g_variant => {
::std::fmt::Write::write_str(dest, $g_css)
})+
}
}
}
impl SpecifiedValueInfo for CursorKind {
fn collect_completion_keywords(f: KeywordsCollectFn) {
f(&[
$($c_css,)+
$($g_css,)+
]);
}
}
}
}
define_cursor! {
common properties = [
"none" => None = 0,
"default" => Default = 1,
"pointer" => Pointer = 2,
"context-menu" => ContextMenu = 3,
"help" => Help = 4,
"progress" => Progress = 5,
"wait" => Wait = 6,
"cell" => Cell = 7,
"crosshair" => Crosshair = 8,
"text" => Text = 9,
"vertical-text" => VerticalText = 10,
"alias" => Alias = 11,
"copy" => Copy = 12,
"move" => Move = 13,
"no-drop" => NoDrop = 14,
"not-allowed" => NotAllowed = 15,
"grab" => Grab = 16,
"grabbing" => Grabbing = 17,
"e-resize" => EResize = 18,
"n-resize" => NResize = 19,
"ne-resize" => NeResize = 20,
"nw-resize" => NwResize = 21,
"s-resize" => SResize = 22,
"se-resize" => SeResize = 23,
"sw-resize" => SwResize = 24,
"w-resize" => WResize = 25,
"ew-resize" => EwResize = 26,
"ns-resize" => NsResize = 27,
"nesw-resize" => NeswResize = 28,
"nwse-resize" => NwseResize = 29,
"col-resize" => ColResize = 30,
"row-resize" => RowResize = 31,
"all-scroll" => AllScroll = 32,
"zoom-in" => ZoomIn = 33,
"zoom-out" => ZoomOut = 34,
"auto" => Auto = 35,
]
// gecko only properties
gecko properties = [
"-moz-grab" => MozGrab = 36,
"-moz-grabbing" => MozGrabbing = 37,
"-moz-zoom-in" => MozZoomIn = 38,
"-moz-zoom-out" => MozZoomOut = 39,
]
}

View File

@ -81,7 +81,6 @@ pub enum CSSPixel {}
// / hidpi_ratio => DeviceIndependentPixel
// / desktop_zoom => CSSPixel
pub mod cursor;
pub mod specified_value_info;
#[macro_use]
pub mod values;