[webkit-reviews] review granted: [Bug 69963] InjectedBundleHitTestResult::imageRect() should return rect in WKView coordinates : [Attachment 111062] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 14 14:15:32 PDT 2011


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Jeff Miller
<jeffm at apple.com>'s request for review:
Bug 69963: InjectedBundleHitTestResult::imageRect() should return rect in
WKView coordinates
https://bugs.webkit.org/show_bug.cgi?id=69963

Attachment 111062: Patch
https://bugs.webkit.org/attachment.cgi?id=111062&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=111062&action=review


> Source/WebCore/platform/Widget.cpp:106
> +IntRect Widget::convertFromRootView(const IntRect& rootRect) const
> +{
> +    if (const ScrollView* parentScrollView = parent()) {
> +	   IntRect parentRect =
parentScrollView->convertFromRootView(rootRect);
> +	   return convertFromContainingView(parentRect);
> +    }
> +    return rootRect;
> +}
> +
> +IntRect Widget::convertToRootView(const IntRect& localRect) const
> +{
> +    if (const ScrollView* parentScrollView = parent()) {
> +	   IntRect parentRect = convertToContainingView(localRect);
> +	   return parentScrollView->convertToRootView(parentRect);
> +    }
> +    return localRect;
> +}
> +
> +IntPoint Widget::convertFromRootView(const IntPoint& rootPoint) const
> +{
> +    if (const ScrollView* parentScrollView = parent()) {
> +	   IntPoint parentPoint =
parentScrollView->convertFromRootView(rootPoint);
> +	   return convertFromContainingView(parentPoint);
> +    }
> +    return rootPoint;
> +}
> +
> +IntPoint Widget::convertToRootView(const IntPoint& localPoint) const
> +{
> +    if (const ScrollView* parentScrollView = parent()) {
> +	   IntPoint parentPoint = convertToContainingView(localPoint);
> +	   return parentScrollView->convertToRootView(parentPoint);
> +    }
> +    return localPoint;
> +}

How about calling these from the existing toWindow/fromWindow calls?


More information about the webkit-reviews mailing list