Changeset 56393 in webkit


Ignore:
Timestamp:
Mar 23, 2010 8:14:29 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-03-23 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Element inspector search funtion: Error dispatching: performSearch.

https://bugs.webkit.org/show_bug.cgi?id=36488

Test: inspector/elements-panel-search.html

  • inspector/front-end/ElementsPanel.js: (WebInspector.ElementsPanel.prototype.performSearch): (WebInspector.ElementsPanel.prototype.addNodesToSearchResult):
  • inspector/front-end/InjectedScript.js: (injectedScriptConstructor.): (injectedScriptConstructor):
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r56392 r56393  
     12010-03-23  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Element inspector search funtion: Error dispatching: performSearch.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=36488
     8
     9        * inspector/elements-panel-search-expected.txt: Added.
     10        * inspector/elements-panel-search.html: Added.
     11
    1122010-03-23  Qi Zhang  <qi.2.zhang@nokia.com>
    213
  • trunk/WebCore/ChangeLog

    r56392 r56393  
     12010-03-23  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Element inspector search funtion: Error dispatching: performSearch.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=36488
     8
     9        Test: inspector/elements-panel-search.html
     10
     11        * inspector/front-end/ElementsPanel.js:
     12        (WebInspector.ElementsPanel.prototype.performSearch):
     13        (WebInspector.ElementsPanel.prototype.addNodesToSearchResult):
     14        * inspector/front-end/InjectedScript.js:
     15        (injectedScriptConstructor.):
     16        (injectedScriptConstructor):
     17
    1182010-03-23  Qi Zhang  <qi.2.zhang@nokia.com>
    219
  • trunk/WebCore/inspector/front-end/ElementsPanel.js

    r55537 r56393  
    254254        this._searchQuery = query;
    255255
    256         InjectedScriptAccess.getDefault().performSearch(whitespaceTrimmedQuery, function() {});
     256        InjectedScriptAccess.getDefault().performSearch(whitespaceTrimmedQuery, false, function() {});
    257257    },
    258258
  • trunk/WebCore/inspector/front-end/InjectedScript.js

    r56347 r56393  
    311311}
    312312
    313 InjectedScript.performSearch = function(whitespaceTrimmedQuery)
     313InjectedScript.performSearch = function(whitespaceTrimmedQuery, runSynchronously)
    314314{
    315315    // FIXME: Few things are missing here:
     
    479479
    480480    // Find all frames, iframes and object elements to search their documents.
    481     const querySelectorAllFunction = InjectedScript._window().Document.prototype.querySelectorAll;
    482     const subdocumentResult = querySelectorAllFunction.call(mainFrameDocument, "iframe, frame, object");
     481    const subdocumentResult = mainFrameDocument.querySelectorAll("iframe, frame, object");
    483482
    484483    for (var i = 0; i < subdocumentResult.length; ++i) {
     
    509508                clearInterval(chunkIntervalIdentifier);
    510509                finishedSearching.call(panel);
    511                 return;
     510                return false;
    512511            }
    513512
    514513            searchDocument = searchDocuments[documentIndex];
    515514        }
    516 
    517         if (!searchDocument || !searchFunction)
    518             return;
    519515
    520516        try {
     
    523519            // ignore any exceptions. the query might be malformed, but we allow that.
    524520        }
    525     }
    526 
    527     processChunk();
    528 
    529     chunkIntervalIdentifier = setInterval(processChunk, 25);
    530     InjectedScript._currentSearchChunkIntervalIdentifier = chunkIntervalIdentifier;
     521        return true;
     522    }
     523
     524    if (runSynchronously)
     525        while (processChunk()) {}
     526    else {
     527        processChunk();
     528        chunkIntervalIdentifier = setInterval(processChunk, 25);
     529        InjectedScript._currentSearchChunkIntervalIdentifier = chunkIntervalIdentifier;
     530    }
    531531    return true;
    532532}
Note: See TracChangeset for help on using the changeset viewer.