Title: [121918] trunk/Source/WebCore
Revision
121918
Author
pfeld...@chromium.org
Date
2012-07-05 12:44:04 -0700 (Thu, 05 Jul 2012)

Log Message

Web Inspector: move cursor to the current search match.
https://bugs.webkit.org/show_bug.cgi?id=90621

Reviewed by Vsevolod Vlasov.

After closing the search dialog, the cursor should be at the latest search match location.

* inspector/front-end/TextEditor.js:
(WebInspector.TextEditor.prototype.markAndRevealRange):
(WebInspector.TextEditor.prototype._handleFocused):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121917 => 121918)


--- trunk/Source/WebCore/ChangeLog	2012-07-05 18:20:42 UTC (rev 121917)
+++ trunk/Source/WebCore/ChangeLog	2012-07-05 19:44:04 UTC (rev 121918)
@@ -1,3 +1,16 @@
+2012-07-05  Pavel Feldman  <pfeld...@chromium.org>
+
+        Web Inspector: move cursor to the current search match.
+        https://bugs.webkit.org/show_bug.cgi?id=90621
+
+        Reviewed by Vsevolod Vlasov.
+
+        After closing the search dialog, the cursor should be at the latest search match location.
+
+        * inspector/front-end/TextEditor.js:
+        (WebInspector.TextEditor.prototype.markAndRevealRange):
+        (WebInspector.TextEditor.prototype._handleFocused):
+
 2012-07-05  Behdad Esfahbod  <beh...@behdad.org>
 
         Subpixel layout broken with spans with CSS position other than static

Modified: trunk/Source/WebCore/inspector/front-end/TextEditor.js (121917 => 121918)


--- trunk/Source/WebCore/inspector/front-end/TextEditor.js	2012-07-05 18:20:42 UTC (rev 121917)
+++ trunk/Source/WebCore/inspector/front-end/TextEditor.js	2012-07-05 19:44:04 UTC (rev 121918)
@@ -158,6 +158,8 @@
      */
     markAndRevealRange: function(range)
     {
+        if (range)
+            this._lastMarkedRange = range;
         this._mainPanel.markAndRevealRange(range);
     },
 
@@ -410,6 +412,12 @@
 
     _handleFocused: function()
     {
+        // Convert last marked range into a selection upon focus. This is needed to focus the search result.
+        if (this._lastMarkedRange) {
+            this._lastSelection = this._lastMarkedRange;
+            delete this._lastMarkedRange; 
+        }
+
         if (this._lastSelection) {
             // We do not restore selection after focus lost to avoid selection blinking. We restore only cursor position instead.
             // FIXME: consider adding selection decoration to blurred editor.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to