OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 frame()->selection().setSelection(m_activeMatch.get()); | 2312 frame()->selection().setSelection(m_activeMatch.get()); |
2313 frame()->document()->setFocusedElement(element); | 2313 frame()->document()->setFocusedElement(element); |
2314 return; | 2314 return; |
2315 } | 2315 } |
2316 } | 2316 } |
2317 | 2317 |
2318 // Iterate over all the nodes in the range until we find a focusable nod
e. | 2318 // Iterate over all the nodes in the range until we find a focusable nod
e. |
2319 // This, for example, sets focus to the first link if you search for | 2319 // This, for example, sets focus to the first link if you search for |
2320 // text and text that is within one or more links. | 2320 // text and text that is within one or more links. |
2321 node = m_activeMatch->firstNode(); | 2321 node = m_activeMatch->firstNode(); |
2322 for (; node && node != m_activeMatch->pastLastNode(); node = NodeTravers
al::next(node)) { | 2322 for (; node && node != m_activeMatch->pastLastNode(); node = NodeTravers
al::next(*node)) { |
2323 if (!node->isElementNode()) | 2323 if (!node->isElementNode()) |
2324 continue; | 2324 continue; |
2325 Element* element = toElement(node); | 2325 Element* element = toElement(node); |
2326 if (element->isFocusable()) { | 2326 if (element->isFocusable()) { |
2327 frame()->document()->setFocusedElement(element); | 2327 frame()->document()->setFocusedElement(element); |
2328 return; | 2328 return; |
2329 } | 2329 } |
2330 } | 2330 } |
2331 | 2331 |
2332 // No node related to the active match was focusable, so set the | 2332 // No node related to the active match was focusable, so set the |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2522 | 2522 |
2523 // There is a possibility that the frame being detached was the only | 2523 // There is a possibility that the frame being detached was the only |
2524 // pending one. We need to make sure final replies can be sent. | 2524 // pending one. We need to make sure final replies can be sent. |
2525 flushCurrentScopingEffort(m_findRequestIdentifier); | 2525 flushCurrentScopingEffort(m_findRequestIdentifier); |
2526 | 2526 |
2527 cancelPendingScopingEffort(); | 2527 cancelPendingScopingEffort(); |
2528 } | 2528 } |
2529 } | 2529 } |
2530 | 2530 |
2531 } // namespace blink | 2531 } // namespace blink |
OLD | NEW |