Changeset 74003 in webkit
- Timestamp:
- Dec 13, 2010 10:51:41 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r74001 r74003 1 2010-12-13 Antonio Gomes <agomes@rim.com> 2 3 Reviewed by Daniel Bates. 4 5 Spatial Navigation: code clean up (part III) 6 https://bugs.webkit.org/show_bug.cgi?id=50666 7 8 No new tests needed. 9 10 * page/SpatialNavigation.h: Added FocusCandidate::isFrameOwnerElement and 11 WebCore::frameOwnerElement helper functions. 12 (WebCore::FocusCandidate::isFrameOwnerElement): Returns true if the Node pointer 13 wrapped by FocusCandidate is an instance of HTMLFrameOwnerElement. Returns false 14 otherwise. 15 * page/SpatialNavigation.cpp: 16 (WebCore::frameOwnerElement): Returns the HTMLFrameOwnerElement associated with 17 the FocusCandidate if appropriate. 18 * page/FocusController.cpp: 19 (WebCore::updateFocusCandidateIfNeeded): Make use of newly added frameOwnerElement() helper. 20 (WebCore::FocusController::advanceFocusDirectionallyInContainer): Ditto. 21 1 22 2010-12-13 Mike Lawther <mikelawther@chromium.org> 2 23 -
trunk/WebCore/page/FocusController.cpp
r73885 r74003 42 42 #include "FrameView.h" 43 43 #include "HTMLAreaElement.h" 44 #include "HTMLFrameOwnerElement.h"45 44 #include "HTMLImageElement.h" 46 45 #include "HTMLNames.h" … … 420 419 421 420 // Ignore iframes that don't have a src attribute 422 if ( candidate.visibleNode->isFrameOwnerElement() && (!static_cast<HTMLFrameOwnerElement*>(candidate.visibleNode)->contentFrame() || candidate.rect.isEmpty()))421 if (frameOwnerElement(candidate) && (!frameOwnerElement(candidate)->contentFrame() || candidate.rect.isEmpty())) 423 422 return; 424 423 … … 510 509 return false; 511 510 } 512 if (focusCandidate.visibleNode->isFrameOwnerElement()) { 513 HTMLFrameOwnerElement* frameElement = static_cast<HTMLFrameOwnerElement*>(focusCandidate.visibleNode);511 512 if (HTMLFrameOwnerElement* frameElement = frameOwnerElement(focusCandidate)) { 514 513 // If we have an iframe without the src attribute, it will not have a contentFrame(). 515 514 // We ASSERT here to make sure that -
trunk/WebCore/page/SpatialNavigation.cpp
r73885 r74003 34 34 #include "FrameView.h" 35 35 #include "HTMLAreaElement.h" 36 #include "HTMLFrameOwnerElement.h"37 36 #include "HTMLImageElement.h" 38 37 #include "HTMLMapElement.h" … … 703 702 } 704 703 704 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) 705 { 706 return candidate.isFrameOwnerElement() ? static_cast<HTMLFrameOwnerElement*>(candidate.visibleNode) : 0; 707 }; 705 708 706 709 } // namespace WebCore -
trunk/WebCore/page/SpatialNavigation.h
r73885 r74003 23 23 24 24 #include "FocusDirection.h" 25 #include "HTMLFrameOwnerElement.h" 25 26 #include "IntRect.h" 26 27 #include "Node.h" … … 117 118 bool isNull() const { return !visibleNode; } 118 119 bool inScrollableContainer() const { return visibleNode && enclosingScrollableBox; } 120 bool isFrameOwnerElement() const { return visibleNode && visibleNode->isFrameOwnerElement(); } 119 121 Document* document() const { return visibleNode ? visibleNode->document() : 0; } 120 122 … … 146 148 IntRect virtualRectForDirection(FocusDirection, const IntRect& startingRect, int width = 0); 147 149 IntRect virtualRectForAreaElementAndDirection(FocusDirection, HTMLAreaElement*); 150 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate&); 151 148 152 } // namspace WebCore 149 153
Note: See TracChangeset
for help on using the changeset viewer.