Changeset 76662 in webkit
- Timestamp:
- Jan 25, 2011 7:50:52 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76652 r76662 1 2011-01-25 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Range and number inputs should reject increment and decrement by 6 keyboard or mouse wheel if they are disabled or read-only 7 https://bugs.webkit.org/show_bug.cgi?id=53151 8 9 Add checks for 'disabled' and 'readOnly'. 10 11 * fast/forms/input-number-keyoperation-expected.txt: 12 * fast/forms/input-number-wheel-expected.txt: 13 * fast/forms/range-keyoperation-expected.txt: 14 * fast/forms/range-keyoperation.html: 15 * fast/forms/script-tests/input-number-keyoperation.js: 16 * fast/forms/script-tests/input-number-wheel.js: 17 1 18 2011-01-25 Cris Neckar <cdn@chromium.org> 2 19 -
trunk/LayoutTests/fast/forms/input-number-keyoperation-expected.txt
r63586 r76662 10 10 Press the down arrow key: 11 11 PASS input.value is "123" 12 Disable input element: 13 PASS input.value is "123" 14 Read-only input element: 15 PASS input.value is "123" 12 16 PASS successfullyParsed is true 13 17 -
trunk/LayoutTests/fast/forms/input-number-wheel-expected.txt
r64616 r76662 12 12 Wheel down by 256: 13 13 PASS input.value is "0" 14 Disabled input element: 15 PASS input.value is "0" 16 Read-only input element: 17 PASS input.value is "0" 14 18 PASS successfullyParsed is true 15 19 -
trunk/LayoutTests/fast/forms/range-keyoperation-expected.txt
r68024 r76662 45 45 PASS input.value is "2" 46 46 47 Disabled and read-only 48 PASS input.value is "1" 49 PASS input.value is "1" 50 47 51 PASS successfullyParsed is true 48 52 -
trunk/LayoutTests/fast/forms/range-keyoperation.html
r68024 r76662 123 123 124 124 debug(''); 125 debug('Disabled and read-only'); 126 input.disabled = true; 127 input.value = '1'; 128 input.step = '1'; 129 input.min = '0'; 130 input.max = '100'; 131 sendKey(input, 'Up'); 132 shouldBe('input.value', '"1"'); 133 input.removeAttribute('disabled'); 134 input.readOnly = true; 135 sendKey(input, 'Up'); 136 shouldBe('input.value', '"1"'); 137 138 debug(''); 125 139 var successfullyParsed = true; 126 140 </script> -
trunk/LayoutTests/fast/forms/script-tests/input-number-keyoperation.js
r63586 r76662 18 18 shouldBe('input.value', '"123"'); 19 19 20 debug('Disable input element:'); 21 input.disabled = true; 22 eventSender.keyDown('upArrow'); 23 shouldBe('input.value', '"123"'); 24 input.removeAttribute('disabled'); 25 26 debug('Read-only input element:'); 27 input.readOnly = true; 28 eventSender.keyDown('upArrow'); 29 shouldBe('input.value', '"123"'); 30 20 31 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/input-number-wheel.js
r64616 r76662 30 30 shouldBe('input.value', '"0"'); 31 31 32 debug('Disabled input element:'); 33 input.disabled = true; 34 dispatchWheelEvent(input, 0, 1); 35 shouldBe('input.value', '"0"'); 36 input.removeAttribute('disabled'); 37 38 debug('Read-only input element:'); 39 input.readOnly = true; 40 dispatchWheelEvent(input, 0, 1); 41 shouldBe('input.value', '"0"'); 42 32 43 var successfullyParsed = true; -
trunk/Source/WebCore/ChangeLog
r76661 r76662 1 2011-01-25 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Range and number inputs should reject increment and decrement by 6 keyboard or mouse wheel if they are disabled or read-only 7 https://bugs.webkit.org/show_bug.cgi?id=53151 8 9 * html/RangeInputType.cpp: 10 (WebCore::RangeInputType::handleKeydownEvent): Check disabled() and readOnly(). 11 * html/TextFieldInputType.cpp: 12 (WebCore::TextFieldInputType::handleKeydownEventForSpinButton): ditto. 13 (WebCore::TextFieldInputType::handleWheelEventForSpinButton): ditto. 14 1 15 2011-01-25 Kent Tamura <tkent@chromium.org> 2 16 -
trunk/Source/WebCore/html/RangeInputType.cpp
r76147 r76662 155 155 void RangeInputType::handleKeydownEvent(KeyboardEvent* event) 156 156 { 157 if (element()->disabled() || element()->readOnly()) 158 return; 157 159 const String& key = event->keyIdentifier(); 158 160 if (key != "Up" && key != "Right" && key != "Down" && key != "Left") -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r74895 r76662 65 65 void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event) 66 66 { 67 if (element()->disabled() || element()->readOnly()) 68 return; 67 69 const String& key = event->keyIdentifier(); 68 70 int step = 0; … … 79 81 void TextFieldInputType::handleWheelEventForSpinButton(WheelEvent* event) 80 82 { 83 if (element()->disabled() || element()->readOnly()) 84 return; 81 85 int step = 0; 82 86 if (event->wheelDeltaY() > 0)
Note: See TracChangeset
for help on using the changeset viewer.