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

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

Issue 810493003: Introduce "navigation target classification" for spatial navigation Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org> 3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org>
4 * 4 *
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 static RectsAlignment alignmentForRects(FocusType, const LayoutRect&, const Layo utRect&, const LayoutSize& viewSize); 48 static RectsAlignment alignmentForRects(FocusType, const LayoutRect&, const Layo utRect&, const LayoutSize& viewSize);
49 static bool areRectsFullyAligned(FocusType, const LayoutRect&, const LayoutRect& ); 49 static bool areRectsFullyAligned(FocusType, const LayoutRect&, const LayoutRect& );
50 static bool areRectsPartiallyAligned(FocusType, const LayoutRect&, const LayoutR ect&); 50 static bool areRectsPartiallyAligned(FocusType, const LayoutRect&, const LayoutR ect&);
51 static bool areRectsMoreThanFullScreenApart(FocusType, const LayoutRect& curRect , const LayoutRect& targetRect, const LayoutSize& viewSize); 51 static bool areRectsMoreThanFullScreenApart(FocusType, const LayoutRect& curRect , const LayoutRect& targetRect, const LayoutSize& viewSize);
52 static bool isRectInDirection(FocusType, const LayoutRect&, const LayoutRect&); 52 static bool isRectInDirection(FocusType, const LayoutRect&, const LayoutRect&);
53 static void deflateIfOverlapped(LayoutRect&, LayoutRect&); 53 static void deflateIfOverlapped(LayoutRect&, LayoutRect&);
54 static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo utRect&); 54 static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo utRect&);
55 static bool isScrollableNode(const Node*); 55 static bool isScrollableNode(const Node*);
56 56
57 FocusCandidate::FocusCandidate(Node* node, FocusType type) 57 FocusCandidate::FocusCandidate(Node* node, FocusType type, NavigationClass targe tClass)
58 : visibleNode(nullptr) 58 : visibleNode(nullptr)
59 , focusableNode(nullptr) 59 , focusableNode(nullptr)
60 , enclosingScrollableBox(nullptr) 60 , enclosingScrollableBox(nullptr)
61 , distance(maxDistance()) 61 , distance(maxDistance())
62 , alignment(None) 62 , alignment(None)
63 , isOffscreen(true) 63 , isOffscreen(true)
64 , isOffscreenAfterScrolling(true) 64 , isOffscreenAfterScrolling(true)
65 , targetClass(targetClass)
65 { 66 {
66 ASSERT(node); 67 ASSERT(node);
67 ASSERT(node->isElementNode()); 68 ASSERT(node->isElementNode());
68 69
69 if (isHTMLAreaElement(*node)) { 70 if (isHTMLAreaElement(*node)) {
70 HTMLAreaElement& area = toHTMLAreaElement(*node); 71 HTMLAreaElement& area = toHTMLAreaElement(*node);
71 HTMLImageElement* image = area.imageElement(); 72 HTMLImageElement* image = area.imageElement();
72 if (!image || !image->renderer()) 73 if (!image || !image->renderer())
73 return; 74 return;
74 75
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1); 748 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1);
748 return rect; 749 return rect;
749 } 750 }
750 751
751 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) 752 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate)
752 { 753 {
753 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v isibleNode) : nullptr; 754 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v isibleNode) : nullptr;
754 }; 755 };
755 756
756 } // namespace blink 757 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698