[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

podivilov at chromium.org podivilov at chromium.org
Sun Feb 20 22:46:58 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit c52cd4284185f06615afa9f875444b0f6fe72dd8
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 11 14:09:07 2011 +0000

    2011-01-11  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: move delayed search implementation to SourceFrame.
            https://bugs.webkit.org/show_bug.cgi?id=51753
    
            * inspector/front-end/SourceFrame.js:
            (WebInspector.SourceFrame.prototype._createViewerIfNeeded):
            (WebInspector.SourceFrame.prototype.findSearchMatches):
            (WebInspector.SourceFrame.prototype.cancelFindSearchMatches):
            * inspector/front-end/SourceView.js:
            (WebInspector.SourceView.prototype.hide):
            (WebInspector.SourceView.prototype.searchCanceled):
            (WebInspector.SourceView.prototype.performSearch.didFindSearchMatches):
            (WebInspector.SourceView.prototype.performSearch):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75497 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 6333340..27f5d05 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-11  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: move delayed search implementation to SourceFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=51753
+
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._createViewerIfNeeded):
+        (WebInspector.SourceFrame.prototype.findSearchMatches):
+        (WebInspector.SourceFrame.prototype.cancelFindSearchMatches):
+        * inspector/front-end/SourceView.js:
+        (WebInspector.SourceView.prototype.hide):
+        (WebInspector.SourceView.prototype.searchCanceled):
+        (WebInspector.SourceView.prototype.performSearch.didFindSearchMatches):
+        (WebInspector.SourceView.prototype.performSearch):
+
 2011-01-11  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/Source/WebCore/inspector/front-end/SourceFrame.js b/Source/WebCore/inspector/front-end/SourceFrame.js
index fa8441d..f4df0f9 100644
--- a/Source/WebCore/inspector/front-end/SourceFrame.js
+++ b/Source/WebCore/inspector/front-end/SourceFrame.js
@@ -222,6 +222,11 @@ WebInspector.SourceFrame.prototype = {
             delete this._lineToHighlight;
         }
 
+        if (this._delayedFindSearchMatches) {
+            this._delayedFindSearchMatches();
+            delete this._delayedFindSearchMatches;
+        }
+
         var breakpoints = this._breakpoints();
         for (var i = 0; i < breakpoints.length; ++i)
             this._addBreakpoint(breakpoints[i]);
@@ -233,22 +238,35 @@ WebInspector.SourceFrame.prototype = {
             this._textViewer.editCallback = this._editLine.bind(this);
     },
 
-    findSearchMatches: function(query)
+    findSearchMatches: function(query, finishedCallback)
     {
-        var ranges = [];
+        function doFindSearchMatches()
+        {
+            var ranges = [];
+
+            // First do case-insensitive search.
+            var regexObject = createSearchRegex(query);
+            this._collectRegexMatches(regexObject, ranges);
+
+            // Then try regex search if user knows the / / hint.
+            try {
+                if (/^\/.*\/$/.test(query))
+                    this._collectRegexMatches(new RegExp(query.substring(1, query.length - 1)), ranges);
+            } catch (e) {
+                // Silent catch.
+            }
+            finishedCallback(ranges);
+        }
 
-        // First do case-insensitive search.
-        var regexObject = createSearchRegex(query);
-        this._collectRegexMatches(regexObject, ranges);
+        if (this._textViewer)
+            doFindSearchMatches.call(this);
+        else
+            this._delayedFindSearchMatches = doFindSearchMatches.bind(this);
+    },
 
-        // Then try regex search if user knows the / / hint.
-        try {
-            if (/^\/.*\/$/.test(query))
-                this._collectRegexMatches(new RegExp(query.substring(1, query.length - 1)), ranges);
-        } catch (e) {
-            // Silent catch.
-        }
-        return ranges;
+    cancelFindSearchMatches: function()
+    {
+        delete this._delayedFindSearchMatches;
     },
 
     _collectRegexMatches: function(regexObject, ranges)
diff --git a/Source/WebCore/inspector/front-end/SourceView.js b/Source/WebCore/inspector/front-end/SourceView.js
index 7a97db2..1e4ef5d 100644
--- a/Source/WebCore/inspector/front-end/SourceView.js
+++ b/Source/WebCore/inspector/front-end/SourceView.js
@@ -59,8 +59,7 @@ WebInspector.SourceView.prototype = {
     hide: function()
     {
         this.sourceFrame.visible = false;
-        if (!this._frameNeedsSetup)
-            this.sourceFrame.clearLineHighlight();
+        this.sourceFrame.clearLineHighlight();
         WebInspector.View.prototype.hide.call(this);
         this._currentSearchResultIndex = -1;
     },
@@ -125,7 +124,7 @@ WebInspector.SourceView.prototype = {
         this._currentSearchResultIndex = -1;
         this._searchResults = [];
         this.sourceFrame.clearMarkedRange();
-        delete this._delayedFindSearchMatches;
+        this.sourceFrame.cancelFindSearchMatches();
     },
 
     performSearch: function(query, finishedCallback)
@@ -133,23 +132,14 @@ WebInspector.SourceView.prototype = {
         // Call searchCanceled since it will reset everything we need before doing a new search.
         this.searchCanceled();
 
-        this._searchFinishedCallback = finishedCallback;
-
-        function findSearchMatches(query, finishedCallback)
+        function didFindSearchMatches(searchResults)
         {
-            this._searchResults = this.sourceFrame.findSearchMatches(query);
+            this._searchResults = searchResults;
             if (this._searchResults)
                 finishedCallback(this, this._searchResults.length);
         }
 
-        if (!this._sourceFrameSetup) {
-            // The search is performed in _sourceFrameSetupFinished by calling _delayedFindSearchMatches.
-            this._delayedFindSearchMatches = findSearchMatches.bind(this, query, finishedCallback);
-            this.setupSourceFrameIfNeeded();
-            return;
-        }
-
-        findSearchMatches.call(this, query, finishedCallback);
+        this.sourceFrame.findSearchMatches(query, didFindSearchMatches.bind(this));
     },
 
     jumpToFirstSearchResult: function()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list