Bug 346690 - Add support for the 'none' keyword for the CSS cursor property. r=dbaron, sr=mats, a=schrep
This commit is contained in:
Родитель
0f20ec363d
Коммит
b961e7e3ca
|
@ -68,6 +68,7 @@ END
|
|||
#define IDC_COLRESIZE 4108
|
||||
#define IDC_ROWRESIZE 4109
|
||||
#define IDC_VERTICALTEXT 4110
|
||||
#define IDC_NONE 4112
|
||||
|
||||
IDC_GRAB CURSOR DISCARDABLE "../../widget/src/build/res/grab.cur"
|
||||
IDC_GRABBING CURSOR DISCARDABLE "../../widget/src/build/res/grabbing.cur"
|
||||
|
@ -79,5 +80,6 @@ IDC_ZOOMOUT CURSOR DISCARDABLE "../../widget/src/build/res/zoom
|
|||
IDC_COLRESIZE CURSOR DISCARDABLE "../../widget/src/build/res/col_resize.cur"
|
||||
IDC_ROWRESIZE CURSOR DISCARDABLE "../../widget/src/build/res/row_resize.cur"
|
||||
IDC_VERTICALTEXT CURSOR DISCARDABLE "../../widget/src/build/res/vertical_text.cur"
|
||||
IDC_NONE CURSOR DISCARDABLE "../../widget/src/build/res/none.cur"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,6 +71,7 @@ POINTER IDC_ZOOMOUT "..\\..\\widget\\src\\os2\\res\\zoom_out.ptr"
|
|||
POINTER IDC_ARROWWAIT "..\\..\\widget\\src\\os2\\res\\arrow_wait.ptr"
|
||||
POINTER IDC_CROSS "..\\..\\widget\\src\\os2\\res\\crosshair.ptr"
|
||||
POINTER IDC_HELP "..\\..\\widget\\src\\os2\\res\\help.ptr"
|
||||
POINTER IDC_NONE "..\\..\\widget\\src\\os2\\res\\help.ptr"
|
||||
|
||||
ICON IDC_DNDURL "..\\..\\widget\\src\\os2\\res\\dndurl.ico"
|
||||
ICON IDC_DNDTEXT "..\\..\\widget\\src\\os2\\res\\dndtext.ico"
|
||||
|
|
|
@ -2859,6 +2859,9 @@ nsEventStateManager::SetCursor(PRInt32 aCursor, imgIContainer* aContainer,
|
|||
case NS_STYLE_CURSOR_EW_RESIZE:
|
||||
c = eCursor_ew_resize;
|
||||
break;
|
||||
case NS_STYLE_CURSOR_NONE:
|
||||
c = eCursor_none;
|
||||
break;
|
||||
}
|
||||
|
||||
// First, try the imgIContainer, if non-null
|
||||
|
|
|
@ -324,6 +324,7 @@
|
|||
#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 nsStyleDisplay
|
||||
#define NS_STYLE_DIRECTION_LTR 0
|
||||
|
|
|
@ -500,6 +500,7 @@ const PRInt32 nsCSSProps::kCursorKTable[] = {
|
|||
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,
|
||||
// -moz- prefixed aliases for some CSS3 cursors for backward compat
|
||||
eCSSKeyword__moz_copy, NS_STYLE_CURSOR_COPY,
|
||||
eCSSKeyword__moz_alias, NS_STYLE_CURSOR_ALIAS,
|
||||
|
|
|
@ -836,7 +836,7 @@ var gCSSProperties = {
|
|||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "auto" ],
|
||||
other_values: [ "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress" ],
|
||||
other_values: [ "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress", "none" ],
|
||||
invalid_values: []
|
||||
},
|
||||
"direction": {
|
||||
|
|
|
@ -49,6 +49,7 @@ POINTER IDC_ZOOMOUT "..\\..\\widget\\src\\os2\\res\\zoom_out.ptr"
|
|||
POINTER IDC_ARROWWAIT "..\\..\\widget\\src\\os2\\res\\arrow_wait.ptr"
|
||||
POINTER IDC_CROSS "..\\..\\widget\\src\\os2\\res\\crosshair.ptr"
|
||||
POINTER IDC_HELP "..\\..\\widget\\src\\os2\\res\\help.ptr"
|
||||
POINTER IDC_NONE "..\\..\\widget\\src\\os2\\res\\help.ptr"
|
||||
|
||||
ICON IDC_DNDURL "..\\..\\widget\\src\\os2\\res\\dndurl.ico"
|
||||
ICON IDC_DNDTEXT "..\\..\\widget\\src\\os2\\res\\dndtext.ico"
|
||||
|
|
|
@ -206,6 +206,7 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow)
|
|||
eCursor_nwse_resize,
|
||||
eCursor_ns_resize,
|
||||
eCursor_ew_resize,
|
||||
eCursor_none,
|
||||
// This one better be the last one in this list.
|
||||
eCursorCount
|
||||
};
|
||||
|
|
|
@ -1420,6 +1420,10 @@ NS_METHOD nsWindow::SetCursor(nsCursor aCursor)
|
|||
newCursor = (BCursor *)gCursorArray.SafeElementAt(1);
|
||||
break;
|
||||
|
||||
case eCursor_none:
|
||||
// XXX: No suitable cursor, needs implementing
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_ASSERTION(0, "Invalid cursor type");
|
||||
break;
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 326 B |
|
@ -50,6 +50,7 @@ IDC_ZOOMOUT CURSOR DISCARDABLE "res/zoom_out.cur"
|
|||
IDC_COLRESIZE CURSOR DISCARDABLE "res/col_resize.cur"
|
||||
IDC_ROWRESIZE CURSOR DISCARDABLE "res/row_resize.cur"
|
||||
IDC_VERTICALTEXT CURSOR DISCARDABLE "res/vertical_text.cur"
|
||||
IDC_NONE CURSOR DISCARDABLE "res/none.cur"
|
||||
|
||||
OPTPROPSHEET DIALOG DISCARDABLE 32, 32, 288, 226
|
||||
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE |
|
||||
|
|
|
@ -199,6 +199,13 @@ static nsCursorManager *gInstance;
|
|||
if (aCursor != mCurrentCursor) {
|
||||
[[self getCursor: mCurrentCursor] unset];
|
||||
[[self getCursor: aCursor] set];
|
||||
|
||||
if (aCursor == eCursor_none) {
|
||||
[NSCursor hide];
|
||||
} else if (mCurrentCursor == eCursor_none) {
|
||||
[NSCursor unhide];
|
||||
}
|
||||
|
||||
mCurrentCursor = aCursor;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -426,6 +426,33 @@ static const unsigned char moz_nwse_resize_mask_bits[] = {
|
|||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
/* MOZ_CURSOR_NONE */
|
||||
static const unsigned char moz_none_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
static const unsigned char moz_none_mask_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
enum {
|
||||
MOZ_CURSOR_HAND_GRAB,
|
||||
MOZ_CURSOR_HAND_GRABBING,
|
||||
|
@ -440,7 +467,8 @@ enum {
|
|||
MOZ_CURSOR_ROW_RESIZE,
|
||||
MOZ_CURSOR_VERTICAL_TEXT,
|
||||
MOZ_CURSOR_NESW_RESIZE,
|
||||
MOZ_CURSOR_NWSE_RESIZE
|
||||
MOZ_CURSOR_NWSE_RESIZE,
|
||||
MOZ_CURSOR_NONE
|
||||
};
|
||||
|
||||
// create custom pixmap cursor from cursors in nsGTKCursorData.h
|
||||
|
@ -458,7 +486,8 @@ static const nsGtkCursor GtkCursors[] = {
|
|||
{ moz_row_resize_bits, moz_row_resize_mask_bits, 7, 9 },
|
||||
{ moz_vertical_text_bits, moz_vertical_text_mask_bits, 8, 4 },
|
||||
{ moz_nesw_resize_bits, moz_nesw_resize_mask_bits, 8, 8 },
|
||||
{ moz_nwse_resize_bits, moz_nwse_resize_mask_bits, 8, 8 }
|
||||
{ moz_nwse_resize_bits, moz_nwse_resize_mask_bits, 8, 8 },
|
||||
{ moz_none_bits, moz_none_mask_bits, 0, 0 }
|
||||
};
|
||||
|
||||
#endif /* nsGtkCursors_h__ */
|
||||
|
|
|
@ -4356,6 +4356,9 @@ get_gtk_cursor(nsCursor aCursor)
|
|||
case eCursor_ew_resize:
|
||||
gdkcursor = gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW);
|
||||
break;
|
||||
case eCursor_none:
|
||||
newType = MOZ_CURSOR_NONE;
|
||||
break;
|
||||
default:
|
||||
NS_ASSERTION(aCursor, "Invalid cursor type");
|
||||
gdkcursor = gdk_cursor_new(GDK_LEFT_PTR);
|
||||
|
|
|
@ -1807,6 +1807,10 @@ NS_METHOD nsWindow::SetCursor(nsCursor aCursor)
|
|||
newPointer = ::WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZEWE, FALSE);
|
||||
break;
|
||||
|
||||
case eCursor_none:
|
||||
newPointer = gPtrArray[IDC_NONE-IDC_BASE];
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_ASSERTION(0, "Invalid cursor type");
|
||||
break;
|
||||
|
|
|
@ -48,11 +48,12 @@
|
|||
#define IDC_COLRESIZE 4108
|
||||
#define IDC_ROWRESIZE 4109
|
||||
#define IDC_VERTICALTEXT 4110
|
||||
#define IDC_NONE 4112
|
||||
|
||||
/* OS/2 specific */
|
||||
#define IDC_ARROWWAIT 4111
|
||||
#define IDC_CROSS 4112
|
||||
#define IDC_HELP 4113
|
||||
#define IDC_ARROWWAIT 4113
|
||||
#define IDC_CROSS 4114
|
||||
#define IDC_HELP 4115
|
||||
|
||||
#define IDC_COUNT IDC_HELP-IDC_BASE+1
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ POINTER IDC_VERTICALTEXT res\vertical_text.ptr
|
|||
POINTER IDC_ARROWWAIT res\arrow_wait.ptr
|
||||
POINTER IDC_CROSS res\crosshair.ptr
|
||||
POINTER IDC_HELP res\help.ptr
|
||||
POINTER IDC_NONE res\help.ptr
|
||||
|
||||
ICON IDC_DNDURL res\dndurl.ico
|
||||
ICON IDC_DNDTEXT res\dndtext.ico
|
||||
|
|
|
@ -2500,6 +2500,10 @@ NS_METHOD nsWindow::SetCursor(nsCursor aCursor)
|
|||
newCursor = ::LoadCursor(NULL, IDC_SIZEWE);
|
||||
break;
|
||||
|
||||
case eCursor_none:
|
||||
newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_NONE));
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_ERROR("Invalid cursor type");
|
||||
break;
|
||||
|
|
|
@ -45,4 +45,4 @@
|
|||
#define IDC_ROWRESIZE 4109
|
||||
#define IDC_VERTICALTEXT 4110
|
||||
#define IDC_DUMMY_CE_MENUBAR 4111
|
||||
|
||||
#define IDC_NONE 4112
|
||||
|
|
|
@ -72,6 +72,7 @@ END
|
|||
#define IDC_COLRESIZE 4108
|
||||
#define IDC_ROWRESIZE 4109
|
||||
#define IDC_VERTICALTEXT 4110
|
||||
#define IDC_NONE 4112
|
||||
|
||||
IDC_GRAB CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\grab.cur"
|
||||
IDC_GRABBING CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\grabbing.cur"
|
||||
|
@ -83,5 +84,6 @@ IDC_ZOOMOUT CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res
|
|||
IDC_COLRESIZE CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\col_resize.cur"
|
||||
IDC_ROWRESIZE CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\row_resize.cur"
|
||||
IDC_VERTICALTEXT CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\vertical_text.cur"
|
||||
IDC_NONE CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\none.cur"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,6 +71,7 @@ POINTER IDC_ZOOMOUT "..\\..\\widget\\src\\os2\\res\\zoom_out.ptr"
|
|||
POINTER IDC_ARROWWAIT "..\\..\\widget\\src\\os2\\res\\arrow_wait.ptr"
|
||||
POINTER IDC_CROSS "..\\..\\widget\\src\\os2\\res\\crosshair.ptr"
|
||||
POINTER IDC_HELP "..\\..\\widget\\src\\os2\\res\\help.ptr"
|
||||
POINTER IDC_NONE "..\\..\\widget\\src\\os2\\res\\help.ptr"
|
||||
|
||||
ICON IDC_DNDURL "..\\..\\widget\\src\\os2\\res\\dndurl.ico"
|
||||
ICON IDC_DNDTEXT "..\\..\\widget\\src\\os2\\res\\dndtext.ico"
|
||||
|
|
Загрузка…
Ссылка в новой задаче