Changeset 93053 in webkit


Ignore:
Timestamp:
Aug 15, 2011 12:31:06 PM (13 years ago)
Author:
eae@chromium.org
Message:

Switch mouse events to to new layout types
https://bugs.webkit.org/show_bug.cgi?id=66179

Reviewed by Eric Seidel.

Convert mouse events to new layout abstraction as a part of the ongoing
conversion work.

No new tests, no new functionality.

  • dom/MouseRelatedEvent.cpp:

(WebCore::contentsScrollOffset):
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
(WebCore::MouseRelatedEvent::initCoordinates):
(WebCore::MouseRelatedEvent::computePageLocation):
(WebCore::MouseRelatedEvent::computeRelativePosition):
(WebCore::MouseRelatedEvent::pageLocation):

  • dom/MouseRelatedEvent.h:

(WebCore::MouseRelatedEvent::screenLocation):
(WebCore::MouseRelatedEvent::clientLocation):
(WebCore::MouseRelatedEvent::absoluteLocation):
(WebCore::MouseRelatedEvent::setAbsoluteLocation):

  • page/EventHandler.cpp:

(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::selectionExtentRespectingEditingBoundary):
(WebCore::EventHandler::hitTestResultAtPoint):
(WebCore::EventHandler::currentMousePosition):
(WebCore::documentPointForWindowPoint):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::fakeMouseMoveEventTimerFired):
(WebCore::EventHandler::dragHysteresisExceeded):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::handleTouchEvent):

  • page/EventHandler.h:
  • platform/PlatformMouseEvent.h:

(WebCore::PlatformMouseEvent::PlatformMouseEvent):
(WebCore::PlatformMouseEvent::pos):
(WebCore::PlatformMouseEvent::x):
(WebCore::PlatformMouseEvent::y):
(WebCore::PlatformMouseEvent::globalX):
(WebCore::PlatformMouseEvent::globalY):

  • platform/mac/PlatformMouseEventMac.mm:

