Changeset 59045 in webkit
- Timestamp:
- May 8, 2010 8:05:46 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r59039 r59045 1 2010-05-03 Antonio Gomes <tonikitoo@webkit.org> 2 3 Reviewed by Kenneth Christiansen. 4 5 Spatial Navigation: create a getter for the "fudgeFactor" 6 https://bugs.webkit.org/show_bug.cgi?id=38488 7 8 A couple of places in the Spatial Navigation code make use of a "fudge factor" 9 to improve precision by working around outline focus metrics and such. Patch adds 10 a helper method for unify getter operations of this value, instead of having it 11 declared locally in the various methods it is used. 12 13 No behaviour change. 14 15 * page/SpatialNavigation.cpp: 16 (WebCore::scrollIntoView): 17 (WebCore::deflateIfOverlapped): 18 * page/SpatialNavigation.h: 19 (WebCore::fudgeFactor): 20 1 21 2010-05-08 Stuart Morgan <stuartmorgan@chromium.org> 2 22 -
trunk/WebCore/page/SpatialNavigation.cpp
r57663 r59045 478 478 // scrolling it for accurate reason. 479 479 // Element's scrollIntoView method does not provide this flexibility. 480 static const int fudgeFactor = 2;481 480 IntRect bounds = element->getRect(); 482 bounds.inflate(fudgeFactor );481 bounds.inflate(fudgeFactor()); 483 482 element->renderer()->enclosingLayer()->scrollRectToVisible(bounds); 484 483 } … … 498 497 return; 499 498 500 static const int fudgeFactor = -2;499 int deflateFactor = -fudgeFactor(); 501 500 502 501 // Avoid negative width or height values. 503 if ((a.width() + 2 * fudgeFactor > 0) && (a.height() + 2 * fudgeFactor > 0))504 a.inflate( fudgeFactor);505 506 if ((b.width() + 2 * fudgeFactor > 0) && (b.height() + 2 * fudgeFactor > 0))507 b.inflate( fudgeFactor);502 if ((a.width() + 2 * deflateFactor > 0) && (a.height() + 2 * deflateFactor > 0)) 503 a.inflate(deflateFactor); 504 505 if ((b.width() + 2 * deflateFactor > 0) && (b.height() + 2 * deflateFactor > 0)) 506 b.inflate(deflateFactor); 508 507 } 509 508 -
trunk/WebCore/page/SpatialNavigation.h
r57061 r59045 39 39 { 40 40 return numeric_limits<long long>::max(); 41 } 42 43 inline unsigned int fudgeFactor() 44 { 45 return 2; 41 46 } 42 47
Note: See TracChangeset
for help on using the changeset viewer.