[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

Changeset 37902 in webkit


Ignore:
Timestamp:
Oct 27, 2008, 2:20:13 PM (16 years ago)
Author:
Darin Adler
Message:

2008-10-27 Michael Knaup <michael.knaup@mac.com>

Reviewed and tweaked by Darin Adler.

Bug 8988: Add support for Mozilla CSS custom cursors.
Added -webkit-grab and -webkit-grabbing cursor suppport
for the Mac, dummy implementations for other platforms.

  • css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Updated since the -webkit-grabbing cursor is now the last one.
  • css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added CURSOR_WEBKIT_GRAB and CURSOR_WEBKIT_GRABBING.
  • css/CSSValueKeywords.in: Added -webkit-grab and -webkit-grabbing.
  • manual-tests/cursor.html: Added -webkit-zoom-in, webkit-zoom-out, -webkit-grab, and -webkit-grabbing.
  • page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): Added CURSOR_WEBKIT_GRAB and CURSOR_WEBKIT_GRABBING.
  • platform/Cursor.h: Added grabCursor and grabbingCursor.
  • platform/gtk/CursorGtk.cpp: (WebCore::grabCursor): Added. (WebCore::grabbingCursor): Added.
  • platform/mac/CursorMac.mm: (WebCore::grabCursor): Added. (WebCore::grabbingCursor): Added.
  • platform/qt/CursorQt.cpp: (WebCore::grabCursor): Added. (WebCore::grabbingCursor): Added.
  • platform/win/CursorWin.cpp: (WebCore::grabCursor): Added. (WebCore::grabbingCursor): Added.
  • platform/wx/CursorWx.cpp: (WebCore::grabCursor): Added. (WebCore::grabbingCursor): Added.
  • rendering/style/RenderStyleConstants.h: Added CURSOR_WEBKIT_GRAB and CURSOR_WEBKIT_GRABBING. Also broke ECursor out into a single constant per line. Also added a couple of comments.
