| Index: third_party/WebKit/Source/platform/Widget.cpp
|
| diff --git a/third_party/WebKit/Source/platform/Widget.cpp b/third_party/WebKit/Source/platform/Widget.cpp
|
| index 186e3d0d688185d724d57290c502571f061574b8..b2f9160f5b51893476552c9b31416dc9fdc713f5 100644
|
| --- a/third_party/WebKit/Source/platform/Widget.cpp
|
| +++ b/third_party/WebKit/Source/platform/Widget.cpp
|
| @@ -70,62 +70,62 @@ Widget* Widget::root() const
|
| return 0;
|
| }
|
|
|
| -IntRect Widget::convertFromContainingWindow(const IntRect& windowRect) const
|
| +IntRect Widget::convertFromRootFrame(const IntRect& rectInRootFrame) const
|
| {
|
| if (const Widget* parentWidget = parent()) {
|
| - IntRect parentRect = parentWidget->convertFromContainingWindow(windowRect);
|
| - return convertFromContainingView(parentRect);
|
| + IntRect parentRect = parentWidget->convertFromRootFrame(rectInRootFrame);
|
| + return convertFromContainingWidget(parentRect);
|
| }
|
| - return windowRect;
|
| + return rectInRootFrame;
|
| }
|
|
|
| -IntRect Widget::convertToContainingWindow(const IntRect& localRect) const
|
| +IntRect Widget::convertToRootFrame(const IntRect& localRect) const
|
| {
|
| if (const Widget* parentWidget = parent()) {
|
| - IntRect parentRect = convertToContainingView(localRect);
|
| - return parentWidget->convertToContainingWindow(parentRect);
|
| + IntRect parentRect = convertToContainingWidget(localRect);
|
| + return parentWidget->convertToRootFrame(parentRect);
|
| }
|
| return localRect;
|
| }
|
|
|
| -IntPoint Widget::convertFromContainingWindow(const IntPoint& windowPoint) const
|
| +IntPoint Widget::convertFromRootFrame(const IntPoint& pointInRootFrame) const
|
| {
|
| if (const Widget* parentWidget = parent()) {
|
| - IntPoint parentPoint = parentWidget->convertFromContainingWindow(windowPoint);
|
| - return convertFromContainingView(parentPoint);
|
| + IntPoint parentPoint = parentWidget->convertFromRootFrame(pointInRootFrame);
|
| + return convertFromContainingWidget(parentPoint);
|
| }
|
| - return windowPoint;
|
| + return pointInRootFrame;
|
| }
|
|
|
| -FloatPoint Widget::convertFromContainingWindow(const FloatPoint& windowPoint) const
|
| +FloatPoint Widget::convertFromRootFrame(const FloatPoint& pointInRootFrame) const
|
| {
|
| // Widgets / windows are required to be IntPoint aligned, but we may need to convert
|
| // FloatPoint values within them (eg. for event co-ordinates).
|
| - IntPoint flooredPoint = flooredIntPoint(windowPoint);
|
| - FloatPoint parentPoint = this->convertFromContainingWindow(flooredPoint);
|
| - FloatSize windowFraction = windowPoint - flooredPoint;
|
| + IntPoint flooredPoint = flooredIntPoint(pointInRootFrame);
|
| + FloatPoint parentPoint = this->convertFromRootFrame(flooredPoint);
|
| + FloatSize windowFraction = pointInRootFrame - flooredPoint;
|
| // Use linear interpolation handle any fractional value (eg. for iframes subject to a transform
|
| // beyond just a simple translation).
|
| // FIXME: Add FloatPoint variants of all co-ordinate space conversion APIs.
|
| if (!windowFraction.isEmpty()) {
|
| const int kFactor = 1000;
|
| - IntPoint parentLineEnd = this->convertFromContainingWindow(flooredPoint + roundedIntSize(windowFraction.scaledBy(kFactor)));
|
| + IntPoint parentLineEnd = this->convertFromRootFrame(flooredPoint + roundedIntSize(windowFraction.scaledBy(kFactor)));
|
| FloatSize parentFraction = (parentLineEnd - parentPoint).scaledBy(1.0f / kFactor);
|
| parentPoint.move(parentFraction);
|
| }
|
| return parentPoint;
|
| }
|
|
|
| -IntPoint Widget::convertToContainingWindow(const IntPoint& localPoint) const
|
| +IntPoint Widget::convertToRootFrame(const IntPoint& localPoint) const
|
| {
|
| if (const Widget* parentWidget = parent()) {
|
| - IntPoint parentPoint = convertToContainingView(localPoint);
|
| - return parentWidget->convertToContainingWindow(parentPoint);
|
| + IntPoint parentPoint = convertToContainingWidget(localPoint);
|
| + return parentWidget->convertToRootFrame(parentPoint);
|
| }
|
| return localPoint;
|
| }
|
|
|
| -IntRect Widget::convertToContainingView(const IntRect& localRect) const
|
| +IntRect Widget::convertToContainingWidget(const IntRect& localRect) const
|
| {
|
| if (const Widget* parentWidget = parent()) {
|
| IntRect parentRect(localRect);
|
| @@ -135,7 +135,7 @@ IntRect Widget::convertToContainingView(const IntRect& localRect) const
|
| return localRect;
|
| }
|
|
|
| -IntRect Widget::convertFromContainingView(const IntRect& parentRect) const
|
| +IntRect Widget::convertFromContainingWidget(const IntRect& parentRect) const
|
| {
|
| if (const Widget* parentWidget = parent()) {
|
| IntRect localRect = parentRect;
|
| @@ -146,7 +146,7 @@ IntRect Widget::convertFromContainingView(const IntRect& parentRect) const
|
| return parentRect;
|
| }
|
|
|
| -IntPoint Widget::convertToContainingView(const IntPoint& localPoint) const
|
| +IntPoint Widget::convertToContainingWidget(const IntPoint& localPoint) const
|
| {
|
| if (const Widget* parentWidget = parent())
|
| return parentWidget->convertChildToSelf(this, localPoint);
|
| @@ -154,7 +154,7 @@ IntPoint Widget::convertToContainingView(const IntPoint& localPoint) const
|
| return localPoint;
|
| }
|
|
|
| -IntPoint Widget::convertFromContainingView(const IntPoint& parentPoint) const
|
| +IntPoint Widget::convertFromContainingWidget(const IntPoint& parentPoint) const
|
| {
|
| if (const Widget* parentWidget = parent())
|
| return parentWidget->convertSelfToChild(this, parentPoint);
|
|
|