Changeset 146090 in webkit


Ignore:
Timestamp:
Mar 18, 2013 11:29:42 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Add Proximity Detector.
https://bugs.webkit.org/show_bug.cgi?id=112278

Patch by Alberto Garcia <agarcia@igalia.com> on 2013-03-18
Reviewed by Rob Buis.

Fix variable names so they actually match the function
declarations.

Fix call to rectForPoint(), which was moved from HitTestResult to
HitTestLocation in r117091 and r126859.

  • WebKitSupport/ProximityDetector.cpp:

(BlackBerry::WebKit::ProximityDetector::findBestPoint):

Location:
trunk/Source/WebKit/blackberry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/ChangeLog

    r146061 r146090  
     12013-03-18  Alberto Garcia  <agarcia@igalia.com>
     2
     3        [BlackBerry] Add Proximity Detector.
     4        https://bugs.webkit.org/show_bug.cgi?id=112278
     5
     6        Reviewed by Rob Buis.
     7
     8        Fix variable names so they actually match the function
     9        declarations.
     10
     11        Fix call to rectForPoint(), which was moved from HitTestResult to
     12        HitTestLocation in r117091 and r126859.
     13
     14        * WebKitSupport/ProximityDetector.cpp:
     15        (BlackBerry::WebKit::ProximityDetector::findBestPoint):
     16
    1172013-03-18  Alberto Garcia  <agarcia@igalia.com>
    218
  • trunk/Source/WebKit/blackberry/WebKitSupport/ProximityDetector.cpp

    r145757 r146090  
    6060
    6161    if (!m_webPage->m_mainFrame)
    62         return contentPos;
     62        return documentPos;
    6363
    6464    Document* document = m_webPage->m_mainFrame->document();
    6565
    6666    if (!document || !document->frame()->view())
    67         return contentPos;
     67        return documentPos;
    6868
    69     unsigned left = -paddingRect.x();
    70     unsigned top = -paddingRect.y();
    71     unsigned right = paddingRect.maxX();
    72     unsigned bottom = paddingRect.maxY();
     69    unsigned left = -documentPaddingRect.x();
     70    unsigned top = -documentPaddingRect.y();
     71    unsigned right = documentPaddingRect.maxX();
     72    unsigned bottom = documentPaddingRect.maxY();
    7373
    7474    // Adjust hit point to frame
    75     IntPoint frameContentPos(document->frame()->view()->windowToContents(m_webPage->m_mainFrame->view()->contentsToWindow(contentPos)));
     75    IntPoint frameContentPos(document->frame()->view()->windowToContents(m_webPage->m_mainFrame->view()->contentsToWindow(documentPos)));
    7676    HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
    7777    HitTestResult result(frameContentPos, top, right, bottom, left);
    7878    document->renderView()->layer()->hitTest(request, result);
    7979
    80     IntPoint bestPoint = contentPos;
     80    IntPoint bestPoint = documentPos;
    8181    int bestPriority = 0;
    8282
     
    9292
    9393        IntRect curRect = curNode->renderer()->absoluteBoundingBoxRect(true /*use transforms*/);
    94         IntRect hitTestRect = HitTestResult::rectForPoint(contentPos, top, right, bottom, left);
     94        IntRect hitTestRect = HitTestLocation::rectForPoint(documentPos, top, right, bottom, left);
    9595
    9696        // Check that top corner does not exceed padding
     
    102102            continue;
    103103
    104         bool equalPriorityAndCloser = (priority == bestPriority) && (contentPos.distanceSquaredToPoint(bestPoint) > contentPos.distanceSquaredToPoint(curRect.location()));
     104        bool equalPriorityAndCloser = (priority == bestPriority) && (documentPos.distanceSquaredToPoint(bestPoint) > documentPos.distanceSquaredToPoint(curRect.location()));
    105105        if (priority > bestPriority || equalPriorityAndCloser) {
    106106            bestPoint = curRect.location(); // use top left
Note: See TracChangeset for help on using the changeset viewer.