Summary: | Allow incrementing/decrementing numbers in editable style properties with arrow keys | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Timothy Hatcher <timothy> | ||||||
Component: | Web Inspector (Deprecated) | Assignee: | Timothy Hatcher <timothy> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Enhancement | CC: | aroben, rik | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Timothy Hatcher
2008-08-04 08:19:15 PDT
Created attachment 22637 [details]
Patch 1 of 2
Created attachment 22638 [details]
Patch 2 of 2
Comment on attachment 22637 [details]
Patch 1 of 2
I wonder if there's any way to reduce the code duplication in rangeOfWord?
r=me
Comment on attachment 22638 [details]
Patch 2 of 2
+ var wordRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset , " \t\n\"':;,/()", this.listItemElement);
I think it would really improve readability to start putting these character sets into named variables, like cssValueDelimeters or something.
+ var changeAmount = (event.shiftKey ? 10 : ((event.altKey || numberNearZero) ? 0.1 : 1));
I think this would be a little clearer as if/elseif/else.
+ if ((shorthandProperty || individualProperty) in foundProperties)
I think you should put "(shorthandProperty || individualProperty) into a local variable since you keep repeating that construct.
Do you have any test cases to land with this?
r=me
Firebug uses Page up and down to increase/decrease by ten (see http://getfirebug.com/keyboard.html). I'm not a huge fan of that shortcut but I'm mentioning this for compatibility between tools. |