[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 12:33:17 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2f1e6410eba7b23ff99e9a560db603d8eb24d47f
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 25 08:38:49 2010 +0000
Fix a bug that a spin-button doesn't release mouse capturing
https://bugs.webkit.org/show_bug.cgi?id=44411
Reviewed by Shinichiro Hamaji
WebCore:
- LeftButton should be checked only for clickEvent.
Note that this change doesn't change the behavior because
button() value is initialized with LeftButton even for
mousemoveEvent.
- Should pass a SpinButtonElement node to setCapturingMouseEventsNode().
Test: fast/forms/input-spinbutton-capturing.html
* rendering/TextControlInnerElements.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
LayoutTests:
* fast/forms/input-spinbutton-capturing-expected.txt: Added.
* fast/forms/input-spinbutton-capturing.html: Added.
* fast/forms/script-tests/input-spinbutton-capturing.js: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f3573f0..6c53f1e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-25 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Shinichiro Hamaji
+
+ Fix a bug that a spin-button doesn't release mouse capturing
+ https://bugs.webkit.org/show_bug.cgi?id=44411
+
+ * fast/forms/input-spinbutton-capturing-expected.txt: Added.
+ * fast/forms/input-spinbutton-capturing.html: Added.
+ * fast/forms/script-tests/input-spinbutton-capturing.js: Added.
+
2010-08-25 Gavin Peters <gavinp at chromium.org>
Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/forms/input-spinbutton-capturing-expected.txt b/LayoutTests/fast/forms/input-spinbutton-capturing-expected.txt
new file mode 100644
index 0000000..a80973b
--- /dev/null
+++ b/LayoutTests/fast/forms/input-spinbutton-capturing-expected.txt
@@ -0,0 +1,10 @@
+Test for a capturing bug of spin buttons in a type=numnber input.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS anotherInput.value is "2"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/input-spinbutton-capturing.html b/LayoutTests/fast/forms/input-spinbutton-capturing.html
new file mode 100644
index 0000000..4982d19
--- /dev/null
+++ b/LayoutTests/fast/forms/input-spinbutton-capturing.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-spinbutton-capturing.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/script-tests/input-spinbutton-capturing.js b/LayoutTests/fast/forms/script-tests/input-spinbutton-capturing.js
new file mode 100644
index 0000000..fc1ca9c
--- /dev/null
+++ b/LayoutTests/fast/forms/script-tests/input-spinbutton-capturing.js
@@ -0,0 +1,26 @@
+description('Test for a capturing bug of 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 min=0 max=100><input type=number id=another value=1 min=0 max=100>';
+var numberInput = document.getElementById('number');
+var anotherInput = document.getElementById('another');
+
+if (window.eventSender) {
+ // Move the cursor on the upper button of the first input field.
+ eventSender.mouseMoveTo(numberInput.offsetLeft + numberInput.offsetWidth - 10, numberInput.offsetTop + numberInput.offsetHeight / 4);
+
+ // Move the cursor on the upper button of another input field, and click.
+ // There was a bug that a capturing flag of the first input field was not
+ // clear and this click didn't work.
+ eventSender.mouseMoveTo(anotherInput.offsetLeft + anotherInput.offsetWidth - 10, anotherInput.offsetTop + anotherInput.offsetHeight / 4);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ shouldBe('anotherInput.value', '"2"');
+
+ parent.innerHTML = '';
+} else {
+ document.getElementById('console').innerHTML = '<p>No eventSender. <p>Manual test instruction: Click the upper button of the first input field, then click the upper button of the second input field. Confirm that the second input field value is changed.';
+}
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 89562af..4689ec9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-25 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Shinichiro Hamaji
+
+ Fix a bug that a spin-button doesn't release mouse capturing
+ https://bugs.webkit.org/show_bug.cgi?id=44411
+
+ - LeftButton should be checked only for clickEvent.
+ Note that this change doesn't change the behavior because
+ button() value is initialized with LeftButton even for
+ mousemoveEvent.
+ - Should pass a SpinButtonElement node to setCapturingMouseEventsNode().
+
+ Test: fast/forms/input-spinbutton-capturing.html
+
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::SpinButtonElement::defaultEventHandler):
+
2010-08-16 Gabor Loki <loki at webkit.org>
Reviewed by Gavin Barraclough.
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 82de5d9..5f1f099 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -274,13 +274,6 @@ void SpinButtonElement::defaultEventHandler(Event* event)
return;
}
- MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
- if (mouseEvent->button() != LeftButton) {
- if (!event->defaultHandled())
- HTMLDivElement::defaultEventHandler(event);
- return;
- }
-
RenderBox* box = renderBox();
if (!box) {
if (!event->defaultHandled())
@@ -288,6 +281,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
return;
}
+ MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
if (input->disabled() || input->isReadOnlyFormControl()) {
if (!event->defaultHandled())
@@ -296,7 +290,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
}
IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
- if (event->type() == eventNames().clickEvent) {
+ if (event->type() == eventNames().clickEvent && mouseEvent->button() == LeftButton) {
if (box->borderBoxRect().contains(local)) {
RefPtr<Node> protector(input);
input->focus();
@@ -311,7 +305,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
if (box->borderBoxRect().contains(local)) {
if (!m_capturing) {
if (Frame* frame = document()->frame()) {
- frame->eventHandler()->setCapturingMouseEventsNode(input);
+ frame->eventHandler()->setCapturingMouseEventsNode(this);
m_capturing = true;
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list