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

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

Issue 18251004: Introduce isHTMLAreaElement and toHTMLAreaElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « Source/core/html/HTMLMapElement.cpp ('k') | Source/core/page/SpatialNavigation.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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 843
844 if (container->isDocumentNode()) 844 if (container->isDocumentNode())
845 toDocument(container)->updateLayoutIgnorePendingStylesheets(); 845 toDocument(container)->updateLayoutIgnorePendingStylesheets();
846 846
847 // Figure out the starting rect. 847 // Figure out the starting rect.
848 LayoutRect startingRect; 848 LayoutRect startingRect;
849 if (focusedNode) { 849 if (focusedNode) {
850 if (!hasOffscreenRect(focusedNode)) { 850 if (!hasOffscreenRect(focusedNode)) {
851 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(di rection, focusedNode); 851 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(di rection, focusedNode);
852 startingRect = nodeRectInAbsoluteCoordinates(focusedNode, true /* ig nore border */); 852 startingRect = nodeRectInAbsoluteCoordinates(focusedNode, true /* ig nore border */);
853 } else if (focusedNode->hasTagName(areaTag)) { 853 } else if (isHTMLAreaElement(focusedNode)) {
854 HTMLAreaElement* area = static_cast<HTMLAreaElement*>(focusedNode); 854 HTMLAreaElement* area = toHTMLAreaElement(focusedNode);
855 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(di rection, area->imageElement()); 855 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(di rection, area->imageElement());
856 startingRect = virtualRectForAreaElementAndDirection(area, direction ); 856 startingRect = virtualRectForAreaElementAndDirection(area, direction );
857 } 857 }
858 } 858 }
859 859
860 bool consumed = false; 860 bool consumed = false;
861 do { 861 do {
862 consumed = advanceFocusDirectionallyInContainer(container, startingRect, direction, event); 862 consumed = advanceFocusDirectionallyInContainer(container, startingRect, direction, event);
863 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */); 863 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */);
864 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct ion, container); 864 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct ion, container);
865 if (container && container->isDocumentNode()) 865 if (container && container->isDocumentNode())
866 toDocument(container)->updateLayoutIgnorePendingStylesheets(); 866 toDocument(container)->updateLayoutIgnorePendingStylesheets();
867 } while (!consumed && container); 867 } while (!consumed && container);
868 868
869 return consumed; 869 return consumed;
870 } 870 }
871 871
872 } // namespace WebCore 872 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMapElement.cpp ('k') | Source/core/page/SpatialNavigation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698