Changeset 37902 in webkit
- Timestamp:
- Oct 27, 2008, 2:20:13 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r37900 r37902 1 2008-10-27 Michael Knaup <michael.knaup@mac.com> 2 3 Reviewed and tweaked by Darin Adler. 4 5 - https://bugs.webkit.org/show_bug.cgi?id=8988 6 7 Bug 8988: Add support for Mozilla CSS custom cursors. 8 Added -webkit-grab and -webkit-grabbing cursor suppport 9 for the Mac, dummy implementations for other platforms. 10 11 * css/CSSParser.cpp: 12 (WebCore::CSSParser::parseValue): Updated since the 13 -webkit-grabbing cursor is now the last one. 14 15 * css/CSSPrimitiveValueMappings.h: 16 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added 17 CURSOR_WEBKIT_GRAB and CURSOR_WEBKIT_GRABBING. 18 19 * css/CSSValueKeywords.in: Added -webkit-grab and 20 -webkit-grabbing. 21 22 * manual-tests/cursor.html: Added -webkit-zoom-in, 23 webkit-zoom-out, -webkit-grab, and -webkit-grabbing. 24 25 * page/EventHandler.cpp: 26 (WebCore::EventHandler::selectCursor): Added 27 CURSOR_WEBKIT_GRAB and CURSOR_WEBKIT_GRABBING. 28 29 * platform/Cursor.h: Added grabCursor and grabbingCursor. 30 31 * platform/gtk/CursorGtk.cpp: 32 (WebCore::grabCursor): Added. 33 (WebCore::grabbingCursor): Added. 34 * platform/mac/CursorMac.mm: 35 (WebCore::grabCursor): Added. 36 (WebCore::grabbingCursor): Added. 37 * platform/qt/CursorQt.cpp: 38 (WebCore::grabCursor): Added. 39 (WebCore::grabbingCursor): Added. 40 * platform/win/CursorWin.cpp: 41 (WebCore::grabCursor): Added. 42 (WebCore::grabbingCursor): Added. 43 * platform/wx/CursorWx.cpp: 44 (WebCore::grabCursor): Added. 45 (WebCore::grabbingCursor): Added. 46 47 * rendering/style/RenderStyleConstants.h: 48 Added CURSOR_WEBKIT_GRAB and CURSOR_WEBKIT_GRABBING. 49 Also broke ECursor out into a single constant per line. 50 Also added a couple of comments. 51 1 52 2008-10-27 Dimitri Glazkov <dglazkov@chromium.org> 2 53 -
trunk/WebCore/css/CSSParser.cpp
r37122 r37902 810 810 // [<uri>,]* [ auto | crosshair | default | pointer | progress | move | e-resize | ne-resize | 811 811 // nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | ew-resize | 812 // ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | text | wait | help ] ] | inherit 812 // ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | text | wait | help | 813 // vertical-text | cell | context-menu | alias | copy | no-drop | not-allowed | -webkit-zoom-in 814 // -webkit-zoom-in | -webkit-zoom-out | all-scroll | -webkit-grab | -webkit-grabbing ] ] | inherit 813 815 RefPtr<CSSValueList> list; 814 816 while (value && value->unit == CSSPrimitiveValue::CSS_URI) { … … 843 845 } else if (!m_strict && value->id == CSSValueHand) // MSIE 5 compatibility :/ 844 846 list->append(CSSPrimitiveValue::createIdentifier(CSSValuePointer)); 845 else if (value && ((value->id >= CSSValueAuto && value->id <= CSSValue AllScroll) || value->id == CSSValueCopy || value->id == CSSValueNone))847 else if (value && ((value->id >= CSSValueAuto && value->id <= CSSValueWebkitGrabbing) || value->id == CSSValueCopy || value->id == CSSValueNone)) 846 848 list->append(CSSPrimitiveValue::createIdentifier(value->id)); 847 849 m_valueList->next(); … … 853 855 id = CSSValuePointer; 854 856 valid_primitive = true; 855 } else if ((value->id >= CSSValueAuto && value->id <= CSSValue AllScroll) || value->id == CSSValueCopy || value->id == CSSValueNone)857 } else if ((value->id >= CSSValueAuto && value->id <= CSSValueWebkitGrabbing) || value->id == CSSValueCopy || value->id == CSSValueNone) 856 858 valid_primitive = true; 857 859 break; -
trunk/WebCore/css/CSSPrimitiveValueMappings.h
r37663 r37902 654 654 m_value.ident = CSSValueAllScroll; 655 655 break; 656 case CURSOR_WEBKIT_GRAB: 657 m_value.ident = CSSValueWebkitGrab; 658 break; 659 case CURSOR_WEBKIT_GRABBING: 660 m_value.ident = CSSValueWebkitGrabbing; 661 break; 656 662 } 657 663 } -
trunk/WebCore/css/CSSValueKeywords.in
r37663 r37902 298 298 help 299 299 all-scroll 300 -webkit-grab 301 -webkit-grabbing 300 302 # none 301 303 # -
trunk/WebCore/manual-tests/cursor.html
r18270 r37902 33 33 <div style="width: 20px; height: 20px; margin: 10px; background: #ddd; cursor: copy">copy</div> 34 34 <div style="width: 20px; height: 20px; margin: 10px; background: #ddd; cursor: none">none</div> 35 <div style="width: 20px; height: 20px; margin: 10px; background: #ddd; cursor: -webkit-zoom-in">zoom in</div> 36 <div style="width: 20px; height: 20px; margin: 10px; background: #ddd; cursor: -webkit-zoom-out">zoom out</div> 37 <div style="width: 20px; height: 20px; margin: 10px; background: #ddd; cursor: -webkit-grab">grab</div> 38 <div style="width: 20px; height: 20px; margin: 10px; background: #ddd; cursor: -webkit-grabbing">grabbing</div> -
trunk/WebCore/page/EventHandler.cpp
r37834 r37902 978 978 case CURSOR_WEBKIT_ZOOM_OUT: 979 979 return zoomOutCursor(); 980 case CURSOR_WEBKIT_GRAB: 981 return grabCursor(); 982 case CURSOR_WEBKIT_GRABBING: 983 return grabbingCursor(); 980 984 } 981 985 return pointerCursor(); -
trunk/WebCore/platform/Cursor.h
r37599 r37902 146 146 const Cursor& copyCursor(); 147 147 const Cursor& noneCursor(); 148 const Cursor& grabCursor(); 149 const Cursor& grabbingCursor(); 148 150 149 151 } // namespace WebCore -
trunk/WebCore/platform/gtk/CursorGtk.cpp
r35532 r37902 269 269 const Cursor& cellCursor() 270 270 { 271 // TODO: Find a suitable cursor271 notImplemented(); 272 272 return pointerCursor(); 273 273 } … … 281 281 const Cursor& noDropCursor() 282 282 { 283 // TODO: Find a suitable cursor283 notImplemented(); 284 284 return pointerCursor(); 285 285 } … … 293 293 const Cursor& progressCursor() 294 294 { 295 // TODO: Find a suitable cursor295 notImplemented(); 296 296 return pointerCursor(); 297 297 } … … 305 305 const Cursor& noneCursor() 306 306 { 307 // TODO: Find a suitable cursor307 notImplemented(); 308 308 return pointerCursor(); 309 309 } … … 311 311 const Cursor& notAllowedCursor() 312 312 { 313 // TODO: Find a suitable cursor313 notImplemented(); 314 314 return pointerCursor(); 315 315 } … … 327 327 } 328 328 329 } 329 const Cursor& grabCursor() 330 { 331 notImplemented(); 332 return pointerCursor(); 333 } 334 335 const Cursor& grabbingCursor() 336 { 337 notImplemented(); 338 return pointerCursor(); 339 } 340 341 } -
trunk/WebCore/platform/mac/CursorMac.mm
r35532 r37902 1 1 /* 2 * Copyright (C) 2004, 2006 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2004, 2006 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 340 340 return westResizeCursor(); 341 341 } 342 } 342 343 const Cursor& grabCursor() 344 { 345 static Cursor c = [NSCursor openHandCursor]; 346 return c; 347 } 348 349 const Cursor& grabbingCursor() 350 { 351 static Cursor c = [NSCursor closedHandCursor]; 352 return c; 353 } 354 355 } -
trunk/WebCore/platform/qt/CursorQt.cpp
r35993 r37902 356 356 } 357 357 358 const Cursor& grabCursor() 359 { 360 notImplemented(); 361 return Cursors::self()->PointerCursor; 362 } 363 364 const Cursor& grabbingCursor() 365 { 366 notImplemented(); 367 return Cursors::self()->PointerCursor; 368 } 369 358 370 } 359 371 -
trunk/WebCore/platform/win/CursorWin.cpp
r35740 r37902 403 403 } 404 404 405 } 405 const Cursor& grabCursor() 406 { 407 return pointerCursor(); 408 } 409 410 const Cursor& grabbingCursor() 411 { 412 return pointerCursor(); 413 } 414 415 } -
trunk/WebCore/platform/wx/CursorWx.cpp
r35532 r37902 287 287 } 288 288 289 } 289 const Cursor& grabCursor() 290 { 291 // TODO: Determine if we can find a better cursor for this. 292 return pointerCursor(); 293 } 294 295 const Cursor& grabbingCursor() 296 { 297 // TODO: Determine if we can find a better cursor for this. 298 return pointerCursor(); 299 } 300 301 } -
trunk/WebCore/rendering/style/RenderStyleConstants.h
r37663 r37902 210 210 211 211 enum ECursor { 212 CURSOR_AUTO, CURSOR_CROSS, CURSOR_DEFAULT, CURSOR_POINTER, CURSOR_MOVE, CURSOR_VERTICAL_TEXT, CURSOR_CELL, CURSOR_CONTEXT_MENU, 213 CURSOR_ALIAS, CURSOR_PROGRESS, CURSOR_NO_DROP, CURSOR_NOT_ALLOWED, CURSOR_WEBKIT_ZOOM_IN, CURSOR_WEBKIT_ZOOM_OUT, 214 CURSOR_E_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_N_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, 215 CURSOR_S_RESIZE, CURSOR_W_RESIZE, CURSOR_EW_RESIZE, CURSOR_NS_RESIZE, CURSOR_NESW_RESIZE, CURSOR_NWSE_RESIZE, 216 CURSOR_COL_RESIZE, CURSOR_ROW_RESIZE, CURSOR_TEXT, CURSOR_WAIT, CURSOR_HELP, CURSOR_ALL_SCROLL, 217 CURSOR_COPY, CURSOR_NONE 212 // The following must match the order in CSSValueKeywords.in. 213 CURSOR_AUTO, 214 CURSOR_CROSS, 215 CURSOR_DEFAULT, 216 CURSOR_POINTER, 217 CURSOR_MOVE, 218 CURSOR_VERTICAL_TEXT, 219 CURSOR_CELL, 220 CURSOR_CONTEXT_MENU, 221 CURSOR_ALIAS, 222 CURSOR_PROGRESS, 223 CURSOR_NO_DROP, 224 CURSOR_NOT_ALLOWED, 225 CURSOR_WEBKIT_ZOOM_IN, 226 CURSOR_WEBKIT_ZOOM_OUT, 227 CURSOR_E_RESIZE, 228 CURSOR_NE_RESIZE, 229 CURSOR_NW_RESIZE, 230 CURSOR_N_RESIZE, 231 CURSOR_SE_RESIZE, 232 CURSOR_SW_RESIZE, 233 CURSOR_S_RESIZE, 234 CURSOR_W_RESIZE, 235 CURSOR_EW_RESIZE, 236 CURSOR_NS_RESIZE, 237 CURSOR_NESW_RESIZE, 238 CURSOR_NWSE_RESIZE, 239 CURSOR_COL_RESIZE, 240 CURSOR_ROW_RESIZE, 241 CURSOR_TEXT, 242 CURSOR_WAIT, 243 CURSOR_HELP, 244 CURSOR_ALL_SCROLL, 245 CURSOR_WEBKIT_GRAB, 246 CURSOR_WEBKIT_GRABBING, 247 248 // The following are handled as exceptions so don't need to match. 249 CURSOR_COPY, 250 CURSOR_NONE 218 251 }; 219 252
Note:
See TracChangeset
for help on using the changeset viewer.