OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 | 1499 |
1500 if (behavior == UrlFragmentScroll) | 1500 if (behavior == UrlFragmentScroll) |
1501 setFragmentAnchor(anchorNode ? static_cast<Node*>(anchorNode) : m_frame-
>document()); | 1501 setFragmentAnchor(anchorNode ? static_cast<Node*>(anchorNode) : m_frame-
>document()); |
1502 | 1502 |
1503 // If the anchor accepts keyboard focus and fragment scrolling is allowed, | 1503 // If the anchor accepts keyboard focus and fragment scrolling is allowed, |
1504 // move focus there to aid users relying on keyboard navigation. | 1504 // move focus there to aid users relying on keyboard navigation. |
1505 // If anchorNode is not focusable or fragment scrolling is not allowed, | 1505 // If anchorNode is not focusable or fragment scrolling is not allowed, |
1506 // clear focus, which matches the behavior of other browsers. | 1506 // clear focus, which matches the behavior of other browsers. |
1507 if (anchorNode) { | 1507 if (anchorNode) { |
1508 m_frame->document()->updateLayoutIgnorePendingStylesheets(); | 1508 m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
1509 if (behavior == UrlFragmentScroll && anchorNode->isFocusable()) | 1509 if (behavior == UrlFragmentScroll && anchorNode->isFocusable()) { |
1510 anchorNode->focus(); | 1510 anchorNode->focus(); |
1511 else | 1511 } else { |
| 1512 if (behavior == UrlFragmentScroll) |
| 1513 m_frame->document()->setSequentialFocusNavigationStartingPoint(a
nchorNode); |
1512 m_frame->document()->clearFocusedElement(); | 1514 m_frame->document()->clearFocusedElement(); |
| 1515 } |
1513 } | 1516 } |
1514 return true; | 1517 return true; |
1515 } | 1518 } |
1516 | 1519 |
1517 void FrameView::setFragmentAnchor(Node* anchorNode) | 1520 void FrameView::setFragmentAnchor(Node* anchorNode) |
1518 { | 1521 { |
1519 ASSERT(anchorNode); | 1522 ASSERT(anchorNode); |
1520 m_fragmentAnchor = anchorNode; | 1523 m_fragmentAnchor = anchorNode; |
1521 | 1524 |
1522 // We need to update the layout tree before scrolling. | 1525 // We need to update the layout tree before scrolling. |
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4110 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4113 return m_hiddenForThrottling && m_crossOriginForThrottling; |
4111 } | 4114 } |
4112 | 4115 |
4113 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4116 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
4114 { | 4117 { |
4115 ASSERT(layoutView()); | 4118 ASSERT(layoutView()); |
4116 return *layoutView(); | 4119 return *layoutView(); |
4117 } | 4120 } |
4118 | 4121 |
4119 } // namespace blink | 4122 } // namespace blink |
OLD | NEW |