(WebCore::globalPoint):
(WebCore::pointForEvent):
(WebCore::globalPointForEvent):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r93051 r93053  
     12011-08-15  Emil A Eklund  <eae@chromium.org>
     2
     3        Switch mouse events to to new layout types
     4        https://bugs.webkit.org/show_bug.cgi?id=66179
     5
     6        Reviewed by Eric Seidel.
     7
     8        Convert mouse events to new layout abstraction as a part of the ongoing
     9        conversion work.
     10
     11        No new tests, no new functionality.
     12
     13        * dom/MouseRelatedEvent.cpp:
     14        (WebCore::contentsScrollOffset):
     15        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
     16        (WebCore::MouseRelatedEvent::initCoordinates):
     17        (WebCore::MouseRelatedEvent::computePageLocation):
     18        (WebCore::MouseRelatedEvent::computeRelativePosition):
     19        (WebCore::MouseRelatedEvent::pageLocation):
     20        * dom/MouseRelatedEvent.h:
     21        (WebCore::MouseRelatedEvent::screenLocation):
     22        (WebCore::MouseRelatedEvent::clientLocation):
     23        (WebCore::MouseRelatedEvent::absoluteLocation):
     24        (WebCore::MouseRelatedEvent::setAbsoluteLocation):
     25        * page/EventHandler.cpp:
     26        (WebCore::EventHandler::clear):
     27        (WebCore::EventHandler::handleMousePressEventSingleClick):
     28        (WebCore::selectionExtentRespectingEditingBoundary):
     29        (WebCore::EventHandler::hitTestResultAtPoint):
     30        (WebCore::EventHandler::currentMousePosition):
     31        (WebCore::documentPointForWindowPoint):
     32        (WebCore::EventHandler::handleMousePressEvent):
     33        (WebCore::EventHandler::mouseMoved):
     34        (WebCore::EventHandler::handleWheelEvent):
     35        (WebCore::EventHandler::sendContextMenuEvent):
     36        (WebCore::EventHandler::sendContextMenuEventForKey):
     37        (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
     38        (WebCore::EventHandler::dragHysteresisExceeded):
     39        (WebCore::EventHandler::handleDrag):
     40        (WebCore::EventHandler::handleTouchEvent):
     41        * page/EventHandler.h:
     42        * platform/PlatformMouseEvent.h:
     43        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
     44        (WebCore::PlatformMouseEvent::pos):
     45        (WebCore::PlatformMouseEvent::x):
     46        (WebCore::PlatformMouseEvent::y):
     47        (WebCore::PlatformMouseEvent::globalX):
     48        (WebCore::PlatformMouseEvent::globalY):
     49        * platform/mac/PlatformMouseEventMac.mm:
     50        (WebCore::globalPoint):
     51        (WebCore::pointForEvent):
     52        (WebCore::globalPointForEvent):
     53
    1542011-08-15  Ryosuke Niwa  <rniwa@webkit.org>
    255
  • trunk/Source/WebCore/dom/MouseRelatedEvent.cpp

    r87865 r93053  
    3939}
    4040
    41 static IntSize contentsScrollOffset(AbstractView* abstractView)
     41static LayoutSize contentsScrollOffset(AbstractView* abstractView)
    4242{
    4343    if (!abstractView)
    44         return IntSize();
     44        return LayoutSize();
    4545    Frame* frame = abstractView->frame();
    4646    if (!frame)
    47         return IntSize();
     47        return LayoutSize();
    4848    FrameView* frameView = frame->view();
    4949    if (!frameView)
    50         return IntSize();
    51     return IntSize(frameView->scrollX() / frame->pageZoomFactor(),
     50        return LayoutSize();
     51    return LayoutSize(frameView->scrollX() / frame->pageZoomFactor(),
    5252        frameView->scrollY() / frame->pageZoomFactor());
    5353}
    5454
    5555MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, PassRefPtr<AbstractView> abstractView,
    56                                      int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
     56                                     int detail, const LayoutPoint& screenLocation, const LayoutPoint& windowLocation,
    5757                                     bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated)
    5858    : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail, ctrlKey, altKey, shiftKey, metaKey)
     
    6060    , m_isSimulated(isSimulated)
    6161{
    62     IntPoint adjustedPageLocation;
    63     IntPoint scrollPosition;
     62    LayoutPoint adjustedPageLocation;
     63    LayoutPoint scrollPosition;
    6464
    6565    Frame* frame = view() ? view()->frame() : 0;
     
    7474
    7575                // FIXME: Change this to use float math and proper rounding (or
    76                 // better yet, use IntPoint::scale).
     76                // better yet, use LayoutPoint::scale).
    7777                scrollPosition.setX(scrollPosition.x() / pageZoom);
    7878                scrollPosition.setY(scrollPosition.y() / pageZoom);
     
    9898}
    9999
    100 void MouseRelatedEvent::initCoordinates(const IntPoint& clientLocation)
     100void MouseRelatedEvent::initCoordinates(const LayoutPoint& clientLocation)
    101101{
    102102    // Set up initial values for coordinates.
     
    126126{
    127127    float zoomFactor = pageZoomFactor(this);
    128     setAbsoluteLocation(roundedIntPoint(FloatPoint(pageX() * zoomFactor, pageY() * zoomFactor)));
     128    setAbsoluteLocation(roundedLayoutPoint(FloatPoint(pageX() * zoomFactor, pageY() * zoomFactor)));
    129129}
    130130
     
    151151        if (RenderObject* r = targetNode->renderer()) {
    152152            FloatPoint localPos = r->absoluteToLocal(absoluteLocation(), false, true);
    153             m_offsetLocation = roundedIntPoint(localPos);
     153            m_offsetLocation = roundedLayoutPoint(localPos);
    154154            float scaleFactor = 1 / pageZoomFactor(this);
    155155            if (scaleFactor != 1.0f)
     
    216216}
    217217
    218 const IntPoint& MouseRelatedEvent::pageLocation() const
     218const LayoutPoint& MouseRelatedEvent::pageLocation() const
    219219{
    220220    return m_pageLocation;
  • trunk/Source/WebCore/dom/MouseRelatedEvent.h

    r87865 r93053  
    2525#define MouseRelatedEvent_h
    2626
    27 #include "IntPoint.h"
     27#include "LayoutTypes.h"
    2828#include "UIEventWithKeyState.h"
    2929
     
    3737        int screenX() const { return m_screenLocation.x(); }
    3838        int screenY() const { return m_screenLocation.y(); }
    39         const IntPoint& screenLocation() const { return m_screenLocation; }
     39        const LayoutPoint& screenLocation() const { return m_screenLocation; }
    4040        int clientX() const { return m_clientLocation.x(); }
    4141        int clientY() const { return m_clientLocation.y(); }
    42         const IntPoint& clientLocation() const { return m_clientLocation; }
     42        const LayoutPoint& clientLocation() const { return m_clientLocation; }
    4343        int layerX();
    4444        int layerY();
     
    4848        virtual int pageX() const;
    4949        virtual int pageY() const;
    50         virtual const IntPoint& pageLocation() const;
     50        virtual const LayoutPoint& pageLocation() const;
    5151        int x() const;
    5252        int y() const;
     
    5454        // Page point in "absolute" coordinates (i.e. post-zoomed, page-relative coords,
    5555        // usable with RenderObject::absoluteToLocal).
    56         const IntPoint& absoluteLocation() const { return m_absoluteLocation; }
    57         void setAbsoluteLocation(const IntPoint& p) { m_absoluteLocation = p; }
     56        const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }
     57        void setAbsoluteLocation(const LayoutPoint& p) { m_absoluteLocation = p; }
    5858   
    5959    protected:
    6060        MouseRelatedEvent();
    6161        MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>,
    62                           int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
     62                          int detail, const LayoutPoint& screenLocation, const LayoutPoint& windowLocation,
    6363                          bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false);
    6464
    6565        void initCoordinates();
    66         void initCoordinates(const IntPoint& clientLocation);
     66        void initCoordinates(const LayoutPoint& clientLocation);
    6767        virtual void receivedTarget();
    6868
     
    7171       
    7272        // Expose these so MouseEvent::initMouseEvent can set them.
    73         IntPoint m_screenLocation;
    74         IntPoint m_clientLocation;
     73        LayoutPoint m_screenLocation;
     74        LayoutPoint m_clientLocation;
    7575
    7676    private:
    77         IntPoint m_pageLocation;
    78         IntPoint m_layerLocation;
    79         IntPoint m_offsetLocation;
    80         IntPoint m_absoluteLocation;
     77        LayoutPoint m_pageLocation;
     78        LayoutPoint m_layerLocation;
     79        LayoutPoint m_offsetLocation;
     80        LayoutPoint m_absoluteLocation;
    8181        bool m_isSimulated;
    8282        bool m_hasCachedRelativePosition;
  • trunk/Source/WebCore/page/EventHandler.cpp

    r92234 r93053  
    243243    m_shouldOnlyFireDragOverEvent = false;
    244244#endif
    245     m_currentMousePosition = IntPoint();
     245    m_currentMousePosition = LayoutPoint();
    246246    m_mousePressNode = 0;
    247247    m_mousePressed = false;
     
    397397    // existing selection so we can allow for text dragging.
    398398    if (FrameView* view = m_frame->view()) {
    399         IntPoint vPoint = view->windowToContents(event.event().pos());
     399        LayoutPoint vPoint = view->windowToContents(event.event().pos());
    400400        if (!extendSelection && m_frame->selection()->contains(vPoint)) {
    401401            m_mouseDownWasSingleClickInSelection = true;
     
    641641}
    642642
    643 static VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const IntPoint& localPoint, Node* targetNode)
    644 {
    645     IntPoint selectionEndPoint = localPoint;
     643static VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const LayoutPoint& localPoint, Node* targetNode)
     644{
     645    LayoutPoint selectionEndPoint = localPoint;
    646646    Element* editableElement = selection.rootEditableElement();
    647647
     
    654654
    655655        FloatPoint absolutePoint = targetNode->renderer()->localToAbsolute(FloatPoint(selectionEndPoint));
    656         selectionEndPoint = roundedIntPoint(editableElement->renderer()->absoluteToLocal(absolutePoint));
     656        selectionEndPoint = roundedLayoutPoint(editableElement->renderer()->absoluteToLocal(absolutePoint));
    657657        targetNode = editableElement;
    658658    }
     
    923923#endif // ENABLE(DRAG_SUPPORT)
    924924   
    925 HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType, const IntSize& padding)
     925HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding)
    926926{
    927927    HitTestResult result(point, padding.height(), padding.width(), padding.height(), padding.width());
     
    944944            break;
    945945        FrameView* view = static_cast<FrameView*>(widget);
    946         IntPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(),
     946        LayoutPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(),
    947947            result.localPoint().y() + view->scrollY() - renderWidget->borderTop() - renderWidget->paddingTop());
    948948        HitTestResult widgetHitTestResult(widgetPoint, padding.height(), padding.width(), padding.height(), padding.width());
     
    966966            FrameView* mainView = mainFrame->view();
    967967            if (resultView && mainView) {
    968                 IntPoint windowPoint = resultView->contentsToWindow(result.point());
    969                 IntPoint mainFramePoint = mainView->windowToContents(windowPoint);
     968                LayoutPoint windowPoint = resultView->contentsToWindow(result.point());
     969                LayoutPoint mainFramePoint = mainView->windowToContents(windowPoint);
    970970                result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, allowShadowContent, ignoreClipping, testScrollbars, hitType, padding);
    971971            }
     
    11231123}
    11241124
    1125 IntPoint EventHandler::currentMousePosition() const
     1125LayoutPoint EventHandler::currentMousePosition() const
    11261126{
    11271127    return m_currentMousePosition;
     
    13191319}
    13201320   
    1321 static IntPoint documentPointForWindowPoint(Frame* frame, const IntPoint& windowPoint)
     1321static LayoutPoint documentPointForWindowPoint(Frame* frame, const LayoutPoint& windowPoint)
    13221322{
    13231323    FrameView* view = frame->view();
     
    13751375    // Save the document point we generate in case the window coordinate is invalidated by what happens
    13761376    // when we dispatch the event.
    1377     IntPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.pos());
     1377    LayoutPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.pos());
    13781378    MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
    13791379
     
    14221422    if (FrameView* view = m_frame->view()) {
    14231423        RenderLayer* layer = m_clickNode->renderer() ? m_clickNode->renderer()->enclosingLayer() : 0;
    1424         IntPoint p = view->windowToContents(mouseEvent.pos());
     1424        LayoutPoint p = view->windowToContents(mouseEvent.pos());
    14251425        if (layer && layer->isPointInResizeControl(p)) {
    14261426            layer->setInResizeMode(true);
     
    15331533bool EventHandler::mouseMoved(const PlatformMouseEvent& event)
    15341534{
    1535     HitTestResult hoveredNode = HitTestResult(IntPoint());
     1535    HitTestResult hoveredNode = HitTestResult(LayoutPoint());
    15361536    bool result = handleMouseMoveEvent(event, &hoveredNode);
    15371537
     
    21292129        return false;
    21302130    setFrameWasScrolledByUser();
    2131     IntPoint vPoint = view->windowToContents(e.pos());
     2131    LayoutPoint vPoint = view->windowToContents(e.pos());
    21322132
    21332133    Node* node;
     
    22612261   
    22622262    bool swallowEvent;
    2263     IntPoint viewportPos = v->windowToContents(event.pos());
     2263    LayoutPoint viewportPos = v->windowToContents(event.pos());
    22642264    HitTestRequest request(HitTestRequest::Active);
    22652265    MouseEventWithHitTestResults mev = doc->prepareMouseEvent(request, viewportPos, event);
     
    22972297    int rightAligned = 0;
    22982298#endif
    2299     IntPoint location;
     2299    LayoutPoint location;
    23002300
    23012301    Node* focusedNode = doc->focusedNode();
     
    23052305    if (start.deprecatedNode() && (selection->rootEditableElement() || selection->isRange())) {
    23062306        RefPtr<Range> selectionRange = selection->toNormalizedRange();
    2307         IntRect firstRect = m_frame->editor()->firstRectForRange(selectionRange.get());
    2308 
    2309         int x = rightAligned ? firstRect.maxX() : firstRect.x();
    2310         location = IntPoint(x, firstRect.maxY());
     2307        LayoutRect firstRect = m_frame->editor()->firstRectForRange(selectionRange.get());
     2308
     2309        LayoutUnit x = rightAligned ? firstRect.maxX() : firstRect.x();
     2310        location = LayoutPoint(x, firstRect.maxY());
    23112311    } else if (focusedNode) {
    23122312        RenderBoxModelObject* box = focusedNode->renderBoxModelObject();
    23132313        if (!box)
    23142314            return false;
    2315         IntRect clippedRect = box->absoluteClippedOverflowRect();
    2316         location = IntPoint(clippedRect.x(), clippedRect.maxY() - 1);
     2315        LayoutRect clippedRect = box->absoluteClippedOverflowRect();
     2316        location = LayoutPoint(clippedRect.x(), clippedRect.maxY() - 1);
    23172317    } else {
    2318         location = IntPoint(
     2318        location = LayoutPoint(
    23192319            rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin,
    23202320            kContextMenuMargin);
     
    23232323    m_frame->view()->setCursor(pointerCursor());
    23242324
    2325     IntPoint position = view->contentsToWindow(location);
    2326     IntPoint globalPosition = view->contentsToScreen(IntRect(location, IntSize())).location();
     2325    LayoutPoint position = view->contentsToWindow(location);
     2326    LayoutPoint globalPosition = view->contentsToScreen(LayoutRect(location, LayoutSize())).location();
    23272327
    23282328    Node* targetNode = doc->focusedNode();
     
    24002400    bool metaKey;
    24012401    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
    2402     IntPoint globalPoint = view->contentsToScreen(IntRect(view->windowToContents(m_currentMousePosition), IntSize())).location();
     2402    LayoutPoint globalPoint = view->contentsToScreen(LayoutRect(view->windowToContents(m_currentMousePosition), LayoutSize())).location();
    24032403    PlatformMouseEvent fakeMouseMoveEvent(m_currentMousePosition, globalPoint, NoButton, MouseEventMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime());
    24042404    mouseMoved(fakeMouseMoveEvent);
     
    26982698
    26992699#if ENABLE(DRAG_SUPPORT)
    2700 bool EventHandler::dragHysteresisExceeded(const FloatPoint& floatDragViewportLocation) const
    2701 {
    2702     IntPoint dragViewportLocation((int)floatDragViewportLocation.x(), (int)floatDragViewportLocation.y());
     2700bool EventHandler::dragHysteresisExceeded(const IntPoint& floatDragViewportLocation) const
     2701{
     2702    FloatPoint dragViewportLocation(floatDragViewportLocation.x(), floatDragViewportLocation.y());
    27032703    return dragHysteresisExceeded(dragViewportLocation);
    27042704}
    2705    
    2706 bool EventHandler::dragHysteresisExceeded(const IntPoint& dragViewportLocation) const
     2705
     2706bool EventHandler::dragHysteresisExceeded(const FloatPoint& dragViewportLocation) const
    27072707{
    27082708    FrameView* view = m_frame->view();
    27092709    if (!view)
    27102710        return false;
    2711     IntPoint dragLocation = view->windowToContents(dragViewportLocation);
    2712     IntSize delta = dragLocation - m_mouseDownPos;
     2711    LayoutPoint dragLocation = view->windowToContents(flooredLayoutPoint(dragViewportLocation));
     2712    LayoutSize delta = dragLocation - m_mouseDownPos;
    27132713   
    27142714    int threshold = GeneralDragHysteresis;
     
    28622862                // FIXME: This doesn't work correctly with transforms.
    28632863                FloatPoint absPos = renderer->localToAbsolute();
    2864                 IntSize delta = m_mouseDownPos - roundedIntPoint(absPos);
     2864                LayoutSize delta = m_mouseDownPos - roundedLayoutPoint(absPos);
    28652865                dragState().m_dragClipboard->setDragImageElement(dragState().m_dragSrc.get(), toPoint(delta));
    28662866            } else {
     
    31803180        const PlatformTouchPoint& point = points[i];
    31813181        PlatformTouchPoint::State pointState = point.state();
    3182         IntPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
     3182        LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
    31833183
    31843184        HitTestRequest::HitTestRequestType hitType = HitTestRequest::Active | HitTestRequest::ReadOnly;
  • trunk/Source/WebCore/page/EventHandler.h

    r92234 r93053  
    115115    void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
    116116
    117     HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false,
     117    HitTestResult hitTestResultAtPoint(const LayoutPoint&, bool allowShadowContent, bool ignoreClipping = false,
    118118                                       HitTestScrollbars scrollbars = DontHitTestScrollbars,
    119119                                       HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
    120                                        const IntSize& padding = IntSize());
     120                                       const LayoutSize& padding = LayoutSize());
    121121
    122122    bool mousePressed() const { return m_mousePressed; }
     
    137137    void resizeLayerDestroyed();
    138138
    139     IntPoint currentMousePosition() const;
     139    LayoutPoint currentMousePosition() const;
    140140
    141141    static Frame* subframeForTargetNode(Node*);
     
    354354
    355355#if ENABLE(DRAG_SUPPORT)
    356     IntPoint m_dragStartPos;
     356    LayoutPoint m_dragStartPos;
    357357#endif
    358358
     
    399399    RefPtr<HTMLFrameSetElement> m_frameSetBeingResized;
    400400
    401     IntSize m_offsetFromResizeCorner;   // in the coords of m_resizeLayer
    402    
    403     IntPoint m_currentMousePosition;
    404     IntPoint m_mouseDownPos; // in our view's coords
     401    LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeLayer.
     402   
     403    LayoutPoint m_currentMousePosition;
     404    LayoutPoint m_mouseDownPos; // In our view's coords.
    405405    double m_mouseDownTimestamp;
    406406    PlatformMouseEvent m_mouseDown;
  • trunk/Source/WebCore/platform/PlatformMouseEvent.h

    r75040 r93053  
    2727#define PlatformMouseEvent_h
    2828
    29 #include "IntPoint.h"
     29#include "LayoutTypes.h"
    3030
    3131#if PLATFORM(GTK)
     
    9494        }
    9595
    96         PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, MouseEventType eventType,
     96        PlatformMouseEvent(const LayoutPoint& position, const LayoutPoint& globalPosition, MouseButton button, MouseEventType eventType,
    9797                           int clickCount, bool shift, bool ctrl, bool alt, bool meta, double timestamp)
    9898            : m_position(position)
     
    115115        }
    116116
    117         const IntPoint& pos() const { return m_position; }
    118         int x() const { return m_position.x(); }
    119         int y() const { return m_position.y(); }
    120         int globalX() const { return m_globalPosition.x(); }
    121         int globalY() const { return m_globalPosition.y(); }
     117        const LayoutPoint& pos() const { return m_position; }
     118        LayoutUnit x() const { return m_position.x(); }
     119        LayoutUnit y() const { return m_position.y(); }
     120        LayoutUnit globalX() const { return m_globalPosition.x(); }
     121        LayoutUnit globalY() const { return m_globalPosition.y(); }
    122122        MouseButton button() const { return m_button; }
    123123        MouseEventType eventType() const { return m_eventType; }
     
    179179
    180180    protected:
    181         IntPoint m_position;
    182         IntPoint m_globalPosition;
     181        LayoutPoint m_position;
     182        LayoutPoint m_globalPosition;
    183183        MouseButton m_button;
    184184        MouseEventType m_eventType;
     
    199199
    200200#if PLATFORM(MAC) && defined(__OBJC__)
    201     IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *);
    202     IntPoint pointForEvent(NSEvent *, NSView *windowView);
    203     IntPoint globalPointForEvent(NSEvent *);
     201    LayoutPoint globalPoint(const NSPoint& windowPoint, NSWindow *);
     202    LayoutPoint pointForEvent(NSEvent *, NSView *windowView);
     203    LayoutPoint globalPointForEvent(NSEvent *);
    204204#endif
    205205
  • trunk/Source/WebCore/platform/mac/PlatformMouseEventMac.mm

    r52063 r93053  
    6969}
    7070
    71 IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *window)
     71LayoutPoint globalPoint(const NSPoint& windowPoint, NSWindow *window)
    7272{
    73     return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint], screenForWindow(window)));
     73    return LayoutPoint(flipScreenPoint([window convertBaseToScreen:windowPoint], screenForWindow(window)));
    7474}
    7575
    76 IntPoint pointForEvent(NSEvent *event, NSView *windowView)
     76LayoutPoint pointForEvent(NSEvent *event, NSView *windowView)
    7777{
    7878    switch ([event type]) {
     
    9393            if (windowView)
    9494                location = [windowView convertPoint:location fromView:nil];
    95             return IntPoint(location);
     95            return LayoutPoint(location);
    9696        }
    9797        default:
    98             return IntPoint();
     98            return LayoutPoint();
    9999    }
    100100}
    101101
    102 IntPoint globalPointForEvent(NSEvent *event)
     102LayoutPoint globalPointForEvent(NSEvent *event)
    103103{
    104104    switch ([event type]) {
     
    116116            return globalPoint([event locationInWindow], [event window]);
    117117        default:
    118             return IntPoint();
     118            return LayoutPoint();
    119119    }
    120120}
Note: See TracChangeset for help on using the changeset viewer.