Location:
trunk/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r37900 r37902  
     12008-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
    1522008-10-27  Dimitri Glazkov  <dglazkov@chromium.org>
    253
  • trunk/WebCore/css/CSSParser.cpp

    r37122 r37902  
    810810        // [<uri>,]*  [ auto | crosshair | default | pointer | progress | move | e-resize | ne-resize |
    811811        // 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
    813815        RefPtr<CSSValueList> list;
    814816        while (value && value->unit == CSSPrimitiveValue::CSS_URI) {
     
    843845            } else if (!m_strict && value->id == CSSValueHand) // MSIE 5 compatibility :/
    844846                list->append(CSSPrimitiveValue::createIdentifier(CSSValuePointer));
    845             else if (value && ((value->id >= CSSValueAuto && value->id <= CSSValueAllScroll) || value->id == CSSValueCopy || value->id == CSSValueNone))
     847            else if (value && ((value->id >= CSSValueAuto && value->id <= CSSValueWebkitGrabbing) || value->id == CSSValueCopy || value->id == CSSValueNone))
    846848                list->append(CSSPrimitiveValue::createIdentifier(value->id));
    847849            m_valueList->next();
     
    853855            id = CSSValuePointer;
    854856            valid_primitive = true;
    855         } else if ((value->id >= CSSValueAuto && value->id <= CSSValueAllScroll) || value->id == CSSValueCopy || value->id == CSSValueNone)
     857        } else if ((value->id >= CSSValueAuto && value->id <= CSSValueWebkitGrabbing) || value->id == CSSValueCopy || value->id == CSSValueNone)
    856858            valid_primitive = true;
    857859        break;
  • trunk/WebCore/css/CSSPrimitiveValueMappings.h

    r37663 r37902  
    654654            m_value.ident = CSSValueAllScroll;
    655655            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;
    656662    }
    657663}
  • trunk/WebCore/css/CSSValueKeywords.in

    r37663 r37902  
    298298help
    299299all-scroll
     300-webkit-grab
     301-webkit-grabbing
    300302# none
    301303#
  • trunk/WebCore/manual-tests/cursor.html

    r18270 r37902  
    3333<div style="width: 20px; height: 20px; margin: 10px; background: #ddd; cursor: copy">copy</div>
    3434<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  
    978978        case CURSOR_WEBKIT_ZOOM_OUT:
    979979            return zoomOutCursor();
     980        case CURSOR_WEBKIT_GRAB:
     981            return grabCursor();
     982        case CURSOR_WEBKIT_GRABBING:
     983            return grabbingCursor();
    980984    }
    981985    return pointerCursor();
  • trunk/WebCore/platform/Cursor.h

    r37599 r37902  
    146146    const Cursor& copyCursor();
    147147    const Cursor& noneCursor();
     148    const Cursor& grabCursor();
     149    const Cursor& grabbingCursor();
    148150
    149151} // namespace WebCore
  • trunk/WebCore/platform/gtk/CursorGtk.cpp

    r35532 r37902  
    269269const Cursor& cellCursor()
    270270{
    271     // TODO: Find a suitable cursor
     271    notImplemented();
    272272    return pointerCursor();
    273273}
     
    281281const Cursor& noDropCursor()
    282282{
    283     // TODO: Find a suitable cursor
     283    notImplemented();
    284284    return pointerCursor();
    285285}
     
    293293const Cursor& progressCursor()
    294294{
    295     // TODO: Find a suitable cursor
     295    notImplemented();
    296296    return pointerCursor();
    297297}
     
    305305const Cursor& noneCursor()
    306306{
    307     // TODO: Find a suitable cursor
     307    notImplemented();
    308308    return pointerCursor();
    309309}
     
    311311const Cursor& notAllowedCursor()
    312312{
    313     // TODO: Find a suitable cursor
     313    notImplemented();
    314314    return pointerCursor();
    315315}
     
    327327}
    328328
    329 }
     329const Cursor& grabCursor()
     330{
     331    notImplemented();
     332    return pointerCursor();
     333}
     334
     335const Cursor& grabbingCursor()
     336{
     337    notImplemented();
     338    return pointerCursor();
     339}
     340
     341}
  • trunk/WebCore/platform/mac/CursorMac.mm

    r35532 r37902  
    11/*
    2  * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2004, 2006 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    340340    return westResizeCursor();
    341341}
    342 }
     342
     343const Cursor& grabCursor()
     344{
     345    static Cursor c = [NSCursor openHandCursor];
     346    return c;
     347}
     348
     349const Cursor& grabbingCursor()
     350{
     351    static Cursor c = [NSCursor closedHandCursor];
     352    return c;
     353}
     354
     355}
  • trunk/WebCore/platform/qt/CursorQt.cpp

    r35993 r37902  
    356356}
    357357
     358const Cursor& grabCursor()
     359{
     360    notImplemented();
     361    return Cursors::self()->PointerCursor;
     362}
     363
     364const Cursor& grabbingCursor()
     365{
     366    notImplemented();
     367    return Cursors::self()->PointerCursor;
     368}
     369
    358370}
    359371
  • trunk/WebCore/platform/win/CursorWin.cpp

    r35740 r37902  
    403403}
    404404
    405 }
     405const Cursor& grabCursor()
     406{
     407    return pointerCursor();
     408}
     409
     410const Cursor& grabbingCursor()
     411{
     412    return pointerCursor();
     413}
     414
     415}
  • trunk/WebCore/platform/wx/CursorWx.cpp

    r35532 r37902  
    287287}
    288288
    289 }
     289const Cursor& grabCursor()
     290{
     291    // TODO: Determine if we can find a better cursor for this.
     292    return pointerCursor();
     293}
     294
     295const 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  
    210210
    211211enum 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
    218251};
    219252
Note: See TracChangeset for help on using the changeset viewer.