| OLD | NEW |
| 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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 DCHECK(element->isFocusable()); | 987 DCHECK(element->isFocusable()); |
| 988 | 988 |
| 989 // FIXME: It would be nice to just be able to call setFocusedElement(element
) | 989 // FIXME: It would be nice to just be able to call setFocusedElement(element
) |
| 990 // here, but we can't do that because some elements (e.g. HTMLInputElement | 990 // here, but we can't do that because some elements (e.g. HTMLInputElement |
| 991 // and HTMLTextAreaElement) do extra work in their focus() methods. | 991 // and HTMLTextAreaElement) do extra work in their focus() methods. |
| 992 Document& newDocument = element->document(); | 992 Document& newDocument = element->document(); |
| 993 | 993 |
| 994 if (&newDocument != document) { | 994 if (&newDocument != document) { |
| 995 // Focus is going away from this document, so clear the focused element. | 995 // Focus is going away from this document, so clear the focused element. |
| 996 document->clearFocusedElement(); | 996 document->clearFocusedElement(); |
| 997 document->setSequentialFocusNavigationStartingPoint(nullptr); |
| 997 } | 998 } |
| 998 | 999 |
| 999 setFocusedFrame(newDocument.frame()); | 1000 setFocusedFrame(newDocument.frame()); |
| 1000 | 1001 |
| 1001 if (caretBrowsing) { | 1002 if (caretBrowsing) { |
| 1002 Position position = firstPositionInOrBeforeNode(element); | 1003 Position position = firstPositionInOrBeforeNode(element); |
| 1003 VisibleSelection newSelection(position, position); | 1004 VisibleSelection newSelection(position, position); |
| 1004 frame->selection().setSelection(newSelection); | 1005 frame->selection().setSelection(newSelection); |
| 1005 } | 1006 } |
| 1006 | 1007 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 return consumed; | 1314 return consumed; |
| 1314 } | 1315 } |
| 1315 | 1316 |
| 1316 DEFINE_TRACE(FocusController) | 1317 DEFINE_TRACE(FocusController) |
| 1317 { | 1318 { |
| 1318 visitor->trace(m_page); | 1319 visitor->trace(m_page); |
| 1319 visitor->trace(m_focusedFrame); | 1320 visitor->trace(m_focusedFrame); |
| 1320 } | 1321 } |
| 1321 | 1322 |
| 1322 } // namespace blink | 1323 } // namespace blink |
| OLD | NEW |