[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:09:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 072de1dcb52bd1c353039d719696c63d7bd9e3a2
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 14 07:43:12 2010 +0000

    2010-07-14  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Darin Fisher.
    
            <input type=number> UI: Support disabled/readonly states
            https://bugs.webkit.org/show_bug.cgi?id=38568
    
            * fast/forms/input-appearance-spinbutton-disabled-readonly.html: Added.
            * platform/chromium/test_expectations.txt:
            * platform/gtk/Skipped:
            * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.checksum: Added.
            * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png: Added.
            * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt: Added.
            * platform/mac/fast/forms/input-number-click-expected.txt:
            * platform/mac/fast/forms/input-number-click.html:
              Add tests for disabled/readonly states.
            * platform/qt/Skipped:
            * platform/win/Skipped:
    2010-07-14  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Darin Fisher.
    
            <input type=number> UI: Support disabled/readonly states
            https://bugs.webkit.org/show_bug.cgi?id=38568
    
            Implement isEnabledFormControl() and isReadOnlyFormControl() of
            SpinButtonElement. They returns the states of the parent <input> element.
            The existing isEnabledFormControl() had a bug. It didn't have 'const'
            modifier.
    
            Test: fast/forms/input-appearance-spinbutton-disabled-readonly.html
    
            * rendering/TextControlInnerElements.cpp:
            (WebCore::SpinButtonElement::defaultEventHandler):
             - If the input element is disabled or read-only, don't process events.
             - Protect 'input' object from destruction during focus().
             - Fix a hit-test issue. We don't need to add renderBox()->y() because
               'local' is relative to the RenderBox.
             - Some code cleanup
            * rendering/TextControlInnerElements.h:
            (WebCore::SpinButtonElement::isEnabledFormControl):
            (WebCore::SpinButtonElement::isReadOnlyFormControl):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63286 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3770198..c3d0d8d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-14  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        <input type=number> UI: Support disabled/readonly states
+        https://bugs.webkit.org/show_bug.cgi?id=38568
+
+        * fast/forms/input-appearance-spinbutton-disabled-readonly.html: Added.
+        * platform/chromium/test_expectations.txt:
+        * platform/gtk/Skipped:
+        * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.checksum: Added.
+        * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png: Added.
+        * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt: Added.
+        * platform/mac/fast/forms/input-number-click-expected.txt:
+        * platform/mac/fast/forms/input-number-click.html:
+          Add tests for disabled/readonly states.
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2010-07-13  Brian Weinstein  <bweinstein at apple.com>
 
         Fix Windows checkouts by shortening paths.
diff --git a/LayoutTests/fast/forms/input-appearance-spinbutton-disabled-readonly.html b/LayoutTests/fast/forms/input-appearance-spinbutton-disabled-readonly.html
new file mode 100644
index 0000000..8370415
--- /dev/null
+++ b/LayoutTests/fast/forms/input-appearance-spinbutton-disabled-readonly.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<style>
+input {
+    font-size: 20px;
+}
+</style>
+</head>
+<body>
+<p>Test appearances of spin buttons. Disabled state and read-only state should have appearances different from the normal state.</p>
+<div><label><input type=number value=0> Normal state</label></div>
+<div><label><input type=number value=0 disabled> Disabled state</label></div>
+<div><label><input type=number value=0 readonly> Read-only state</label></div>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 9f1c7c4..e31f91d 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -721,6 +721,9 @@ BUG20226 DEFER : fast/forms/datalist.html = TEXT
 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
+
 // Add support for inspector layout tests.
 BUG26734 LINUX MAC SKIP : inspector = PASS
 BUG26734 LINUX MAC SKIP : http/tests/inspector = PASS
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 84060c0..2f8c52d 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5756,6 +5756,9 @@ fast/text/fake-italic.html
 # https://bugs.webkit.org/show_bug.cgi?id=40859
 media/video-controls-rendering.html
 
+# Need to implement inner-spin-button or outer-spin-button
+fast/forms/input-appearance-spinbutton-disabled-readonly.html
+
 # https://bugs.webkit.org/show_bug.cgi?id=35350
 fast/events/show-modal-dialog-onblur-onfocus.html
 fast/harness/show-modal-dialog.html
diff --git a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.checksum b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.checksum
new file mode 100644
index 0000000..00f0e72
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.checksum
@@ -0,0 +1 @@
+6c19d4cbb52bdc4cac2e17544fdd2d94
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png
new file mode 100644
index 0000000..8a0b53a
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt
new file mode 100644
index 0000000..c7ab281
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt
@@ -0,0 +1,38 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 783x18
+          text run at (0,0) width 783: "Test appearances of spin buttons. Disabled state and read-only state should have appearances different from the normal state."
+      RenderBlock {DIV} at (0,34) size 784x33
+        RenderInline {LABEL} at (0,0) size 306x18
+          RenderTextControl {INPUT} at (2,2) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+            RenderBlock {DIV} at (196,1) size 19x27
+          RenderText {#text} at (222,10) size 84x18
+            text run at (222,10) width 84: " Normal state"
+      RenderBlock {DIV} at (0,67) size 784x33
+        RenderInline {LABEL} at (0,0) size 314x18
+          RenderTextControl {INPUT} at (2,2) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+            RenderBlock {DIV} at (196,1) size 19x27
+          RenderText {#text} at (222,10) size 92x18
+            text run at (222,10) width 92: " Disabled state"
+      RenderBlock {DIV} at (0,100) size 784x33
+        RenderInline {LABEL} at (0,0) size 324x18
+          RenderTextControl {INPUT} at (2,2) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+            RenderBlock {DIV} at (196,1) size 19x27
+          RenderText {#text} at (222,10) size 102x18
+            text run at (222,10) width 102: " Read-only state"
+layer at (13,47) size 188x23
+  RenderBlock {DIV} at (3,3) size 188x23
+    RenderText {#text} at (1,0) size 13x23
+      text run at (1,0) width 13: "0"
+layer at (13,80) size 188x23
+  RenderBlock {DIV} at (3,3) size 188x23 [color=#545454]
+    RenderText {#text} at (1,0) size 13x23
+      text run at (1,0) width 13: "0"
+layer at (13,113) size 188x23
+  RenderBlock {DIV} at (3,3) size 188x23
+    RenderText {#text} at (1,0) size 13x23
+      text run at (1,0) width 13: "0"
diff --git a/LayoutTests/platform/mac/fast/forms/input-number-click-expected.txt b/LayoutTests/platform/mac/fast/forms/input-number-click-expected.txt
index a69294d..6ddd5a0 100644
--- a/LayoutTests/platform/mac/fast/forms/input-number-click-expected.txt
+++ b/LayoutTests/platform/mac/fast/forms/input-number-click-expected.txt
@@ -4,9 +4,17 @@ Test for the spin control behavior in a type=numnber input.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+Initial value is 3.14, click the up button once
 PASS i.value is "4.14"
+Click the up button again.  The maximum value is 5.
 PASS i.value is "4.14"
+Click the down button four times
 PASS i.value is "0.14"
+Click the down button again. The minimum value is 0.
+PASS i.value is "0.14"
+Make the control "disabled" and click the up button
+PASS i.value is "0.14"
+Make the control "readOnly" and click the up button
 PASS i.value is "0.14"
 PASS successfullyParsed is true
 
diff --git a/LayoutTests/platform/mac/fast/forms/input-number-click.html b/LayoutTests/platform/mac/fast/forms/input-number-click.html
index 128e6cb..ad4ce5f 100644
--- a/LayoutTests/platform/mac/fast/forms/input-number-click.html
+++ b/LayoutTests/platform/mac/fast/forms/input-number-click.html
@@ -14,6 +14,7 @@
 description('Test for the spin control behavior in a type=numnber input.');
 
 if (window.eventSender) {
+    debug('Initial value is 3.14, click the up button once');
     // The spin control is at (130,-1) in the input element on Mac.
     // The size is 15x22.
     var i = document.getElementById('i1');
@@ -23,13 +24,13 @@ if (window.eventSender) {
     // The up button has been clicked.
     shouldBe('i.value', '"4.14"');
 
-    // Click it again.
+    debug('Click the up button again.  The maximum value is 5.');
     eventSender.mouseDown();
     eventSender.mouseUp();
     // The maximum value is 5.  So the value is not changed.
     shouldBe('i.value', '"4.14"');
 
-    // Click the down button for times.
+    debug('Click the down button four times');
     eventSender.mouseMoveTo(i.offsetLeft + i.offsetWidth - 4, i.offsetTop + 15);
     eventSender.mouseDown();
     eventSender.mouseUp();
@@ -41,10 +42,27 @@ if (window.eventSender) {
     eventSender.mouseUp();
     shouldBe('i.value', '"0.14"');
 
+    debug('Click the down button again. The minimum value is 0.');
     // The minimum value is 0.  So the value is not changed.
     eventSender.mouseDown();
     eventSender.mouseUp();
     shouldBe('i.value', '"0.14"');
+
+    debug('Make the control "disabled" and click the up button');
+    i.disabled = true;
+    eventSender.mouseMoveTo(i.offsetLeft + i.offsetWidth - 4, i.offsetTop + 4);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+    shouldBe('i.value', '"0.14"');
+    i.disabled = false;
+
+    debug('Make the control "readOnly" and click the up button');
+    i.readOnly = true;
+    eventSender.mouseMoveTo(i.offsetLeft + i.offsetWidth - 4, i.offsetTop + 4);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+    shouldBe('i.value', '"0.14"');
+    i.readOnly = false;
 } else {
   document.getElementById('console').innerHTML = 'No eventSender';
 }
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 8e5e945..0f99b62 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5442,6 +5442,9 @@ inspector/debugger-eval-while-paused.html
 # https://bugs.webkit.org/show_bug.cgi?id=41241
 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
+
 # Speech input is not yet enabled.
 fast/forms/input-appearance-numberandspeech.html
 fast/forms/input-appearance-searchandspeech.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 4f78e8d..efd7c2f 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -935,6 +935,10 @@ fast/js/sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Con
 # LayoutTestController::isPageBoxVisible, pageAreaRectInPixels, and preferredPageSizeInPixels are not implemented yet for WIN.
 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
+
 # Speech input is not yet enabled.
 fast/forms/input-appearance-numberandspeech.html
 fast/forms/input-appearance-searchandspeech.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c0ce7ca..8efd83b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-07-14  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        <input type=number> UI: Support disabled/readonly states
+        https://bugs.webkit.org/show_bug.cgi?id=38568
+
+        Implement isEnabledFormControl() and isReadOnlyFormControl() of
+        SpinButtonElement. They returns the states of the parent <input> element.
+        The existing isEnabledFormControl() had a bug. It didn't have 'const'
+        modifier.
+
+        Test: fast/forms/input-appearance-spinbutton-disabled-readonly.html
+
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::SpinButtonElement::defaultEventHandler):
+         - If the input element is disabled or read-only, don't process events.
+         - Protect 'input' object from destruction during focus().
+         - Fix a hit-test issue. We don't need to add renderBox()->y() because
+           'local' is relative to the RenderBox.
+         - Some code cleanup
+        * rendering/TextControlInnerElements.h:
+        (WebCore::SpinButtonElement::isEnabledFormControl):
+        (WebCore::SpinButtonElement::isReadOnlyFormControl):
+
 2010-07-13  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 36e30af..1e86e4d 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -278,12 +278,19 @@ void SpinButtonElement::defaultEventHandler(Event* event)
     }
     
     HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
+    if (input->disabled() || input->isReadOnlyFormControl()) {
+        if (!event->defaultHandled())
+            HTMLDivElement::defaultEventHandler(event);
+        return;
+    }
+
     IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
     if (event->type() == eventNames().clickEvent) {
         if (box->borderBoxRect().contains(local)) {
+            RefPtr<Node> protector(input);
             input->focus();
             input->select();
-            if (local.y() < box->y() + box->height() / 2)
+            if (local.y() < box->height() / 2)
                 input->stepUpFromRenderer(1);
             else
                 input->stepUpFromRenderer(-1);
@@ -298,7 +305,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
                 }
             }
             bool oldOnUpButton = m_onUpButton;
-            m_onUpButton = local.y() < box->y() + box->height() / 2;
+            m_onUpButton = local.y() < box->height() / 2;
             if (m_onUpButton != oldOnUpButton)
                 renderer()->repaint();
         } else {
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index 1884a34..fc609e5 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -98,7 +98,9 @@ private:
     SpinButtonElement(Node*);
 
     virtual bool isSpinButtonElement() const { return true; }
-    virtual bool isEnabledFormControl() { return static_cast<Element*>(shadowAncestorNode())->isEnabledFormControl(); }
+    // FIXME: shadowAncestorNode() should be const.
+    virtual bool isEnabledFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isEnabledFormControl(); }
+    virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isReadOnlyFormControl(); }
     virtual void defaultEventHandler(Event*);
 
     bool m_capturing;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list