Index: Source/web/WebInputEventConversion.cpp |
diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp |
index 594cd407936036b1c5b21babba2071f132af06c8..a4a3afa831a8f3cc69bf6cb805cc64fcfe59a630 100644 |
--- a/Source/web/WebInputEventConversion.cpp |
+++ b/Source/web/WebInputEventConversion.cpp |
@@ -41,8 +41,8 @@ |
#include "core/frame/FrameHost.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/PinchViewport.h" |
+#include "core/layout/LayoutObject.h" |
#include "core/page/Page.h" |
-#include "core/rendering/RenderObject.h" |
#include "platform/KeyboardCodes.h" |
#include "platform/Widget.h" |
#include "public/platform/Platform.h" |
@@ -467,19 +467,19 @@ static int getWebInputModifiers(const UIEventWithKeyState& event) |
return modifiers; |
} |
-static FloatPoint convertAbsoluteLocationForRenderObjectFloat(const LayoutPoint& location, const RenderObject& renderObject) |
+static FloatPoint convertAbsoluteLocationForLayoutObjectFloat(const LayoutPoint& location, const LayoutObject& layoutObject) |
{ |
- return renderObject.absoluteToLocal(FloatPoint(location), UseTransforms); |
+ return layoutObject.absoluteToLocal(FloatPoint(location), UseTransforms); |
} |
-static IntPoint convertAbsoluteLocationForRenderObject(const LayoutPoint& location, const RenderObject& renderObject) |
+static IntPoint convertAbsoluteLocationForLayoutObject(const LayoutPoint& location, const LayoutObject& layoutObject) |
{ |
- return roundedIntPoint(convertAbsoluteLocationForRenderObjectFloat(location, renderObject)); |
+ return roundedIntPoint(convertAbsoluteLocationForLayoutObjectFloat(location, layoutObject)); |
} |
// FIXME: Change |widget| to const Widget& after RemoteFrames get |
// RemoteFrameViews. |
-static void updateWebMouseEventFromCoreMouseEvent(const MouseRelatedEvent& event, const Widget* widget, const RenderObject& renderObject, WebMouseEvent& webEvent) |
+static void updateWebMouseEventFromCoreMouseEvent(const MouseRelatedEvent& event, const Widget* widget, const LayoutObject& layoutObject, WebMouseEvent& webEvent) |
{ |
webEvent.timeStampSeconds = event.timeStamp() / millisPerSecond; |
webEvent.modifiers = getWebInputModifiers(event); |
@@ -492,12 +492,12 @@ static void updateWebMouseEventFromCoreMouseEvent(const MouseRelatedEvent& event |
webEvent.globalY = event.screenY(); |
webEvent.windowX = windowPoint.x(); |
webEvent.windowY = windowPoint.y(); |
- IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteLocation(), renderObject); |
+ IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteLocation(), layoutObject); |
webEvent.x = localPoint.x(); |
webEvent.y = localPoint.y(); |
} |
-WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const RenderObject* renderObject, const MouseEvent& event) |
+WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const LayoutObject* layoutObject, const MouseEvent& event) |
{ |
if (event.type() == EventTypeNames::mousemove) |
type = WebInputEvent::MouseMove; |
@@ -514,7 +514,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const RenderObj |
else |
return; // Skip all other mouse events. |
- updateWebMouseEventFromCoreMouseEvent(event, widget, *renderObject, *this); |
+ updateWebMouseEventFromCoreMouseEvent(event, widget, *layoutObject, *this); |
switch (event.button()) { |
case LeftButton: |
@@ -548,7 +548,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const RenderObj |
// Generate a synthetic WebMouseEvent given a TouchEvent (eg. for emulating a mouse |
// with touch input for plugins that don't support touch input). |
-WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const RenderObject* renderObject, const TouchEvent& event) |
+WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const LayoutObject* layoutObject, const TouchEvent& event) |
{ |
if (!event.touches()) |
return; |
@@ -588,7 +588,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const RenderObj |
modifiers |= WebInputEvent::LeftButtonDown; |
clickCount = (type == MouseDown || type == MouseUp); |
- IntPoint localPoint = convertAbsoluteLocationForRenderObject(touch->absoluteLocation(), *renderObject); |
+ IntPoint localPoint = convertAbsoluteLocationForLayoutObject(touch->absoluteLocation(), *layoutObject); |
x = localPoint.x(); |
y = localPoint.y(); |
} |
@@ -635,12 +635,12 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const PlatformM |
clickCount = event.clickCount(); |
} |
-WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const RenderObject* renderObject, const WheelEvent& event) |
+WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const LayoutObject* layoutObject, const WheelEvent& event) |
{ |
if (event.type() != EventTypeNames::wheel && event.type() != EventTypeNames::mousewheel) |
return; |
type = WebInputEvent::MouseWheel; |
- updateWebMouseEventFromCoreMouseEvent(event, widget, *renderObject, *this); |
+ updateWebMouseEventFromCoreMouseEvent(event, widget, *layoutObject, *this); |
deltaX = -event.deltaX(); |
deltaY = -event.deltaY(); |
wheelTicksX = event.ticksX(); |
@@ -721,12 +721,12 @@ WebKeyboardEventBuilder::WebKeyboardEventBuilder(const PlatformKeyboardEvent& ev |
memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(static_cast<unsigned>(keyIdentifierLengthCap), event.keyIdentifier().length())); |
} |
-static WebTouchPoint toWebTouchPoint(const Touch* touch, const RenderObject* renderObject, WebTouchPoint::State state) |
+static WebTouchPoint toWebTouchPoint(const Touch* touch, const LayoutObject* layoutObject, WebTouchPoint::State state) |
{ |
WebTouchPoint point; |
point.id = touch->identifier(); |
point.screenPosition = touch->screenLocation(); |
- point.position = convertAbsoluteLocationForRenderObjectFloat(touch->absoluteLocation(), *renderObject); |
+ point.position = convertAbsoluteLocationForLayoutObjectFloat(touch->absoluteLocation(), *layoutObject); |
point.radiusX = touch->radiusX(); |
point.radiusY = touch->radiusY(); |
point.rotationAngle = touch->webkitRotationAngle(); |
@@ -744,7 +744,7 @@ static bool hasTouchPointWithId(const WebTouchPoint* touchPoints, unsigned touch |
return false; |
} |
-static void addTouchPointsIfNotYetAdded(const Widget* widget, WebTouchPoint::State state, TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, const RenderObject* renderObject) |
+static void addTouchPointsIfNotYetAdded(const Widget* widget, WebTouchPoint::State state, TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, const LayoutObject* layoutObject) |
{ |
unsigned initialTouchPointsLength = *touchPointsLength; |
for (unsigned i = 0; i < touches->length(); ++i) { |
@@ -756,12 +756,12 @@ static void addTouchPointsIfNotYetAdded(const Widget* widget, WebTouchPoint::Sta |
if (hasTouchPointWithId(touchPoints, initialTouchPointsLength, touch->identifier())) |
continue; |
- touchPoints[pointIndex] = toWebTouchPoint(touch, renderObject, state); |
+ touchPoints[pointIndex] = toWebTouchPoint(touch, layoutObject, state); |
++(*touchPointsLength); |
} |
} |
-WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const RenderObject* renderObject, const TouchEvent& event) |
+WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const LayoutObject* layoutObject, const TouchEvent& event) |
{ |
if (event.type() == EventTypeNames::touchstart) |
type = TouchStart; |
@@ -781,11 +781,11 @@ WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const RenderObj |
timeStampSeconds = event.timeStamp() / millisPerSecond; |
cancelable = event.cancelable(); |
- addTouchPointsIfNotYetAdded(widget, toWebTouchPointState(event.type()), event.changedTouches(), touches, &touchesLength, renderObject); |
- addTouchPointsIfNotYetAdded(widget, WebTouchPoint::StateStationary, event.touches(), touches, &touchesLength, renderObject); |
+ addTouchPointsIfNotYetAdded(widget, toWebTouchPointState(event.type()), event.changedTouches(), touches, &touchesLength, layoutObject); |
+ addTouchPointsIfNotYetAdded(widget, WebTouchPoint::StateStationary, event.touches(), touches, &touchesLength, layoutObject); |
} |
-WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const RenderObject* renderObject, const GestureEvent& event) |
+WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const LayoutObject* layoutObject, const GestureEvent& event) |
{ |
if (event.type() == EventTypeNames::gestureshowpress) |
type = GestureShowPress; |
@@ -809,7 +809,7 @@ WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const Rende |
globalX = event.screenX(); |
globalY = event.screenY(); |
- IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteLocation(), *renderObject); |
+ IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteLocation(), *layoutObject); |
x = localPoint.x(); |
y = localPoint.y(); |
} |