Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: Source/web/WebFrameImpl.cpp

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/xml/XPathUtil.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/xml/XPathUtil.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698