| OLD | NEW |
| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 focusableNode = node; | 79 focusableNode = node; |
| 80 isOffscreen = hasOffscreenRect(visibleNode); | 80 isOffscreen = hasOffscreenRect(visibleNode); |
| 81 isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, type); | 81 isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, type); |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool isSpatialNavigationEnabled(const LocalFrame* frame) | 84 bool isSpatialNavigationEnabled(const LocalFrame* frame) |
| 85 { | 85 { |
| 86 return (frame && frame->settings() && frame->settings()->spatialNavigationEn
abled()); | 86 return (frame && frame->settings() && frame->settings()->spatialNavigationEn
abled()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool spatialNavigationIgnoresEventHandlers(const LocalFrame* frame) |
| 90 { |
| 91 return (frame && frame->settings() && frame->settings()->deviceSupportsTouch
()); |
| 92 } |
| 93 |
| 89 static bool rectsIntersectOnOrthogonalAxis(WebFocusType type, const LayoutRect&
a, const LayoutRect& b) | 94 static bool rectsIntersectOnOrthogonalAxis(WebFocusType type, const LayoutRect&
a, const LayoutRect& b) |
| 90 { | 95 { |
| 91 switch (type) { | 96 switch (type) { |
| 92 case WebFocusTypeLeft: | 97 case WebFocusTypeLeft: |
| 93 case WebFocusTypeRight: | 98 case WebFocusTypeRight: |
| 94 return a.maxY() > b.y() && a.y() < b.maxY(); | 99 return a.maxY() > b.y() && a.y() < b.maxY(); |
| 95 case WebFocusTypeUp: | 100 case WebFocusTypeUp: |
| 96 case WebFocusTypeDown: | 101 case WebFocusTypeDown: |
| 97 return a.maxX() > b.x() && a.x() < b.maxX(); | 102 return a.maxX() > b.x() && a.x() < b.maxX(); |
| 98 default: | 103 default: |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar
ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1); | 622 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar
ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1); |
| 618 return rect; | 623 return rect; |
| 619 } | 624 } |
| 620 | 625 |
| 621 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) | 626 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) |
| 622 { | 627 { |
| 623 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v
isibleNode) : nullptr; | 628 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v
isibleNode) : nullptr; |
| 624 }; | 629 }; |
| 625 | 630 |
| 626 } // namespace blink | 631 } // namespace blink |
| OLD | NEW |