Changeset 134144 in webkit


Ignore:
Timestamp:
Nov 9, 2012 6:45:24 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

No tests for changing mouse cursors
https://bugs.webkit.org/show_bug.cgi?id=100550

Patch by Rick Byers <rbyers@chromium.org> on 2012-11-09
Reviewed by Adam Barth.

.:

Add necessary exports for Internals::getCurrentCursorInfo

  • Source/autotools/symbols.filter:

Source/WebCore:

Add infrastructure to keep track of the last set mouse cursor,
and then to query it from DumpRenderTree.

Test: fast/events/mouse-cursor.html

  • WebCore.exp.in: Add Cursor copy ctor export
  • page/EventHandler.cpp:

(WebCore::EventHandler::handleMouseMoveEvent): Keep track of last set mouse cursor

  • page/EventHandler.h:

(WebCore::EventHandler::currentMouseCursor): New getter for last set mouse cursor

  • testing/Internals.cpp:

(WebCore::cursorTypeToString): Helper to convert cursor type to enum
(WebCore):
(WebCore::Internals::getCurrentCursorInfo): New function to return a string describing the last set mouse cursor

  • testing/Internals.h: Declare getCurrentCursorInfo
  • testing/Internals.idl: Declare getCurrentCursorInfo

Source/WebKit2:

Add necessary exports for Internals::getCurrentCursorInfo

  • win/WebKit2.def:
  • win/WebKit2CFLite.def:

LayoutTests:

