Bug 114146

Summary: [BlackBerry] Replace getRect() with boundingBox()
Product: WebKit Reporter: Alberto Garcia <berto>
Component: WebKit BlackBerryAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: cgarcia, mifenton, rwlbuis, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 111729    
Attachments:
Description Flags
Patch xan.lopez: review-, xan.lopez: commit-queue-

Alberto Garcia
Reported 2013-04-08 00:14:59 PDT
Attachments
Patch (2.69 KB, patch)
2013-04-08 00:16 PDT, Alberto Garcia
xan.lopez: review-
xan.lopez: commit-queue-
Alberto Garcia
Comment 1 2013-04-08 00:16:16 PDT
Carlos Garcia Campos
Comment 2 2013-04-08 00:44:09 PDT
Comment on attachment 196833 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196833&action=review > Source/WebKit/blackberry/Api/WebPage.cpp:2601 > - return view->contentsToWindow(node->getRect()); > + return view->contentsToWindow(IntRect(node->boundingBox())); Why do you need the IntRect()?
Alberto Garcia
Comment 3 2013-04-08 00:49:50 PDT
(In reply to comment #2) > > Source/WebKit/blackberry/Api/WebPage.cpp:2601 > > - return view->contentsToWindow(node->getRect()); > > + return view->contentsToWindow(IntRect(node->boundingBox())); > > Why do you need the IntRect()? Node::boundingBox() returns LayoutRect.
Carlos Garcia Campos
Comment 4 2013-04-08 00:54:06 PDT
(In reply to comment #3) > (In reply to comment #2) > > > Source/WebKit/blackberry/Api/WebPage.cpp:2601 > > > - return view->contentsToWindow(node->getRect()); > > > + return view->contentsToWindow(IntRect(node->boundingBox())); > > > > Why do you need the IntRect()? > > Node::boundingBox() returns LayoutRect. I think there's an explicit constructor for that, note that getRect() also returned a LayoutRect.
Alberto Garcia
Comment 5 2013-04-08 01:01:11 PDT
(In reply to comment #4) > > > Why do you need the IntRect()? > > > > Node::boundingBox() returns LayoutRect. > > I think there's an explicit constructor for that Exactly, _explicit_, that's why there's no implicit conversion here: Source/WebKit/blackberry/Api/WebPage.cpp:2611:62: error: no matching function for call to 'WebCore::FrameView::contentsToWindow(WebCore::LayoutRect)' Source/WebKit/blackberry/Api/WebPage.cpp:2611:62: note: candidates are: Source/WebCore/platform/ScrollView.h:231:14: note: WebCore::IntPoint WebCore::ScrollView::contentsToWindow(const WebCore::IntPoint&) const Source/WebCore/platform/ScrollView.h:231:14: note: no known conversion for argument 1 from 'WebCore::LayoutRect' to 'const WebCore::IntPoint&' Source/WebCore/platform/ScrollView.h:233:13: note: WebCore::IntRect WebCore::ScrollView::contentsToWindow(const WebCore::IntRect&) const Source/WebCore/platform/ScrollView.h:233:13: note: no known conversion for argument 1 from 'WebCore::LayoutRect' to 'const WebCore::IntRect&' > note that getRect() also returned a LayoutRect. Well, the code was not compiling before either, but I guess it doesn't make sense to split this change in two :)
Carlos Garcia Campos
Comment 6 2013-04-08 01:08:14 PDT
(In reply to comment #5) > (In reply to comment #4) > > > > Why do you need the IntRect()? > > > > > > Node::boundingBox() returns LayoutRect. > > > > I think there's an explicit constructor for that > > Exactly, _explicit_, that's why there's no implicit conversion here: > > Source/WebKit/blackberry/Api/WebPage.cpp:2611:62: error: no matching function for call to 'WebCore::FrameView::contentsToWindow(WebCore::LayoutRect)' > Source/WebKit/blackberry/Api/WebPage.cpp:2611:62: note: candidates are: > Source/WebCore/platform/ScrollView.h:231:14: note: WebCore::IntPoint WebCore::ScrollView::contentsToWindow(const WebCore::IntPoint&) const > Source/WebCore/platform/ScrollView.h:231:14: note: no known conversion for argument 1 from 'WebCore::LayoutRect' to 'const WebCore::IntPoint&' > Source/WebCore/platform/ScrollView.h:233:13: note: WebCore::IntRect WebCore::ScrollView::contentsToWindow(const WebCore::IntRect&) const > Source/WebCore/platform/ScrollView.h:233:13: note: no known conversion for argument 1 from 'WebCore::LayoutRect' to 'const WebCore::IntRect&' > > > note that getRect() also returned a LayoutRect. > > Well, the code was not compiling before either, but I guess it doesn't > make sense to split this change in two :) No, it's just that I was assuming the code compiled before :-)
Carlos Garcia Campos
Comment 7 2013-04-08 01:25:31 PDT
Comment on attachment 196833 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196833&action=review >> Source/WebKit/blackberry/Api/WebPage.cpp:2601 >> + return view->contentsToWindow(IntRect(node->boundingBox())); > > Why do you need the IntRect()? I wonder if what we really want here is pixelSnappedBoundingBox() here. > Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp:1957 > - WebCore::IntRect elementRectInRootView = select->document()->view()->contentsToRootView(enclosingIntRect(select->getRect())); > + WebCore::IntRect elementRectInRootView = select->document()->view()->contentsToRootView(enclosingIntRect(select->boundingBox())); And same here.
Xan Lopez
Comment 8 2013-04-11 02:08:53 PDT
Comment on attachment 196833 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196833&action=review r- because we should use different APIs and I think some of the code we are changing is dead. >>> Source/WebKit/blackberry/Api/WebPage.cpp:2601 >>> + return view->contentsToWindow(IntRect(node->boundingBox())); >> >> Why do you need the IntRect()? > > I wonder if what we really want here is pixelSnappedBoundingBox() here. If you read the code this seems to be used to check whether the bounding box intersects with the visible rectangle of another node in ::contextNode. Since the second rectangle is not using a snapped version, I think we should not use it here. > Source/WebKit/blackberry/Api/WebPage.cpp:5013 > } I cannot even find where this code is used. Seems to be dead? If that's so let's just remove it. >> Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp:1957 >> + WebCore::IntRect elementRectInRootView = select->document()->view()->contentsToRootView(enclosingIntRect(select->boundingBox())); > > And same here. Here we should use a pixel snapped version, since it is what Chromium does when calling this API.
Alberto Garcia
Comment 9 2013-06-04 09:37:16 PDT
(In reply to comment #8) > > Source/WebKit/blackberry/Api/WebPage.cpp:5013 > > } > > I cannot even find where this code is used. Seems to be dead? If > that's so let's just remove it. You're right about this, I'll double check and file a separate bug.
Alberto Garcia
Comment 10 2014-01-09 23:46:17 PST
This bug is obsolete, closing.
Note You need to log in before you can comment on or make changes to this bug.