public
Description: A mirror of QtWebKit
Homepage: http://trac.webkit.org/projects/webkit/wiki/QtWebKit
Clone URL: git://github.com/tronical/qtwebkit.git
        Changed Option/Alt-Up or Down in CSS editing when the value is
        near zero to jump to the next integer.

        Reviewed by Tim Hatcher.

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

        * page/inspector/StylesSidebarPane.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35678 
268f45cc-cd09-0410-ab3c-d52691b4dbfc
timothy@apple.com (author)
Mon Aug 11 21:28:16 -0700 2008
commit  2f2cde3f35eed39fc6031801a0d7a458f600a7e7
tree    4abc5f7ae250a09199d3d25e2029ad35f74d4c3d
parent  9311472d2d24f94cd2b16e403c390ea47f97b09f
...
1
2
 
 
 
 
 
 
 
 
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0
@@ -1,5 +1,16 @@
0
 2008-08-11 Anthony Ricaud <rik24d@gmail.com>
0
 
0
+ Changed Option/Alt-Up or Down in CSS editing when the value is
0
+ near zero to jump to the next integer.
0
+
0
+ Reviewed by Tim Hatcher.
0
+
0
+ https://bugs.webkit.org/show_bug.cgi?id=20326
0
+
0
+ * page/inspector/StylesSidebarPane.js:
0
+
0
+2008-08-11 Anthony Ricaud <rik24d@gmail.com>
0
+
0
         Changed the line highlight transition for an easier animation.
0
 
0
         Reviewed by Tim Hatcher.
...
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
745
746
747
...
726
727
728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
0
@@ -726,22 +726,29 @@ WebInspector.StylePropertyTreeElement.prototype = {
0
             else if (number === -1 && event.keyIdentifier === "Up")
0
                 numberNearZero = true;
0
 
0
- // Jump by 10 when shift is down or jump by 0.1 when near zero or Alt/Option is down.
0
- // Also jump by 10 for page up and down, or by 100 if shift is held with a page key.
0
- var changeAmount = 1;
0
- if (event.shiftKey && pageKeyPressed)
0
- changeAmount = 100;
0
- else if (event.shiftKey || pageKeyPressed)
0
- changeAmount = 10;
0
- else if (event.altKey || numberNearZero)
0
- changeAmount = 0.1;
0
-
0
- if (event.keyIdentifier === "Down" || event.keyIdentifier === "PageDown")
0
- changeAmount *= -1;
0
-
0
- // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.
0
- // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1.
0
- number = Number((number + changeAmount).toFixed(6));
0
+ if (numberNearZero && event.altKey && arrowKeyPressed) {
0
+ if (event.keyIdentifier === "Down")
0
+ number = Math.ceil(number - 1);
0
+ else
0
+ number = Math.floor(number + 1);
0
+ } else {
0
+ // Jump by 10 when shift is down or jump by 0.1 when near zero or Alt/Option is down.
0
+ // Also jump by 10 for page up and down, or by 100 if shift is held with a page key.
0
+ var changeAmount = 1;
0
+ if (event.shiftKey && pageKeyPressed)
0
+ changeAmount = 100;
0
+ else if (event.shiftKey || pageKeyPressed)
0
+ changeAmount = 10;
0
+ else if (event.altKey || numberNearZero)
0
+ changeAmount = 0.1;
0
+
0
+ if (event.keyIdentifier === "Down" || event.keyIdentifier === "PageDown")
0
+ changeAmount *= -1;
0
+
0
+ // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.
0
+ // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1.
0
+ number = Number((number + changeAmount).toFixed(6));
0
+ }
0
 
0
             replacementString = prefix + number + suffix;
0
         } else {

Comments

    No one has commented yet.