Changeset 134803 in webkit
- Timestamp:
- Nov 15, 2012 11:15:17 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r134753 r134803 1 2012-11-15 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 Brent Fulgham. 7 8 Add necessary exports for Internals::getCurrentCursorInfo 9 10 * Source/autotools/symbols.filter: 11 1 12 2012-11-15 Kent Tamura <tkent@chromium.org> 2 13 -
trunk/LayoutTests/ChangeLog
r134802 r134803 1 2012-11-15 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 Brent Fulgham. 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 1 15 2012-11-13 Jer Noble <jer.noble@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r134802 r134803 1 2012-11-15 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 Brent Fulgham. 7 8 Add infrastructure to keep track of the last set mouse cursor, 9 and then to query it from DumpRenderTree. Also adds ASSERTs to help ensure 10 we can reliably detect when an uninitialized Cursor object is used (such as 11 the one that can be returned from OptionalCursor in the NoCursorChange scenario). 12 13 Test: fast/events/mouse-cursor.html 14 15 * WebCore.exp.in: Add Cursor copy ctor export 16 * page/EventHandler.cpp: 17 (WebCore::OptionalCursor::cursor): 18 (WebCore::EventHandler::handleMouseMoveEvent): Keep track of last set mouse cursor 19 * page/EventHandler.h: 20 (WebCore::EventHandler::currentMouseCursor): New getter for last set mouse cursor 21 * platform/Cursor.h: 22 (WebCore::Cursor::Cursor): Mark uninitialized cursor types as invalid. 23 (WebCore::Cursor::type): Assert cursor type is valid. 24 * testing/Internals.cpp: 25 (WebCore::cursorTypeToString): Helper to convert cursor type to enum 26 (WebCore): 27 (WebCore::Internals::getCurrentCursorInfo): New function to return a string describing the last set mouse cursor 28 * testing/Internals.h: Declare getCurrentCursorInfo 29 * testing/Internals.idl: Declare getCurrentCursorInfo 30 1 31 2012-11-13 Jer Noble <jer.noble@apple.com> 2 32 -
trunk/Source/WebCore/WebCore.exp.in
r134747 r134803 1712 1712 __ZN7WebCore6Cursor8fromTypeENS0_4TypeE 1713 1713 __ZN7WebCore6CursorC1EPNS_5ImageERKNS_8IntPointE 1714 __ZN7WebCore6CursorC1ERKS0_ 1714 1715 __ZN7WebCore6CursorD1Ev 1715 1716 __ZN7WebCore6CursoraSERKS0_ -
trunk/Source/WebCore/page/EventHandler.cpp
r134253 r134803 157 157 158 158 bool isCursorChange() const { return m_isCursorChange; } 159 const Cursor& cursor() const { return m_cursor; }159 const Cursor& cursor() const { ASSERT(m_isCursorChange); return m_cursor; } 160 160 161 161 private: … … 1539 1539 return pointerCursor(); 1540 1540 } 1541 1541 1542 1542 static LayoutPoint documentPointForWindowPoint(Frame* frame, const IntPoint& windowPoint) 1543 1543 { … … 1874 1874 if (FrameView* view = m_frame->view()) { 1875 1875 OptionalCursor optionalCursor = selectCursor(mev, scrollbar); 1876 if (optionalCursor.isCursorChange()) 1877 view->setCursor(optionalCursor.cursor()); 1876 if (optionalCursor.isCursorChange()) { 1877 m_currentMouseCursor = optionalCursor.cursor(); 1878 view->setCursor(m_currentMouseCursor); 1879 } 1878 1880 } 1879 1881 } -
trunk/Source/WebCore/page/EventHandler.h
r134183 r134803 27 27 #define EventHandler_h 28 28 29 #include "Cursor.h" 29 30 #include "DragActions.h" 30 31 #include "DragState.h" … … 142 143 143 144 IntPoint currentMousePosition() const; 145 Cursor currentMouseCursor() const { return m_currentMouseCursor; } 144 146 145 147 static Frame* subframeForTargetNode(Node*); … … 421 423 RefPtr<Frame> m_lastMouseMoveEventSubframe; 422 424 RefPtr<Scrollbar> m_lastScrollbarUnderMouse; 425 Cursor m_currentMouseCursor; 423 426 424 427 int m_clickCount; -
trunk/Source/WebCore/platform/Cursor.h
r134149 r134803 29 29 #include "Image.h" 30 30 #include "IntPoint.h" 31 #include <wtf/Assertions.h> 31 32 #include <wtf/RefPtr.h> 32 33 … … 100 101 public: 101 102 enum Type { 102 Pointer ,103 Pointer = 0, 103 104 Cross, 104 105 Hand, … … 150 151 Cursor() 151 152 #if !PLATFORM(IOS) && !PLATFORM(BLACKBERRY) 153 #if USE(LAZY_NATIVE_CURSOR) 154 // This is an invalid Cursor and should never actually get used. 155 : m_type(static_cast<Type>(-1)) 156 , m_platformCursor(0) 157 #else 152 158 : m_platformCursor(0) 153 #endif 159 #endif // USE(LAZY_NATIVE_CURSOR) 160 #endif // !PLATFORM(IOS) && !PLATFORM(BLACKBERRY) 154 161 { 155 162 } … … 163 170 #if USE(LAZY_NATIVE_CURSOR) 164 171 explicit Cursor(Type); 165 Type type() const { return m_type; } 172 Type type() const 173 { 174 ASSERT(m_type >= 0 && m_type <= Custom); 175 return m_type; 176 } 166 177 Image* image() const { return m_image.get(); } 167 178 const IntPoint& hotSpot() const { return m_hotSpot; } -
trunk/Source/WebCore/testing/Internals.cpp
r134747 r134803 32 32 #include "ClientRectList.h" 33 33 #include "ComposedShadowTreeWalker.h" 34 #include "Cursor.h" 34 35 #include "DOMStringList.h" 35 36 #include "DOMWindow.h" … … 39 40 #include "Element.h" 40 41 #include "ElementShadow.h" 42 #include "EventHandler.h" 41 43 #include "ExceptionCode.h" 42 44 #include "FormController.h" … … 76 78 #include "TreeScope.h" 77 79 #include "ViewportArguments.h" 80 #include <wtf/text/StringBuffer.h> 81 78 82 79 83 #if ENABLE(INPUT_TYPE_COLOR) … … 95 99 96 100 #if ENABLE(TOUCH_ADJUSTMENT) 97 #include "EventHandler.h"98 101 #include "WebKitPoint.h" 99 102 #endif … … 1540 1543 } 1541 1544 1542 } 1545 #if USE(LAZY_NATIVE_CURSOR) 1546 static const char* cursorTypeToString(Cursor::Type cursorType) 1547 { 1548 switch (cursorType) { 1549 case Cursor::Pointer: return "Pointer"; 1550 case Cursor::Cross: return "Cross"; 1551 case Cursor::Hand: return "Hand"; 1552 case Cursor::IBeam: return "IBeam"; 1553 case Cursor::Wait: return "Wait"; 1554 case Cursor::Help: return "Help"; 1555 case Cursor::EastResize: return "EastResize"; 1556 case Cursor::NorthResize: return "NorthResize"; 1557 case Cursor::NorthEastResize: return "NorthEastResize"; 1558 case Cursor::NorthWestResize: return "NorthWestResize"; 1559 case Cursor::SouthResize: return "SouthResize"; 1560 case Cursor::SouthEastResize: return "SouthEastResize"; 1561 case Cursor::SouthWestResize: return "SouthWestResize"; 1562 case Cursor::WestResize: return "WestResize"; 1563 case Cursor::NorthSouthResize: return "NorthSouthResize"; 1564 case Cursor::EastWestResize: return "EastWestResize"; 1565 case Cursor::NorthEastSouthWestResize: return "NorthEastSouthWestResize"; 1566 case Cursor::NorthWestSouthEastResize: return "NorthWestSouthEastResize"; 1567 case Cursor::ColumnResize: return "ColumnResize"; 1568 case Cursor::RowResize: return "RowResize"; 1569 case Cursor::MiddlePanning: return "MiddlePanning"; 1570 case Cursor::EastPanning: return "EastPanning"; 1571 case Cursor::NorthPanning: return "NorthPanning"; 1572 case Cursor::NorthEastPanning: return "NorthEastPanning"; 1573 case Cursor::NorthWestPanning: return "NorthWestPanning"; 1574 case Cursor::SouthPanning: return "SouthPanning"; 1575 case Cursor::SouthEastPanning: return "SouthEastPanning"; 1576 case Cursor::SouthWestPanning: return "SouthWestPanning"; 1577 case Cursor::WestPanning: return "WestPanning"; 1578 case Cursor::Move: return "Move"; 1579 case Cursor::VerticalText: return "VerticalText"; 1580 case Cursor::Cell: return "Cell"; 1581 case Cursor::ContextMenu: return "ContextMenu"; 1582 case Cursor::Alias: return "Alias"; 1583 case Cursor::Progress: return "Progress"; 1584 case Cursor::NoDrop: return "NoDrop"; 1585 case Cursor::Copy: return "Copy"; 1586 case Cursor::None: return "None"; 1587 case Cursor::NotAllowed: return "NotAllowed"; 1588 case Cursor::ZoomIn: return "ZoomIn"; 1589 case Cursor::ZoomOut: return "ZoomOut"; 1590 case Cursor::Grab: return "Grab"; 1591 case Cursor::Grabbing: return "Grabbing"; 1592 case Cursor::Custom: return "Custom"; 1593 } 1594 1595 ASSERT_NOT_REACHED(); 1596 return "UNKNOWN"; 1597 } 1598 #endif 1599 1600 String Internals::getCurrentCursorInfo(Document* document, ExceptionCode& ec) 1601 { 1602 if (!document || !document->frame()) { 1603 ec = INVALID_ACCESS_ERR; 1604 return String(); 1605 } 1606 1607 Cursor cursor = document->frame()->eventHandler()->currentMouseCursor(); 1608 1609 #if USE(LAZY_NATIVE_CURSOR) 1610 StringBuilder result; 1611 result.append("type="); 1612 result.append(cursorTypeToString(cursor.type())); 1613 result.append(" hotSpot="); 1614 result.appendNumber(cursor.hotSpot().x()); 1615 result.append(","); 1616 result.appendNumber(cursor.hotSpot().y()); 1617 if (cursor.image()) { 1618 IntSize size = cursor.image()->size(); 1619 result.append(" image="); 1620 result.appendNumber(size.width()); 1621 result.append("x"); 1622 result.appendNumber(size.height()); 1623 } 1624 return result.toString(); 1625 #else 1626 return "FAIL: Cursor details not available on this platform."; 1627 #endif 1628 } 1629 1630 } -
trunk/Source/WebCore/testing/Internals.h
r134747 r134803 247 247 void stopTrackingRepaints(Document*, ExceptionCode&); 248 248 249 String getCurrentCursorInfo(Document*, ExceptionCode&); 250 249 251 private: 250 252 explicit Internals(Document*); -
trunk/Source/WebCore/testing/Internals.idl
r134747 r134803 215 215 void startTrackingRepaints(in Document document) raises (DOMException); 216 216 void stopTrackingRepaints(in Document document) raises (DOMException); 217 218 // Returns a string with information about the mouse cursor used at the specified client location. 219 DOMString getCurrentCursorInfo(in Document document) raises (DOMException); 217 220 }; -
trunk/Source/WebKit2/ChangeLog
r134801 r134803 1 2012-11-15 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 Brent Fulgham. 7 8 Add necessary exports for Internals::getCurrentCursorInfo 9 10 * win/WebKit2.def: 11 * win/WebKit2CFLite.def: 12 1 13 2012-11-15 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 14 -
trunk/Source/WebKit2/win/WebKit2.def
r134747 r134803 154 154 ??0ClientRectList@WebCore@@AAE@ABV?$Vector@VFloatQuad@WebCore@@$0A@@WTF@@@Z 155 155 ??1ClientRectList@WebCore@@QAE@XZ 156 ??1Cursor@WebCore@@QAE@XZ 157 ??0Cursor@WebCore@@QAE@ABV01@@Z 156 158 ??0String@WTF@@QAE@PBD@Z 157 159 ??0String@WTF@@QAE@PB_W@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r134747 r134803 147 147 ??0ClientRectList@WebCore@@AAE@ABV?$Vector@VFloatQuad@WebCore@@$0A@@WTF@@@Z 148 148 ??1ClientRectList@WebCore@@QAE@XZ 149 ??1Cursor@WebCore@@QAE@XZ 150 ??0Cursor@WebCore@@QAE@ABV01@@Z 149 151 ??0String@WTF@@QAE@PBD@Z 150 152 ??0String@WTF@@QAE@PB_W@Z -
trunk/Source/autotools/symbols.filter
r134744 r134803 164 164 _ZN7WebCore10ScrollView21setDelegatesScrollingEb; 165 165 _ZN7WebCore4Node14removedLastRefEv; 166 _ZN7WebCore6CursorC1ERKS0_; 167 _ZN7WebCore6CursorD1Ev; 166 168 _ZN7WebCore8Settings16setImagesEnabledEb; 167 169 _ZN7WebCore8Settings18setFixedFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
Note: See TracChangeset
for help on using the changeset viewer.