Chromium Code Reviews| 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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1355 } | 1355 } |
| 1356 } | 1356 } |
| 1357 | 1357 |
| 1358 // Implement the rule that "" and "top" both mean top of page as in other br owsers. | 1358 // Implement the rule that "" and "top" both mean top of page as in other br owsers. |
| 1359 if (!anchorNode && !(name.isEmpty() || equalIgnoringCase(name, "top"))) | 1359 if (!anchorNode && !(name.isEmpty() || equalIgnoringCase(name, "top"))) |
| 1360 return false; | 1360 return false; |
| 1361 | 1361 |
| 1362 maintainScrollPositionAtAnchor(anchorNode ? static_cast<Node*>(anchorNode) : m_frame->document()); | 1362 maintainScrollPositionAtAnchor(anchorNode ? static_cast<Node*>(anchorNode) : m_frame->document()); |
| 1363 | 1363 |
| 1364 // If the anchor accepts keyboard focus, move focus there to aid users relyi ng on keyboard navigation. | 1364 // If the anchor accepts keyboard focus, move focus there to aid users relyi ng on keyboard navigation. |
| 1365 if (anchorNode && anchorNode->isFocusable()) | 1365 // If it does not accept keyboard focus, then still remove the focus for con sistency with other browsers (http://crbug.com/417636) |
|
dmazzoni
2014/10/08 18:19:06
This comment doesn't make sense - you say "remove
robwu
2014/10/08 20:10:23
setFocusedElement first unfocuses the old element.
dmazzoni
2014/10/08 20:26:27
Oh, I get it now. I'd probably write the comment s
robwu
2014/10/09 06:12:57
Done.
| |
| 1366 if (anchorNode) | |
| 1366 m_frame->document()->setFocusedElement(anchorNode); | 1367 m_frame->document()->setFocusedElement(anchorNode); |
| 1367 | 1368 |
| 1368 return true; | 1369 return true; |
| 1369 } | 1370 } |
| 1370 | 1371 |
| 1371 void FrameView::maintainScrollPositionAtAnchor(Node* anchorNode) | 1372 void FrameView::maintainScrollPositionAtAnchor(Node* anchorNode) |
| 1372 { | 1373 { |
| 1373 m_maintainScrollPositionAnchor = anchorNode; | 1374 m_maintainScrollPositionAnchor = anchorNode; |
| 1374 if (!m_maintainScrollPositionAnchor) | 1375 if (!m_maintainScrollPositionAnchor) |
| 1375 return; | 1376 return; |
| (...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3031 IntSize visibleSize = expandedIntSize(visibleContentSizeF); | 3032 IntSize visibleSize = expandedIntSize(visibleContentSizeF); |
| 3032 | 3033 |
| 3033 IntPoint maximumOffset( | 3034 IntPoint maximumOffset( |
| 3034 contentsWidth() - visibleSize.width() - scrollOrigin().x(), | 3035 contentsWidth() - visibleSize.width() - scrollOrigin().x(), |
| 3035 contentsHeight() - visibleSize.height() - scrollOrigin().y()); | 3036 contentsHeight() - visibleSize.height() - scrollOrigin().y()); |
| 3036 maximumOffset.clampNegativeToZero(); | 3037 maximumOffset.clampNegativeToZero(); |
| 3037 return maximumOffset; | 3038 return maximumOffset; |
| 3038 } | 3039 } |
| 3039 | 3040 |
| 3040 } // namespace blink | 3041 } // namespace blink |
| OLD | NEW |