Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Side by Side Diff: Source/core/page/FocusController.cpp

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/rendering/RenderMenuList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 if (candidate.isNull()) 781 if (candidate.isNull())
782 continue; 782 continue;
783 783
784 candidate.enclosingScrollableBox = container; 784 candidate.enclosingScrollableBox = container;
785 updateFocusCandidateIfNeeded(direction, current, candidate, closest); 785 updateFocusCandidateIfNeeded(direction, current, candidate, closest);
786 } 786 }
787 } 787 }
788 788
789 bool FocusController::advanceFocusDirectionallyInContainer(Node* container, cons t LayoutRect& startingRect, FocusDirection direction) 789 bool FocusController::advanceFocusDirectionallyInContainer(Node* container, cons t LayoutRect& startingRect, FocusDirection direction)
790 { 790 {
791 if (!container || !container->document()) 791 if (!container)
792 return false; 792 return false;
793 793
794 LayoutRect newStartingRect = startingRect; 794 LayoutRect newStartingRect = startingRect;
795 795
796 if (startingRect.isEmpty()) 796 if (startingRect.isEmpty())
797 newStartingRect = virtualRectForDirection(direction, nodeRectInAbsoluteC oordinates(container)); 797 newStartingRect = virtualRectForDirection(direction, nodeRectInAbsoluteC oordinates(container));
798 798
799 // Find the closest node within current container in the direction of the na vigation. 799 // Find the closest node within current container in the direction of the na vigation.
800 FocusCandidate focusCandidate; 800 FocusCandidate focusCandidate;
801 findFocusCandidateInContainer(container, newStartingRect, direction, focusCa ndidate); 801 findFocusCandidateInContainer(container, newStartingRect, direction, focusCa ndidate);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */); 890 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */);
891 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct ion, container); 891 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct ion, container);
892 if (container && container->isDocumentNode()) 892 if (container && container->isDocumentNode())
893 toDocument(container)->updateLayoutIgnorePendingStylesheets(); 893 toDocument(container)->updateLayoutIgnorePendingStylesheets();
894 } while (!consumed && container); 894 } while (!consumed && container);
895 895
896 return consumed; 896 return consumed;
897 } 897 }
898 898
899 } // namespace WebCore 899 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/rendering/RenderMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698