Add a simple test covering the basic scenarios of changing a mouse
cursor with CSS. This includes most of the cases currently covered
by ManualTests/*cursor*.

  • fast/events/mouse-cursor-expected.txt: Added.
  • fast/events/mouse-cursor.html: Added.
  • platform/chromium/TestExpectations: Add failure expectation.
Location:
trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r134057 r134144  
     12012-11-09  Rick Byers  <rbyers@chromium.org>
     2
     3        No tests for changing mouse cursors
     4        https://bugs.webkit.org/show_bug.cgi?id=100550
     5
     6        Reviewed by Adam Barth.
     7
     8        Add necessary exports for Internals::getCurrentCursorInfo
     9
     10        * Source/autotools/symbols.filter:
     11
    1122012-11-09  Laszlo Gombos  <l.gombos@samsung.com>
    213
  • trunk/LayoutTests/ChangeLog

    r134138 r134144  
     12012-11-09  Rick Byers  <rbyers@chromium.org>
     2
     3        No tests for changing mouse cursors
     4        https://bugs.webkit.org/show_bug.cgi?id=100550
     5
     6        Reviewed by Adam Barth.
     7
     8        Add a simple test covering the basic scenarios of changing a mouse
     9        cursor with CSS.  This includes most of the cases currently covered
     10        by ManualTests/*cursor*.
     11
     12        * fast/events/mouse-cursor-expected.txt: Added.
     13        * fast/events/mouse-cursor.html: Added.
     14        * platform/chromium/TestExpectations: Add failure expectation.
     15
    1162012-11-09  Noel Gordon  <noel.gordon@gmail.com>
    217
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r134138 r134144  
    42034203webkit.org/b/101618 [ Win7 Debug ] http/tests/inspector/indexeddb/database-data.html [ Crash ]
    42044204
     4205# This test will be enabled shortly when chromium moves to the USE(LAZY_NATIVE_CURSOR) infrastructure
     4206webkit.org/b/101501 fast/events/mouse-cursor.html [ Failure ]
     4207
    42054208# Failures following r133840:
    42064209webkit.org/b/101547 fast/repaint/4774354.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r134142 r134144  
     12012-11-09  Rick Byers  <rbyers@chromium.org>
     2
     3        No tests for changing mouse cursors
     4        https://bugs.webkit.org/show_bug.cgi?id=100550
     5
     6        Reviewed by Adam Barth.
     7
     8        Add infrastructure to keep track of the last set mouse cursor,
     9        and then to query it from DumpRenderTree.
     10
     11        Test: fast/events/mouse-cursor.html
     12
     13        * WebCore.exp.in: Add Cursor copy ctor export
     14        * page/EventHandler.cpp:
     15        (WebCore::EventHandler::handleMouseMoveEvent): Keep track of last set mouse cursor
     16        * page/EventHandler.h:
     17        (WebCore::EventHandler::currentMouseCursor): New getter for last set mouse cursor
     18        * testing/Internals.cpp:
     19        (WebCore::cursorTypeToString): Helper to convert cursor type to enum
     20        (WebCore):
     21        (WebCore::Internals::getCurrentCursorInfo): New function to return a string describing the last set mouse cursor
     22        * testing/Internals.h: Declare getCurrentCursorInfo
     23        * testing/Internals.idl: Declare getCurrentCursorInfo
     24
    1252012-11-09  Huang Dongsung  <luxtella@company100.net>
    226
  • trunk/Source/WebCore/WebCore.exp.in

    r133957 r134144  
    17121712__ZN7WebCore6Cursor8fromTypeENS0_4TypeE
    17131713__ZN7WebCore6CursorC1EPNS_5ImageERKNS_8IntPointE
     1714__ZN7WebCore6CursorC1ERKS0_
    17141715__ZN7WebCore6CursorD1Ev
    17151716__ZN7WebCore6CursoraSERKS0_
  • trunk/Source/WebCore/page/EventHandler.cpp

    r133976 r134144  
    15271527    return pointerCursor();
    15281528}
    1529    
     1529
    15301530static LayoutPoint documentPointForWindowPoint(Frame* frame, const IntPoint& windowPoint)
    15311531{
     
    18631863            OptionalCursor optionalCursor = selectCursor(mev, scrollbar);
    18641864            if (optionalCursor.isCursorChange())
    1865                 view->setCursor(optionalCursor.cursor());
     1865                m_currentMouseCursor = optionalCursor.cursor();
     1866                view->setCursor(m_currentMouseCursor);
    18661867        }
    18671868    }
  • trunk/Source/WebCore/page/EventHandler.h

    r132945 r134144  
    2727#define EventHandler_h
    2828
     29#include "Cursor.h"
    2930#include "DragActions.h"
    3031#include "DragState.h"
     
    142143
    143144    IntPoint currentMousePosition() const;
     145    Cursor currentMouseCursor() const { return m_currentMouseCursor; }
    144146
    145147    static Frame* subframeForTargetNode(Node*);
     
    421423    RefPtr<Frame> m_lastMouseMoveEventSubframe;
    422424    RefPtr<Scrollbar> m_lastScrollbarUnderMouse;
     425    Cursor m_currentMouseCursor;
    423426
    424427    int m_clickCount;
  • trunk/Source/WebCore/testing/Internals.cpp

    r133848 r134144  
    3232#include "ClientRectList.h"
    3333#include "ComposedShadowTreeWalker.h"
     34#include "Cursor.h"
    3435#include "DOMStringList.h"
    3536#include "DOMWindow.h"
     
    3940#include "Element.h"
    4041#include "ElementShadow.h"
     42#include "EventHandler.h"
    4143#include "ExceptionCode.h"
    4244#include "FormController.h"
     
    7577#include "TreeScope.h"
    7678#include "ViewportArguments.h"
     79#include <wtf/text/StringBuffer.h>
     80
    7781
    7882#if ENABLE(INPUT_TYPE_COLOR)
     
    9498
    9599#if ENABLE(TOUCH_ADJUSTMENT)
    96 #include "EventHandler.h"
    97100#include "WebKitPoint.h"
    98101#endif
     
    14781481}
    14791482
    1480 }
     1483#if USE(LAZY_NATIVE_CURSOR)
     1484static const char* cursorTypeToString(Cursor::Type cursorType)
     1485{
     1486    switch (cursorType) {
     1487    case Cursor::Pointer: return "TypePointer";
     1488    case Cursor::Cross: return "TypeCross";
     1489    case Cursor::Hand: return "TypeHand";
     1490    case Cursor::IBeam: return "TypeIBeam";
     1491    case Cursor::Wait: return "TypeWait";
     1492    case Cursor::Help: return "TypeHelp";
     1493    case Cursor::EastResize: return "TypeEastResize";
     1494    case Cursor::NorthResize: return "TypeNorthResize";
     1495    case Cursor::NorthEastResize: return "TypeNorthEastResize";
     1496    case Cursor::NorthWestResize: return "TypeNorthWestResize";
     1497    case Cursor::SouthResize: return "TypeSouthResize";
     1498    case Cursor::SouthEastResize: return "TypeSouthEastResize";
     1499    case Cursor::SouthWestResize: return "TypeSouthWestResize";
     1500    case Cursor::WestResize: return "TypeWestResize";
     1501    case Cursor::NorthSouthResize: return "TypeNorthSouthResize";
     1502    case Cursor::EastWestResize: return "TypeEastWestResize";
     1503    case Cursor::NorthEastSouthWestResize: return "TypeNorthEastSouthWestResize";
     1504    case Cursor::NorthWestSouthEastResize: return "TypeNorthWestSouthEastResize";
     1505    case Cursor::ColumnResize: return "TypeColumnResize";
     1506    case Cursor::RowResize: return "TypeRowResize";
     1507    case Cursor::MiddlePanning: return "TypeMiddlePanning";
     1508    case Cursor::EastPanning: return "TypeEastPanning";
     1509    case Cursor::NorthPanning: return "TypeNorthPanning";
     1510    case Cursor::NorthEastPanning: return "TypeNorthEastPanning";
     1511    case Cursor::NorthWestPanning: return "TypeNorthWestPanning";
     1512    case Cursor::SouthPanning: return "TypeSouthPanning";
     1513    case Cursor::SouthEastPanning: return "TypeSouthEastPanning";
     1514    case Cursor::SouthWestPanning: return "TypeSouthWestPanning";
     1515    case Cursor::WestPanning: return "TypeWestPanning";
     1516    case Cursor::Move: return "TypeMove";
     1517    case Cursor::VerticalText: return "TypeVerticalText";
     1518    case Cursor::Cell: return "TypeCell";
     1519    case Cursor::ContextMenu: return "TypeContextMenu";
     1520    case Cursor::Alias: return "TypeAlias";
     1521    case Cursor::Progress: return "TypeProgress";
     1522    case Cursor::NoDrop: return "TypeNoDrop";
     1523    case Cursor::Copy: return "TypeCopy";
     1524    case Cursor::None: return "TypeNone";
     1525    case Cursor::NotAllowed: return "TypeNotAllowed";
     1526    case Cursor::ZoomIn: return "TypeZoomIn";
     1527    case Cursor::ZoomOut: return "TypeZoomOut";
     1528    case Cursor::Grab: return "TypeGrab";
     1529    case Cursor::Grabbing: return "TypeGrabbing";
     1530    case Cursor::Custom: return "TypeCustom";
     1531    }
     1532
     1533    ASSERT_NOT_REACHED();
     1534    return "UNKNOWN";
     1535}
     1536#endif
     1537
     1538String Internals::getCurrentCursorInfo(Document* document, ExceptionCode& ec)
     1539{
     1540    if (!document || !document->frame()) {
     1541        ec = INVALID_ACCESS_ERR;
     1542        return String();
     1543    }
     1544
     1545    Cursor cursor = document->frame()->eventHandler()->currentMouseCursor();
     1546
     1547#if USE(LAZY_NATIVE_CURSOR)
     1548    StringBuilder result;
     1549    result.append("type=");
     1550    result.append(cursorTypeToString(cursor.type()));
     1551    result.append(" hotSpot=");
     1552    result.appendNumber(cursor.hotSpot().x());
     1553    result.append(",");
     1554    result.appendNumber(cursor.hotSpot().y());
     1555    if (cursor.image()) {
     1556        IntSize size = cursor.image()->size();
     1557        result.append(" image=");
     1558        result.appendNumber(size.width());
     1559        result.append("x");
     1560        result.appendNumber(size.height());
     1561    }
     1562    return result.toString();
     1563#else
     1564    return "FAIL: Cursor details not available on this platform.";
     1565#endif
     1566}
     1567
     1568}
  • trunk/Source/WebCore/testing/Internals.h

    r133575 r134144  
    243243    void stopTrackingRepaints(Document*, ExceptionCode&);
    244244
     245    String getCurrentCursorInfo(Document*, ExceptionCode&);
     246
    245247private:
    246248    explicit Internals(Document*);
  • trunk/Source/WebCore/testing/Internals.idl

    r133575 r134144  
    211211    void startTrackingRepaints(in Document document) raises (DOMException);
    212212    void stopTrackingRepaints(in Document document) raises (DOMException);
     213
     214    // Returns a string with information about the mouse cursor used at the specified client location.
     215    DOMString getCurrentCursorInfo(in Document document) raises (DOMException);
    213216};
  • trunk/Source/WebKit2/ChangeLog

    r134143 r134144  
     12012-11-09  Rick Byers  <rbyers@chromium.org>
     2
     3        No tests for changing mouse cursors
     4        https://bugs.webkit.org/show_bug.cgi?id=100550
     5
     6        Reviewed by Adam Barth.
     7
     8        Add necessary exports for Internals::getCurrentCursorInfo
     9
     10        * win/WebKit2.def:
     11        * win/WebKit2CFLite.def:
     12
    1132012-11-09  Vivek Galatage  <vivekgalatage@gmail.com>
    214
  • trunk/Source/WebKit2/win/WebKit2.def

    r133848 r134144  
    154154        ??0ClientRectList@WebCore@@AAE@ABV?$Vector@VFloatQuad@WebCore@@$0A@@WTF@@@Z
    155155        ??1ClientRectList@WebCore@@QAE@XZ
     156        ??1Cursor@WebCore@@QAE@XZ
     157        ??0Cursor@WebCore@@QAE@ABV01@@Z
    156158        ??0String@WTF@@QAE@PBD@Z
    157159        ??0String@WTF@@QAE@PB_W@Z
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r134143 r134144  
    147147        ??0ClientRectList@WebCore@@AAE@ABV?$Vector@VFloatQuad@WebCore@@$0A@@WTF@@@Z
    148148        ??1ClientRectList@WebCore@@QAE@XZ
     149        ??1Cursor@WebCore@@QAE@XZ
     150        ??0Cursor@WebCore@@QAE@ABV01@@Z
    149151        ??0String@WTF@@QAE@PBD@Z
    150152        ??0String@WTF@@QAE@PB_W@Z
  • trunk/Source/autotools/symbols.filter

    r133848 r134144  
    163163_ZN7WebCore10ScrollView21setDelegatesScrollingEb;
    164164_ZN7WebCore4Node14removedLastRefEv;
     165_ZN7WebCore6CursorC1ERKS0_;
     166_ZN7WebCore6CursorD1Ev;
    165167_ZN7WebCore8Settings16setImagesEnabledEb;
    166168_ZN7WebCore8Settings18setFixedFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
Note: See TracChangeset for help on using the changeset viewer.