[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
tkent at chromium.org
tkent at chromium.org
Wed Dec 22 11:25:29 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 3d10af9a7242ae3e69e37c92ac06fd29b817ba4d
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jul 23 00:32:24 2010 +0000
2010-07-22 Kent Tamura <tkent at chromium.org>
Reviewed by Ojan Vafai.
<input type=number> stepper buttons should dispatch input/change events
https://bugs.webkit.org/show_bug.cgi?id=42440
* fast/forms/input-number-events-expected.txt: Added.
* fast/forms/input-number-events.html: Added.
* fast/forms/script-tests/input-number-events.js: Added.
* platform/chromium/test_expectations.txt:
* platform/gtk/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
2010-07-22 Kent Tamura <tkent at chromium.org>
Reviewed by Ojan Vafai.
<input type=number> stepper buttons should dispatch input/change events
https://bugs.webkit.org/show_bug.cgi?id=42440
Test: fast/forms/input-number-events.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::stepUpFromRenderer):
Sets a flag to dispatch 'change' event and dispatches 'input' event
if the value is changed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f8ec741..511b6b0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-07-22 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ <input type=number> stepper buttons should dispatch input/change events
+ https://bugs.webkit.org/show_bug.cgi?id=42440
+
+ * fast/forms/input-number-events-expected.txt: Added.
+ * fast/forms/input-number-events.html: Added.
+ * fast/forms/script-tests/input-number-events.js: Added.
+ * platform/chromium/test_expectations.txt:
+ * platform/gtk/Skipped:
+ * platform/qt/Skipped:
+ * platform/win/Skipped:
+
2010-07-22 Justin Schuh <jschuh at chromium.org>
Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/forms/input-number-events-expected.txt b/LayoutTests/fast/forms/input-number-events-expected.txt
new file mode 100644
index 0000000..a725863
--- /dev/null
+++ b/LayoutTests/fast/forms/input-number-events-expected.txt
@@ -0,0 +1,23 @@
+Test for event dispatching by spin buttons in a type=numnber input.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial state
+PASS changeEventCounter is 0
+PASS inputEventCounter is 0
+Click the upper button
+PASS numberInput.value is "1"
+PASS changeEventCounter is 0
+PASS inputEventCounter is 1
+Click again, but the value is not changed.
+PASS numberInput.value is "1"
+PASS changeEventCounter is 0
+PASS inputEventCounter is 1
+Focus on another field
+PASS changeEventCounter is 1
+PASS inputEventCounter is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/input-number-events.html b/LayoutTests/fast/forms/input-number-events.html
new file mode 100644
index 0000000..0bd27e1
--- /dev/null
+++ b/LayoutTests/fast/forms/input-number-events.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/input-number-events.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/script-tests/input-number-events.js b/LayoutTests/fast/forms/script-tests/input-number-events.js
new file mode 100644
index 0000000..c492e9c
--- /dev/null
+++ b/LayoutTests/fast/forms/script-tests/input-number-events.js
@@ -0,0 +1,45 @@
+description('Test for event dispatching by spin buttons in a type=numnber input.');
+
+var parent = document.createElement('div');
+document.body.appendChild(parent);
+parent.innerHTML = '<input type=number id=number value=0 max=1><input id=another>';
+var numberInput = document.getElementById('number');
+var anotherInput = document.getElementById('another');
+var inputEventCounter = 0;
+var changeEventCounter = 0;
+
+numberInput.onchange = function() { changeEventCounter++; };
+numberInput.oninput = function() { inputEventCounter++; };
+
+if (window.eventSender) {
+ debug('Initial state');
+ shouldBe('changeEventCounter', '0');
+ shouldBe('inputEventCounter', '0');
+
+ debug('Click the upper button');
+ // Move the cursor on the upper button.
+ eventSender.mouseMoveTo(numberInput.offsetLeft + numberInput.offsetWidth - 4, numberInput.offsetTop + 4);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBe('numberInput.value', '"1"');
+ shouldBe('changeEventCounter', '0');
+ shouldBe('inputEventCounter', '1');
+
+ debug('Click again, but the value is not changed.');
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBe('numberInput.value', '"1"');
+ shouldBe('changeEventCounter', '0');
+ shouldBe('inputEventCounter', '1');
+
+ debug('Focus on another field');
+ anotherInput.focus();
+ shouldBe('changeEventCounter', '1');
+ shouldBe('inputEventCounter', '1');
+
+ parent.innerHTML = '';
+} else {
+ document.getElementById('console').innerHTML = 'No eventSender';
+}
+
+var successfullyParsed = true;
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 0601d9d..0b1f4d3 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -716,7 +716,8 @@ BUG20226 DEFER : fast/forms/input-list.html = FAIL
BUG20226 DEFER : fast/forms/input-selectedoption.html = FAIL
// Need to implement inner-spin-button or outer-spin-button
-BUGWK38570 DEFER SKIP : fast/forms/input-appearance-spinbutton-disabled-readonly.html = FAIL
+BUGWK38570 : fast/forms/input-appearance-spinbutton-disabled-readonly.html = FAIL
+BUGWK38570 : fast/forms/input-number-events.html = FAIL
// Add support for inspector layout tests.
BUG26734 LINUX MAC SKIP : inspector = PASS
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index ca7fa4a..74c5baf 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5753,6 +5753,7 @@ media/video-controls-rendering.html
# Need to implement inner-spin-button or outer-spin-button
fast/forms/input-appearance-spinbutton-disabled-readonly.html
+fast/forms/input-number-events.html
# https://bugs.webkit.org/show_bug.cgi?id=35350
fast/events/show-modal-dialog-onblur-onfocus.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 6dfaba1..849f403 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5412,6 +5412,7 @@ fast/text/bidi-explicit-embedding-past-end.html
# Need to implement inner-spin-button or outer-spin-button
fast/forms/input-appearance-spinbutton-disabled-readonly.html
+fast/forms/input-number-events.html
# Speech input is not yet enabled.
fast/forms/input-appearance-numberandspeech.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 22612b3..7d95646 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -921,6 +921,7 @@ printing/page-format-data.html
# Need to implement inner-spin-button
# https://bugs.webkit.org/show_bug.cgi?id=38381
fast/forms/input-appearance-spinbutton-disabled-readonly.html
+fast/forms/input-number-events.html
# Speech input is not yet enabled.
fast/forms/input-appearance-numberandspeech.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 717938b..2961814 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-07-22 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ <input type=number> stepper buttons should dispatch input/change events
+ https://bugs.webkit.org/show_bug.cgi?id=42440
+
+ Test: fast/forms/input-number-events.html
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::stepUpFromRenderer):
+ Sets a flag to dispatch 'change' event and dispatches 'input' event
+ if the value is changed.
+
2010-07-22 Justin Schuh <jschuh at chromium.org>
Reviewed by Adam Barth.
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 2ce35b1..eca5035 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -2834,13 +2834,20 @@ void HTMLInputElement::stepUpFromRenderer(int n)
return;
const double nan = numeric_limits<double>::quiet_NaN();
- double current = parseToDouble(value(), nan);
- if (!isfinite(current)) {
+ String currentStringValue = value();
+ double current = parseToDouble(currentStringValue, nan);
+ if (!isfinite(current))
setValue(serialize(n > 0 ? minimum() : maximum()));
- return;
+ else {
+ ExceptionCode ec;
+ stepUp(n, ec);
+ }
+
+ if (currentStringValue != value()) {
+ if (renderer() && renderer()->isTextField())
+ toRenderTextControl(renderer())->setChangedSinceLastChangeEvent(true);
+ dispatchEvent(Event::create(eventNames().inputEvent, true, false));
}
- ExceptionCode ec;
- stepUp(n, ec);
}
#if ENABLE(WCSS)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list