| 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 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 | 1062 |
| 1063 if (&newDocument != document) { | 1063 if (&newDocument != document) { |
| 1064 // Focus is going away from this document, so clear the focused element. | 1064 // Focus is going away from this document, so clear the focused element. |
| 1065 document->clearFocusedElement(); | 1065 document->clearFocusedElement(); |
| 1066 document->setSequentialFocusNavigationStartingPoint(nullptr); | 1066 document->setSequentialFocusNavigationStartingPoint(nullptr); |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 setFocusedFrame(newDocument.frame()); | 1069 setFocusedFrame(newDocument.frame()); |
| 1070 | 1070 |
| 1071 if (caretBrowsing) { | 1071 if (caretBrowsing) { |
| 1072 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 1073 // needs to be audited. See http://crbug.com/590369 for more details. |
| 1074 // In the long term, we should change FrameSelection::setSelection to take a |
| 1075 // parameter that does not require clean layout, so that modifying selection |
| 1076 // no longer performs synchronous layout by itself. |
| 1077 newDocument.updateStyleAndLayoutIgnorePendingStylesheets(); |
| 1078 |
| 1072 Position position = firstPositionInOrBeforeNode(element); | 1079 Position position = firstPositionInOrBeforeNode(element); |
| 1073 VisibleSelection newSelection = | 1080 VisibleSelection newSelection = |
| 1074 createVisibleSelectionDeprecated(position, position); | 1081 createVisibleSelectionDeprecated(position, position); |
| 1075 frame->selection().setSelection(newSelection); | 1082 frame->selection().setSelection(newSelection); |
| 1076 } | 1083 } |
| 1077 | 1084 |
| 1078 element->focus( | 1085 element->focus( |
| 1079 FocusParams(SelectionBehaviorOnFocus::Reset, type, sourceCapabilities)); | 1086 FocusParams(SelectionBehaviorOnFocus::Reset, type, sourceCapabilities)); |
| 1080 return true; | 1087 return true; |
| 1081 } | 1088 } |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 | 1444 |
| 1438 return consumed; | 1445 return consumed; |
| 1439 } | 1446 } |
| 1440 | 1447 |
| 1441 DEFINE_TRACE(FocusController) { | 1448 DEFINE_TRACE(FocusController) { |
| 1442 visitor->trace(m_page); | 1449 visitor->trace(m_page); |
| 1443 visitor->trace(m_focusedFrame); | 1450 visitor->trace(m_focusedFrame); |
| 1444 } | 1451 } |
| 1445 | 1452 |
| 1446 } // namespace blink | 1453 } // namespace blink |
| OLD | NEW |