Changeset 63286 in webkit
- Timestamp:
- Jul 14, 2010 12:43:12 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63284 r63286 1 2010-07-14 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 <input type=number> UI: Support disabled/readonly states 6 https://bugs.webkit.org/show_bug.cgi?id=38568 7 8 * fast/forms/input-appearance-spinbutton-disabled-readonly.html: Added. 9 * platform/chromium/test_expectations.txt: 10 * platform/gtk/Skipped: 11 * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.checksum: Added. 12 * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png: Added. 13 * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt: Added. 14 * platform/mac/fast/forms/input-number-click-expected.txt: 15 * platform/mac/fast/forms/input-number-click.html: 16 Add tests for disabled/readonly states. 17 * platform/qt/Skipped: 18 * platform/win/Skipped: 19 1 20 2010-07-13 Brian Weinstein <bweinstein@apple.com> 2 21 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r63272 r63286 721 721 BUG20226 DEFER : fast/forms/input-list.html = FAIL 722 722 BUG20226 DEFER : fast/forms/input-selectedoption.html = FAIL 723 724 // Need to implement inner-spin-button or outer-spin-button 725 BUGWK38570 DEFER SKIP : fast/forms/input-appearance-spinbutton-disabled-readonly.html 723 726 724 727 // Add support for inspector layout tests. -
trunk/LayoutTests/platform/gtk/Skipped
r63239 r63286 5757 5757 media/video-controls-rendering.html 5758 5758 5759 # Need to implement inner-spin-button or outer-spin-button 5760 fast/forms/input-appearance-spinbutton-disabled-readonly.html 5761 5759 5762 # https://bugs.webkit.org/show_bug.cgi?id=35350 5760 5763 fast/events/show-modal-dialog-onblur-onfocus.html -
trunk/LayoutTests/platform/mac/fast/forms/input-number-click-expected.txt
r58564 r63286 5 5 6 6 7 Initial value is 3.14, click the up button once 7 8 PASS i.value is "4.14" 9 Click the up button again. The maximum value is 5. 8 10 PASS i.value is "4.14" 11 Click the down button four times 9 12 PASS i.value is "0.14" 13 Click the down button again. The minimum value is 0. 14 PASS i.value is "0.14" 15 Make the control "disabled" and click the up button 16 PASS i.value is "0.14" 17 Make the control "readOnly" and click the up button 10 18 PASS i.value is "0.14" 11 19 PASS successfullyParsed is true -
trunk/LayoutTests/platform/mac/fast/forms/input-number-click.html
r58564 r63286 15 15 16 16 if (window.eventSender) { 17 debug('Initial value is 3.14, click the up button once'); 17 18 // The spin control is at (130,-1) in the input element on Mac. 18 19 // The size is 15x22. … … 24 25 shouldBe('i.value', '"4.14"'); 25 26 26 // Click it again.27 debug('Click the up button again. The maximum value is 5.'); 27 28 eventSender.mouseDown(); 28 29 eventSender.mouseUp(); … … 30 31 shouldBe('i.value', '"4.14"'); 31 32 32 // Click the down button for times.33 debug('Click the down button four times'); 33 34 eventSender.mouseMoveTo(i.offsetLeft + i.offsetWidth - 4, i.offsetTop + 15); 34 35 eventSender.mouseDown(); … … 42 43 shouldBe('i.value', '"0.14"'); 43 44 45 debug('Click the down button again. The minimum value is 0.'); 44 46 // The minimum value is 0. So the value is not changed. 45 47 eventSender.mouseDown(); 46 48 eventSender.mouseUp(); 47 49 shouldBe('i.value', '"0.14"'); 50 51 debug('Make the control "disabled" and click the up button'); 52 i.disabled = true; 53 eventSender.mouseMoveTo(i.offsetLeft + i.offsetWidth - 4, i.offsetTop + 4); 54 eventSender.mouseDown(); 55 eventSender.mouseUp(); 56 shouldBe('i.value', '"0.14"'); 57 i.disabled = false; 58 59 debug('Make the control "readOnly" and click the up button'); 60 i.readOnly = true; 61 eventSender.mouseMoveTo(i.offsetLeft + i.offsetWidth - 4, i.offsetTop + 4); 62 eventSender.mouseDown(); 63 eventSender.mouseUp(); 64 shouldBe('i.value', '"0.14"'); 65 i.readOnly = false; 48 66 } else { 49 67 document.getElementById('console').innerHTML = 'No eventSender'; -
trunk/LayoutTests/platform/qt/Skipped
r63270 r63286 5443 5443 fast/text/bidi-explicit-embedding-past-end.html 5444 5444 5445 # Need to implement inner-spin-button or outer-spin-button 5446 fast/forms/input-appearance-spinbutton-disabled-readonly.html 5447 5445 5448 # Speech input is not yet enabled. 5446 5449 fast/forms/input-appearance-numberandspeech.html -
trunk/LayoutTests/platform/win/Skipped
r63260 r63286 936 936 printing/page-format-data.html 937 937 938 # Need to implement inner-spin-button 939 # https://bugs.webkit.org/show_bug.cgi?id=38381 940 fast/forms/input-appearance-spinbutton-disabled-readonly.html 941 938 942 # Speech input is not yet enabled. 939 943 fast/forms/input-appearance-numberandspeech.html -
trunk/WebCore/ChangeLog
r63283 r63286 1 2010-07-14 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 <input type=number> UI: Support disabled/readonly states 6 https://bugs.webkit.org/show_bug.cgi?id=38568 7 8 Implement isEnabledFormControl() and isReadOnlyFormControl() of 9 SpinButtonElement. They returns the states of the parent <input> element. 10 The existing isEnabledFormControl() had a bug. It didn't have 'const' 11 modifier. 12 13 Test: fast/forms/input-appearance-spinbutton-disabled-readonly.html 14 15 * rendering/TextControlInnerElements.cpp: 16 (WebCore::SpinButtonElement::defaultEventHandler): 17 - If the input element is disabled or read-only, don't process events. 18 - Protect 'input' object from destruction during focus(). 19 - Fix a hit-test issue. We don't need to add renderBox()->y() because 20 'local' is relative to the RenderBox. 21 - Some code cleanup 22 * rendering/TextControlInnerElements.h: 23 (WebCore::SpinButtonElement::isEnabledFormControl): 24 (WebCore::SpinButtonElement::isReadOnlyFormControl): 25 1 26 2010-07-13 Simon Fraser <simon.fraser@apple.com> 2 27 -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r62079 r63286 279 279 280 280 HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode()); 281 if (input->disabled() || input->isReadOnlyFormControl()) { 282 if (!event->defaultHandled()) 283 HTMLDivElement::defaultEventHandler(event); 284 return; 285 } 286 281 287 IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true)); 282 288 if (event->type() == eventNames().clickEvent) { 283 289 if (box->borderBoxRect().contains(local)) { 290 RefPtr<Node> protector(input); 284 291 input->focus(); 285 292 input->select(); 286 if (local.y() < box-> y() + box->height() / 2)293 if (local.y() < box->height() / 2) 287 294 input->stepUpFromRenderer(1); 288 295 else … … 299 306 } 300 307 bool oldOnUpButton = m_onUpButton; 301 m_onUpButton = local.y() < box-> y() + box->height() / 2;308 m_onUpButton = local.y() < box->height() / 2; 302 309 if (m_onUpButton != oldOnUpButton) 303 310 renderer()->repaint(); -
trunk/WebCore/rendering/TextControlInnerElements.h
r61752 r63286 99 99 100 100 virtual bool isSpinButtonElement() const { return true; } 101 virtual bool isEnabledFormControl() { return static_cast<Element*>(shadowAncestorNode())->isEnabledFormControl(); } 101 // FIXME: shadowAncestorNode() should be const. 102 virtual bool isEnabledFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isEnabledFormControl(); } 103 virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isReadOnlyFormControl(); } 102 104 virtual void defaultEventHandler(Event*); 103 105
Note: See TracChangeset
for help on using the changeset viewer.