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

Side by Side Diff: ios/chrome/browser/find_in_page/resources/find_in_page.js

Issue 2755123002: Fix Find in Page on iOS 10.3. (Closed)
Patch Set: Created 3 years, 9 months 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 | « no previous file | 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 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Based heavily on code from the Google iOS app. 6 * Based heavily on code from the Google iOS app.
7 * 7 *
8 * @fileoverview A find in page tool. It scans the DOM for elements with the 8 * @fileoverview A find in page tool. It scans the DOM for elements with the
9 * text being search for, and wraps them with a span that highlights them. 9 * text being search for, and wraps them with a span that highlights them.
10 */ 10 */
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 /** 946 /**
947 * Gather all iframes in the main window. 947 * Gather all iframes in the main window.
948 * @return {Array<Document>} frames. 948 * @return {Array<Document>} frames.
949 */ 949 */
950 __gCrWeb['findInPage'].frameDocuments = function() { 950 __gCrWeb['findInPage'].frameDocuments = function() {
951 var windowsToSearch = [window]; 951 var windowsToSearch = [window];
952 var documents = []; 952 var documents = [];
953 while (windowsToSearch.length != 0) { 953 while (windowsToSearch.length != 0) {
954 var win = windowsToSearch.pop(); 954 var win = windowsToSearch.pop();
955 for (var i = win.frames.length - 1; i >= 0; i--) { 955 for (var i = win.frames.length - 1; i >= 0; i--) {
956 if (win.frames[i].document) { 956 try{
justincohen 2017/03/17 15:05:34 nit space
stkhapugin 2017/03/17 15:20:51 Done.
957 documents.push(win.frames[i].document); 957 if (win.frames[i].document) {
958 windowsToSearch.push(win.frames[i]); 958 documents.push(win.frames[i].document);
959 windowsToSearch.push(win.frames[i]);
960 }
961 } catch (e) {
justincohen 2017/03/17 15:06:25 probably best to explain what we expect to catch h
stkhapugin 2017/03/17 15:20:51 Done.
962 // Do nothing.
959 } 963 }
960 } 964 }
961 } 965 }
962 return documents; 966 return documents;
963 }; 967 };
964 968
965 window.addEventListener('pagehide', __gCrWeb['findInPage']['disable']); 969 window.addEventListener('pagehide', __gCrWeb['findInPage']['disable']);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698