From eb14fa2587bc4f86c3a67c5afd48dde7a2ffcbbb Mon Sep 17 00:00:00 2001 From: "jwalden%mit.edu" Date: Fri, 18 Jan 2008 18:40:29 +0000 Subject: [PATCH] Bug 346690 - Add support for the 'none' keyword for the CSS cursor property. r=dbaron, sr=mats, a=schrep git-svn-id: svn://10.0.0.236/trunk@243466 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/app/splash.rc | 2 ++ mozilla/browser/app/splashos2.rc | 1 + mozilla/calendar/sunbird/app/splash.rc | 2 ++ mozilla/calendar/sunbird/app/splashos2.rc | 1 + .../events/src/nsEventStateManager.cpp | 3 ++ mozilla/layout/base/nsStyleConsts.h | 1 + mozilla/layout/style/nsCSSProps.cpp | 1 + .../layout/style/test/property_database.js | 2 +- mozilla/mail/app/splash.rc | 2 ++ mozilla/mail/app/splashos2.rc | 1 + mozilla/suite/app/splashos2.rc | 1 + mozilla/toolkit/library/xulrunos2.rc | 1 + mozilla/widget/public/nsIWidget.h | 1 + mozilla/widget/src/beos/nsWindow.cpp | 4 +++ mozilla/widget/src/build/res/none.cur | Bin 0 -> 326 bytes mozilla/widget/src/build/widget.rc | 1 + mozilla/widget/src/cocoa/nsCursorManager.mm | 7 ++++ mozilla/widget/src/gtk2/nsGtkCursors.h | 33 ++++++++++++++++-- mozilla/widget/src/gtk2/nsWindow.cpp | 3 ++ mozilla/widget/src/os2/nsWindow.cpp | 4 +++ mozilla/widget/src/os2/wdgtos2rc.h | 7 ++-- mozilla/widget/src/os2/widget.rc | 1 + mozilla/widget/src/windows/nsWindow.cpp | 4 +++ mozilla/widget/src/windows/resource.h | 2 +- mozilla/xulrunner/app/splash.rc | 2 ++ mozilla/xulrunner/app/splashos2.rc | 1 + 26 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 mozilla/widget/src/build/res/none.cur diff --git a/mozilla/browser/app/splash.rc b/mozilla/browser/app/splash.rc index 67a24bb6862..bf6d5d10245 100644 --- a/mozilla/browser/app/splash.rc +++ b/mozilla/browser/app/splash.rc @@ -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 diff --git a/mozilla/browser/app/splashos2.rc b/mozilla/browser/app/splashos2.rc index ef28454557d..4cb05869a42 100644 --- a/mozilla/browser/app/splashos2.rc +++ b/mozilla/browser/app/splashos2.rc @@ -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" diff --git a/mozilla/calendar/sunbird/app/splash.rc b/mozilla/calendar/sunbird/app/splash.rc index f340b74c175..5319a264df6 100644 --- a/mozilla/calendar/sunbird/app/splash.rc +++ b/mozilla/calendar/sunbird/app/splash.rc @@ -79,6 +79,7 @@ IDC_SELECTANCHOR CURSOR DISCARDABLE "../../widget/src/build/res/sele #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" @@ -90,5 +91,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 diff --git a/mozilla/calendar/sunbird/app/splashos2.rc b/mozilla/calendar/sunbird/app/splashos2.rc index 9e96ba03cf3..7f1392dd19b 100644 --- a/mozilla/calendar/sunbird/app/splashos2.rc +++ b/mozilla/calendar/sunbird/app/splashos2.rc @@ -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" diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index e9cb325c543..c007bd2199b 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -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 diff --git a/mozilla/layout/base/nsStyleConsts.h b/mozilla/layout/base/nsStyleConsts.h index cda21116ab2..9cf311fab60 100644 --- a/mozilla/layout/base/nsStyleConsts.h +++ b/mozilla/layout/base/nsStyleConsts.h @@ -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 diff --git a/mozilla/layout/style/nsCSSProps.cpp b/mozilla/layout/style/nsCSSProps.cpp index 6ccfe331ead..b0f5a5e1079 100644 --- a/mozilla/layout/style/nsCSSProps.cpp +++ b/mozilla/layout/style/nsCSSProps.cpp @@ -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, diff --git a/mozilla/layout/style/test/property_database.js b/mozilla/layout/style/test/property_database.js index a93bf886a3d..3e81eccf9ca 100644 --- a/mozilla/layout/style/test/property_database.js +++ b/mozilla/layout/style/test/property_database.js @@ -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": { diff --git a/mozilla/mail/app/splash.rc b/mozilla/mail/app/splash.rc index 1042f0a1c25..29ccaa91547 100644 --- a/mozilla/mail/app/splash.rc +++ b/mozilla/mail/app/splash.rc @@ -70,6 +70,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" @@ -81,6 +82,7 @@ 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" // For some reason IDI_MAILBIFF needs to be larger than the value of IDI_APPLICATION for static builds #define IDI_MAILBIFF 101 diff --git a/mozilla/mail/app/splashos2.rc b/mozilla/mail/app/splashos2.rc index b72dd12ed0a..dd5f635b151 100644 --- a/mozilla/mail/app/splashos2.rc +++ b/mozilla/mail/app/splashos2.rc @@ -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" diff --git a/mozilla/suite/app/splashos2.rc b/mozilla/suite/app/splashos2.rc index 3d2fab6fae0..bd6c8834913 100644 --- a/mozilla/suite/app/splashos2.rc +++ b/mozilla/suite/app/splashos2.rc @@ -61,6 +61,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" diff --git a/mozilla/toolkit/library/xulrunos2.rc b/mozilla/toolkit/library/xulrunos2.rc index 4a0ad1e73fc..4306e8a655a 100644 --- a/mozilla/toolkit/library/xulrunos2.rc +++ b/mozilla/toolkit/library/xulrunos2.rc @@ -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" diff --git a/mozilla/widget/public/nsIWidget.h b/mozilla/widget/public/nsIWidget.h index 8f7fc73ca00..1773ffc10d0 100644 --- a/mozilla/widget/public/nsIWidget.h +++ b/mozilla/widget/public/nsIWidget.h @@ -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 }; diff --git a/mozilla/widget/src/beos/nsWindow.cpp b/mozilla/widget/src/beos/nsWindow.cpp index e4d5936702e..32ca1c83fad 100644 --- a/mozilla/widget/src/beos/nsWindow.cpp +++ b/mozilla/widget/src/beos/nsWindow.cpp @@ -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; diff --git a/mozilla/widget/src/build/res/none.cur b/mozilla/widget/src/build/res/none.cur new file mode 100644 index 0000000000000000000000000000000000000000..2114dfaee3acce126e79dc0de72edfa7cfc87e1b GIT binary patch literal 326 zcmZQzU}9ioP*7lE009F=1_m)8tpUUeK