Changeset 143783 in webkit
- Timestamp:
- Feb 22, 2013, 1:24:22 PM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/ChangeLog
r143767 r143783 1 2013-02-22 Tiancheng Jiang <tijiang@rim.com> 2 3 [BlackBerry]Adjust fatfinger detection rect size 4 https://bugs.webkit.org/show_bug.cgi?id=108678. 5 6 Reviewed by Antonio Gomes. 7 8 Changing HitTestRequest::IgnoreClipping does not solve the problem that 9 FatFinger rect detect the element out of the viewport. We have to clip 10 the fatfinger rect according to the current viewport size to avoid picking 11 the element out of the viewport. 12 13 * WebKitSupport/FatFingers.cpp: 14 (BlackBerry::WebKit::FatFingers::fingerRectForPoint): 15 (BlackBerry::WebKit::FatFingers::findBestPoint): 16 (BlackBerry::WebKit::FatFingers::getAdjustedPaddings): 17 (BlackBerry::WebKit::FatFingers::getNodesFromRect): 18 * WebKitSupport/FatFingers.h: 19 1 20 2013-02-22 Mike Fenton <mifenton@rim.com> 2 21 -
trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp
r141797 r143783 67 67 { 68 68 unsigned topPadding, rightPadding, bottomPadding, leftPadding; 69 getPaddings(topPadding, rightPadding, bottomPadding, leftPadding); 69 IntPoint contentViewportPos = m_webPage->mapFromContentsToViewport(point); 70 getAdjustedPaddings(contentViewportPos, topPadding, rightPadding, bottomPadding, leftPadding); 70 71 71 72 return HitTestResult::rectForPoint(point, topPadding, rightPadding, bottomPadding, leftPadding); … … 151 152 ASSERT(m_webPage); 152 153 ASSERT(m_webPage->m_mainFrame); 154 155 // Even though we have clamped the point in libwebview to viewport, but there might be a rounding difference for viewport rect. 156 // Clamp position to viewport to ensure we are inside viewport. 157 IntRect viewportRect = m_webPage->mainFrame()->view()->visibleContentRect(); 158 m_contentPos = Platform::pointClampedToRect(m_contentPos, viewportRect); 153 159 154 160 m_cachedRectHitTestResults.clear(); … … 429 435 } 430 436 431 void FatFingers::get Paddings(unsigned& top, unsigned& right, unsigned& bottom, unsigned& left) const437 void FatFingers::getAdjustedPaddings(const IntPoint& contentViewportPos, unsigned& top, unsigned& right, unsigned& bottom, unsigned& left) const 432 438 { 433 439 static unsigned topPadding = Platform::Settings::instance()->topFatFingerPadding(); … … 441 447 bottom = bottomPadding / currentScale; 442 448 left = leftPadding / currentScale; 449 450 IntRect viewportRect = m_webPage->mainFrame()->view()->visibleContentRect(); 451 // We clamp the event position inside the viewport. We should not expand the fat finger rect to the edge again. 452 top = std::min(unsigned(std::max(contentViewportPos.y() - 1, 0)), top); 453 left = std::min(unsigned(std::max(contentViewportPos.x() - 1, 0)), left); 454 bottom = std::min(unsigned(std::max(viewportRect.height() - contentViewportPos.y() - 1, 0)), bottom); 455 right = std::min(unsigned(std::max(viewportRect.width() - contentViewportPos.x() - 1, 0)), right); 443 456 } 444 457 … … 446 459 { 447 460 unsigned topPadding, rightPadding, bottomPadding, leftPadding; 448 getPaddings(topPadding, rightPadding, bottomPadding, leftPadding); 461 IntPoint contentViewportPos = m_webPage->mapFromContentsToViewport(m_contentPos); 462 // Do not allow fat fingers detect anything not visible(ie outside of the viewport) 463 adjustPaddings(contentViewportPos, topPadding, rightPadding, bottomPadding, leftPadding); 449 464 450 465 // The user functions checkForText() and findIntersectingRegions() uses the Node.wholeText() to checkFingerIntersection() -
trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.h
r140541 r143783 104 104 105 105 inline WebCore::IntRect fingerRectForPoint(const WebCore::IntPoint&) const; 106 void get Paddings(unsigned& top, unsigned& right, unsigned& bottom, unsigned& left) const;106 void getAdjustedPaddings(const WebCore::IntPoint&, unsigned& top, unsigned& right, unsigned& bottom, unsigned& left) const; 107 107 108 108 WebPagePrivate* m_webPage;
Note:
See TracChangeset
for help on using the changeset viewer.