Changeset 73627 in webkit
- Timestamp:
- Dec 9, 2010 10:53:47 AM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r73626 r73627 1 2010-12-07 Antonio Gomes <agomes@rim.com> 2 3 Reviewed by Daniel Bates. 4 5 Spatial Navigation: code clean up 6 https://bugs.webkit.org/show_bug.cgi?id=50666 7 8 Patch unifies two FocusCandidate constructors, making caller sites 9 simpler. Now the special handling HTMLAreaElement gets is done within 10 the non default constructor (i.e. FocusCanditate(Node*, FocusDirection)). 11 12 No new tests needed. 13 14 * page/FocusController.cpp: 15 (WebCore::FocusController::findFocusCandidateInContainer): 16 * page/SpatialNavigation.cpp: 17 (WebCore::FocusCandidate::FocusCandidate): 18 1 19 2010-12-09 Philippe Normand <pnormand@igalia.com> 2 20 -
trunk/WebCore/page/FocusController.cpp
r73452 r73627 479 479 continue; 480 480 481 if (node->hasTagName(areaTag)) { 482 HTMLAreaElement* area = static_cast<HTMLAreaElement*>(node); 483 FocusCandidate candidate(area, direction); 484 if (candidate.isNull()) 485 continue; 486 487 candidate.enclosingScrollableBox = container; 488 updateFocusCandidateIfNeeded(direction, startingRect, candidate, closest); 481 FocusCandidate candidate = FocusCandidate(node, direction); 482 if (candidate.isNull()) 489 483 continue; 490 } 491 492 if (!node->renderer()) 493 continue; 494 495 FocusCandidate candidate(node, direction); 484 496 485 candidate.enclosingScrollableBox = container; 497 486 updateFocusCandidateIfNeeded(direction, startingRect, candidate, closest); -
trunk/WebCore/page/SpatialNavigation.cpp
r73452 r73627 37 37 #include "HTMLImageElement.h" 38 38 #include "HTMLMapElement.h" 39 #include "HTMLNames.h" 39 40 #include "IntRect.h" 40 41 #include "Node.h" … … 56 57 57 58 FocusCandidate::FocusCandidate(Node* n, FocusDirection direction) 58 : visibleNode(n)59 , focusableNode(n)60 , enclosingScrollableBox(0)61 , distance(maxDistance())62 , parentDistance(maxDistance())63 , alignment(None)64 , parentAlignment(None)65 , rect(nodeRectInAbsoluteCoordinates(n, true /* ignore border */))66 , isOffscreen(hasOffscreenRect(n))67 , isOffscreenAfterScrolling(hasOffscreenRect(n, direction))68 {69 }70 71 FocusCandidate::FocusCandidate(HTMLAreaElement* area, FocusDirection direction)72 59 : visibleNode(0) 73 60 , focusableNode(0) … … 80 67 , isOffscreenAfterScrolling(true) 81 68 { 82 HTMLImageElement* image = area->imageElement(); 83 if (!image) 84 return; 85 86 focusableNode = area; 87 visibleNode = image; 88 rect = virtualRectForAreaElementAndDirection(direction, area); 89 isOffscreen = hasOffscreenRect(image); 90 isOffscreenAfterScrolling = hasOffscreenRect(image, direction); 69 if (n->hasTagName(HTMLNames::areaTag)) { 70 HTMLAreaElement* area = static_cast<HTMLAreaElement*>(n); 71 HTMLImageElement* image = area->imageElement(); 72 if (!image || !image->renderer()) 73 return; 74 75 visibleNode = image; 76 rect = virtualRectForAreaElementAndDirection(direction, area); 77 } else { 78 if (!n->renderer()) 79 return; 80 81 visibleNode = n; 82 rect = nodeRectInAbsoluteCoordinates(n, true /* ignore border */); 83 } 84 85 focusableNode = n; 86 isOffscreen = hasOffscreenRect(visibleNode); 87 isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, direction); 91 88 } 92 89
Note: See TracChangeset
for help on using the changeset viewer.