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

apavlov at chromium.org apavlov at chromium.org
Mon Feb 21 00:09:06 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 92aa07ddc5be61325ee722c42fef9968121cb7a0
Author: apavlov at chromium.org <apavlov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 28 15:07:09 2011 +0000

    2011-01-28  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: [STYLES] Up/Down-suggestion breaks an existing keyword
            https://bugs.webkit.org/show_bug.cgi?id=53295
    
            Select the current word suffix before switching to the next suggestion.
    
            * inspector/front-end/StylesSidebarPane.js:
            ():
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76941 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 327cc0f..7a571ec 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-28  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: [STYLES] Up/Down-suggestion breaks an existing keyword
+        https://bugs.webkit.org/show_bug.cgi?id=53295
+
+        Select the current word suffix before switching to the next suggestion.
+
+        * inspector/front-end/StylesSidebarPane.js:
+        ():
+
 2011-01-28  Alejandro G. Castro  <alex at igalia.com>
 
         Reviewed by Xan Lopez.
diff --git a/Source/WebCore/inspector/front-end/StylesSidebarPane.js b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
index 378cfd7..4dae618 100644
--- a/Source/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -1929,10 +1929,31 @@ WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {
         var reverse = event.keyIdentifier === "Up";
         if (this.autoCompleteElement)
             this.complete(false, reverse); // Accept the current suggestion, if any.
+        else {
+            // Select the word suffix to affect it when computing the subsequent suggestion.
+            this._selectCurrentWordSuffix();
+        }
+
         this.complete(false, reverse); // Actually increment/decrement the suggestion.
         event.handled = true;
     },
 
+    _selectCurrentWordSuffix: function()
+    {
+        var selection = window.getSelection();
+        if (!selection.rangeCount)
+            return;
+
+        var selectionRange = selection.getRangeAt(0);
+        if (!selectionRange.commonAncestorContainer.isDescendant(this.element))
+            return;
+        var wordSuffixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.StylesSidebarPane.StyleValueDelimiters, this.element, "forward");
+        if (!wordSuffixRange.toString())
+            return;
+        selection.removeAllRanges();
+        selection.addRange(wordSuffixRange);
+    },
+
     _buildPropertyCompletions: function(wordRange, bestMatchOnly, completionsReadyCallback)
     {
         var prefix = wordRange.toString().toLowerCase();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list