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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 | 293 |
294 if (m_resumeScopingFromRange) { | 294 if (m_resumeScopingFromRange) { |
295 // This is a continuation of a scoping operation that timed out and didn 't | 295 // This is a continuation of a scoping operation that timed out and didn 't |
296 // complete last time around, so we should start from where we left off. | 296 // complete last time around, so we should start from where we left off. |
297 DCHECK(m_resumeScopingFromRange->collapsed()); | 297 DCHECK(m_resumeScopingFromRange->collapsed()); |
298 searchStart = fromPositionInDOMTree<EditingInFlatTreeStrategy>(m_resumeS copingFromRange->endPosition()); | 298 searchStart = fromPositionInDOMTree<EditingInFlatTreeStrategy>(m_resumeS copingFromRange->endPosition()); |
299 if (searchStart.document() != searchEnd.document()) | 299 if (searchStart.document() != searchEnd.document()) |
300 return; | 300 return; |
301 } | 301 } |
302 | 302 |
303 // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets n eeds to be audited. | |
304 // see http://crbug.com/590369 for more details. | |
305 searchStart.document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
dglazkov
2016/07/13 22:40:11
Goes up to WebLocalFrameImpl::scopeStringMatches a
| |
306 | |
303 // This timeout controls how long we scope before releasing control. This | 307 // This timeout controls how long we scope before releasing control. This |
304 // value does not prevent us from running for longer than this, but it is | 308 // value does not prevent us from running for longer than this, but it is |
305 // periodically checked to see if we have exceeded our allocated time. | 309 // periodically checked to see if we have exceeded our allocated time. |
306 const double maxScopingDuration = 0.1; // seconds | 310 const double maxScopingDuration = 0.1; // seconds |
307 | 311 |
308 int matchCount = 0; | 312 int matchCount = 0; |
309 bool timedOut = false; | 313 bool timedOut = false; |
310 double startTime = currentTime(); | 314 double startTime = currentTime(); |
311 do { | 315 do { |
312 // Find next occurrence of the search string. | 316 // Find next occurrence of the search string. |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
742 DEFINE_TRACE(TextFinder) | 746 DEFINE_TRACE(TextFinder) |
743 { | 747 { |
744 visitor->trace(m_ownerFrame); | 748 visitor->trace(m_ownerFrame); |
745 visitor->trace(m_activeMatch); | 749 visitor->trace(m_activeMatch); |
746 visitor->trace(m_resumeScopingFromRange); | 750 visitor->trace(m_resumeScopingFromRange); |
747 visitor->trace(m_deferredScopingWork); | 751 visitor->trace(m_deferredScopingWork); |
748 visitor->trace(m_findMatchesCache); | 752 visitor->trace(m_findMatchesCache); |
749 } | 753 } |
750 | 754 |
751 } // namespace blink | 755 } // namespace blink |
OLD | NEW |