| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsi
ngEnabled(); | 1096 bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsi
ngEnabled(); |
| 1097 if (caretBrowsing) { | 1097 if (caretBrowsing) { |
| 1098 if (Element* anchor = enclosingAnchorElement(base())) { | 1098 if (Element* anchor = enclosingAnchorElement(base())) { |
| 1099 m_frame->page()->focusController().setFocusedElement(anchor, m_frame
); | 1099 m_frame->page()->focusController().setFocusedElement(anchor, m_frame
); |
| 1100 return; | 1100 return; |
| 1101 } | 1101 } |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 if (Element* target = rootEditableElement()) { | 1104 if (Element* target = rootEditableElement()) { |
| 1105 // Walk up the DOM tree to search for a node to focus. | 1105 // Walk up the DOM tree to search for a node to focus. |
| 1106 m_frame->document()->updateLayoutTreeIgnorePendingStylesheets(); |
| 1106 while (target) { | 1107 while (target) { |
| 1107 // We don't want to set focus on a subframe when selecting in a pare
nt frame, | 1108 // We don't want to set focus on a subframe when selecting in a pare
nt frame, |
| 1108 // so add the !isFrameElement check here. There's probably a better
way to make this | 1109 // so add the !isFrameElement check here. There's probably a better
way to make this |
| 1109 // work in the long term, but this is the safest fix at this time. | 1110 // work in the long term, but this is the safest fix at this time. |
| 1110 if (target->isMouseFocusable() && !isFrameElement(target)) { | 1111 if (target->isMouseFocusable() && !isFrameElement(target)) { |
| 1111 m_frame->page()->focusController().setFocusedElement(target, m_f
rame); | 1112 m_frame->page()->focusController().setFocusedElement(target, m_f
rame); |
| 1112 return; | 1113 return; |
| 1113 } | 1114 } |
| 1114 target = target->parentOrShadowHostElement(); | 1115 target = target->parentOrShadowHostElement(); |
| 1115 } | 1116 } |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 | 1425 |
| 1425 void showTree(const blink::FrameSelection* sel) | 1426 void showTree(const blink::FrameSelection* sel) |
| 1426 { | 1427 { |
| 1427 if (sel) | 1428 if (sel) |
| 1428 sel->showTreeForThis(); | 1429 sel->showTreeForThis(); |
| 1429 else | 1430 else |
| 1430 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1431 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1431 } | 1432 } |
| 1432 | 1433 |
| 1433 #endif | 1434 #endif |
| OLD | NEW |