[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
tkent at chromium.org
tkent at chromium.org
Sun Feb 20 23:52:05 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 1b27cba52b01de6a410d24323cd3d98d5a2eccb1
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 26 03:50:52 2011 +0000
2011-01-25 Kent Tamura <tkent at chromium.org>
Reviewed by Dimitri Glazkov.
Range and number inputs should reject increment and decrement by
keyboard or mouse wheel if they are disabled or read-only
https://bugs.webkit.org/show_bug.cgi?id=53151
Add checks for 'disabled' and 'readOnly'.
* fast/forms/input-number-keyoperation-expected.txt:
* fast/forms/input-number-wheel-expected.txt:
* fast/forms/range-keyoperation-expected.txt:
* fast/forms/range-keyoperation.html:
* fast/forms/script-tests/input-number-keyoperation.js:
* fast/forms/script-tests/input-number-wheel.js:
2011-01-25 Kent Tamura <tkent at chromium.org>
Reviewed by Dimitri Glazkov.
Range and number inputs should reject increment and decrement by
keyboard or mouse wheel if they are disabled or read-only
https://bugs.webkit.org/show_bug.cgi?id=53151
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleKeydownEvent): Check disabled() and readOnly().
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleKeydownEventForSpinButton): ditto.
(WebCore::TextFieldInputType::handleWheelEventForSpinButton): ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7c23672..c90b42a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-25 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Range and number inputs should reject increment and decrement by
+ keyboard or mouse wheel if they are disabled or read-only
+ https://bugs.webkit.org/show_bug.cgi?id=53151
+
+ Add checks for 'disabled' and 'readOnly'.
+
+ * fast/forms/input-number-keyoperation-expected.txt:
+ * fast/forms/input-number-wheel-expected.txt:
+ * fast/forms/range-keyoperation-expected.txt:
+ * fast/forms/range-keyoperation.html:
+ * fast/forms/script-tests/input-number-keyoperation.js:
+ * fast/forms/script-tests/input-number-wheel.js:
+
2011-01-25 Cris Neckar <cdn at chromium.org>
Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/forms/input-number-keyoperation-expected.txt b/LayoutTests/fast/forms/input-number-keyoperation-expected.txt
index fca556b..221ce6f 100644
--- a/LayoutTests/fast/forms/input-number-keyoperation-expected.txt
+++ b/LayoutTests/fast/forms/input-number-keyoperation-expected.txt
@@ -9,6 +9,10 @@ Press the up arrow key:
PASS input.value is "124"
Press the down arrow key:
PASS input.value is "123"
+Disable input element:
+PASS input.value is "123"
+Read-only input element:
+PASS input.value is "123"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/forms/input-number-wheel-expected.txt b/LayoutTests/fast/forms/input-number-wheel-expected.txt
index 0d0dcae..0ea6229 100644
--- a/LayoutTests/fast/forms/input-number-wheel-expected.txt
+++ b/LayoutTests/fast/forms/input-number-wheel-expected.txt
@@ -11,6 +11,10 @@ Wheel down by 1:
PASS input.value is "1"
Wheel down by 256:
PASS input.value is "0"
+Disabled input element:
+PASS input.value is "0"
+Read-only input element:
+PASS input.value is "0"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/forms/range-keyoperation-expected.txt b/LayoutTests/fast/forms/range-keyoperation-expected.txt
index 723970e..7f91f82 100644
--- a/LayoutTests/fast/forms/range-keyoperation-expected.txt
+++ b/LayoutTests/fast/forms/range-keyoperation-expected.txt
@@ -44,6 +44,10 @@ PASS input.value is "0"
PASS changeEventCounter is lastChangeEventCounter
PASS input.value is "2"
+Disabled and read-only
+PASS input.value is "1"
+PASS input.value is "1"
+
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/forms/range-keyoperation.html b/LayoutTests/fast/forms/range-keyoperation.html
index 7d90e3b..2f912d9 100644
--- a/LayoutTests/fast/forms/range-keyoperation.html
+++ b/LayoutTests/fast/forms/range-keyoperation.html
@@ -122,6 +122,20 @@ sendKey(input, 'Up');
shouldBe('input.value', '"2"');
debug('');
+debug('Disabled and read-only');
+input.disabled = true;
+input.value = '1';
+input.step = '1';
+input.min = '0';
+input.max = '100';
+sendKey(input, 'Up');
+shouldBe('input.value', '"1"');
+input.removeAttribute('disabled');
+input.readOnly = true;
+sendKey(input, 'Up');
+shouldBe('input.value', '"1"');
+
+debug('');
var successfullyParsed = true;
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
diff --git a/LayoutTests/fast/forms/script-tests/input-number-keyoperation.js b/LayoutTests/fast/forms/script-tests/input-number-keyoperation.js
index c4ed7a0..f84151d 100644
--- a/LayoutTests/fast/forms/script-tests/input-number-keyoperation.js
+++ b/LayoutTests/fast/forms/script-tests/input-number-keyoperation.js
@@ -17,4 +17,15 @@ debug('Press the down arrow key:');
eventSender.keyDown('downArrow');
shouldBe('input.value', '"123"');
+debug('Disable input element:');
+input.disabled = true;
+eventSender.keyDown('upArrow');
+shouldBe('input.value', '"123"');
+input.removeAttribute('disabled');
+
+debug('Read-only input element:');
+input.readOnly = true;
+eventSender.keyDown('upArrow');
+shouldBe('input.value', '"123"');
+
var successfullyParsed = true;
diff --git a/LayoutTests/fast/forms/script-tests/input-number-wheel.js b/LayoutTests/fast/forms/script-tests/input-number-wheel.js
index 64741fb..9f07f51 100644
--- a/LayoutTests/fast/forms/script-tests/input-number-wheel.js
+++ b/LayoutTests/fast/forms/script-tests/input-number-wheel.js
@@ -29,4 +29,15 @@ debug('Wheel down by 256:');
dispatchWheelEvent(input, 0, -256);
shouldBe('input.value', '"0"');
+debug('Disabled input element:');
+input.disabled = true;
+dispatchWheelEvent(input, 0, 1);
+shouldBe('input.value', '"0"');
+input.removeAttribute('disabled');
+
+debug('Read-only input element:');
+input.readOnly = true;
+dispatchWheelEvent(input, 0, 1);
+shouldBe('input.value', '"0"');
+
var successfullyParsed = true;
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 999cc21..b2f683a 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -2,6 +2,20 @@
Reviewed by Dimitri Glazkov.
+ Range and number inputs should reject increment and decrement by
+ keyboard or mouse wheel if they are disabled or read-only
+ https://bugs.webkit.org/show_bug.cgi?id=53151
+
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::handleKeydownEvent): Check disabled() and readOnly().
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::handleKeydownEventForSpinButton): ditto.
+ (WebCore::TextFieldInputType::handleWheelEventForSpinButton): ditto.
+
+2011-01-25 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
API to support localized numbers for <input type=number>
https://bugs.webkit.org/show_bug.cgi?id=45730
diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp
index a492ce6..cf749bc 100644
--- a/Source/WebCore/html/RangeInputType.cpp
+++ b/Source/WebCore/html/RangeInputType.cpp
@@ -154,6 +154,8 @@ void RangeInputType::handleMouseDownEvent(MouseEvent* event)
void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
{
+ if (element()->disabled() || element()->readOnly())
+ return;
const String& key = event->keyIdentifier();
if (key != "Up" && key != "Right" && key != "Down" && key != "Left")
return;
diff --git a/Source/WebCore/html/TextFieldInputType.cpp b/Source/WebCore/html/TextFieldInputType.cpp
index 54527b1..0220a64 100644
--- a/Source/WebCore/html/TextFieldInputType.cpp
+++ b/Source/WebCore/html/TextFieldInputType.cpp
@@ -64,6 +64,8 @@ void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event)
void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
{
+ if (element()->disabled() || element()->readOnly())
+ return;
const String& key = event->keyIdentifier();
int step = 0;
if (key == "Up")
@@ -78,6 +80,8 @@ void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
void TextFieldInputType::handleWheelEventForSpinButton(WheelEvent* event)
{
+ if (element()->disabled() || element()->readOnly())
+ return;
int step = 0;
if (event->wheelDeltaY() > 0)
step = 1;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list