Changeset 141395 in webkit
- Timestamp:
- Jan 31, 2013 3:17:40 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r141393 r141395 1 2013-01-31 Kent Tamura <tkent@chromium.org> 2 3 Click on a label element won't select input[type=date] 4 https://bugs.webkit.org/show_bug.cgi?id=108428 5 6 Reviewed by Kentaro Hara. 7 8 * fast/forms/date/date-click-on-label-expected.txt: Added. 9 * fast/forms/date/date-click-on-label.html: Added. 10 1 11 2013-01-30 Yury Semikhatsky <yurys@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r141394 r141395 1 2013-01-31 Kent Tamura <tkent@chromium.org> 2 3 Click on a label element won't select input[type=date] 4 https://bugs.webkit.org/show_bug.cgi?id=108428 5 6 Reviewed by Kentaro Hara. 7 8 date/time input types with INPUT_MULTIPLE_FIELDS_UI are not 9 mouse-focusable. <input> as a shadow host never gets focus and 10 sub-fields in its shadow tree are focusable. Howevever, the click 11 handling of <label> checked isMouseFocusable. We introduce new function 12 isFocusableByClickOnLabel to HTMLElement. It's default implementation is 13 same as isMouseFocusable, and we add special handling for 14 BaseMultipleFieldsDateAndTimeInputType::isFocusableByClickOnLabel. 15 16 Also, date/time input types without INPUT_MULTIPLE_FIELDS_UI were not 17 mouse-focusable by a mistake. It should be mouse-focusable. 18 19 Test: fast/forms/date/date-click-on-label.html 20 21 * html/HTMLElement.cpp: 22 (WebCore::HTMLElement::isFocusableByClickOnLabel): 23 Added. Just calls isMouseFocusable. 24 * html/HTMLElement.h: 25 (HTMLElement): Declare isFocusableByClickOnLabel. 26 * html/HTMLLabelElement.cpp: 27 (WebCore::HTMLLabelElement::defaultEventHandler): 28 Calls isFocusableByClickOnLabel instead of isMouseFocusable. 29 30 * html/HTMLInputElement.cpp: 31 (WebCore::HTMLInputElement::isFocusableByClickOnLabel): 32 Delegate to InputType::isFocusableByClickOnLabel. 33 * html/HTMLInputElement.h: 34 (HTMLInputElement): Declare isFocusableByClickOnLabel. 35 * html/InputType.cpp: 36 (WebCore::InputType::isFocusableByClickOnLabel): 37 Added. Calls isMouseFocusable. 38 * html/InputType.h: 39 (InputType): Declare isFocusableByClickOnLabel. 40 41 * html/BaseMultipleFieldsDateAndTimeInputType.cpp: 42 (WebCore::BaseMultipleFieldsDateAndTimeInputType::isFocusableByClickOnLabel): 43 Added. Use the same logic with textfields. 44 * html/BaseMultipleFieldsDateAndTimeInputType.h: 45 (BaseMultipleFieldsDateAndTimeInputType): Declare isFocusableByClickOnLabel. 46 * html/BaseChooserOnlyDateAndTimeInputType.cpp: 47 (WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable): 48 Added. Use the same logic with textfields. 49 * html/BaseChooserOnlyDateAndTimeInputType.h: 50 (BaseChooserOnlyDateAndTimeInputType): Declare isMouseFocusable. 51 1 52 2013-01-31 Kentaro Hara <haraken@chromium.org> 2 53 -
trunk/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
r140385 r141395 132 132 } 133 133 134 bool BaseChooserOnlyDateAndTimeInputType::isMouseFocusable() const 135 { 136 return element()->isTextFormControlFocusable(); 137 } 138 134 139 } 135 140 #endif -
trunk/Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.h
r139424 r141395 53 53 virtual void handleKeyupEvent(KeyboardEvent*) OVERRIDE; 54 54 virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE; 55 virtual bool isMouseFocusable() const OVERRIDE; 55 56 56 57 // DateTimeChooserClient functions: -
trunk/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp
r141195 r141395 284 284 } 285 285 286 bool BaseMultipleFieldsDateAndTimeInputType::isFocusableByClickOnLabel() const 287 { 288 return element()->isTextFormControlFocusable(); 289 } 290 286 291 bool BaseMultipleFieldsDateAndTimeInputType::isKeyboardFocusable(KeyboardEvent*) const 287 292 { -
trunk/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h
r141195 r141395 87 87 virtual bool hasBadInput() const OVERRIDE; 88 88 virtual bool hasCustomFocusLogic() const OVERRIDE FINAL; 89 virtual bool isFocusableByClickOnLabel() const OVERRIDE; 89 90 virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE FINAL; 90 91 virtual bool isMouseFocusable() const OVERRIDE FINAL; -
trunk/Source/WebCore/html/HTMLElement.cpp
r140436 r141395 1164 1164 } 1165 1165 1166 bool HTMLElement::isFocusableByClickOnLabel() const 1167 { 1168 return isMouseFocusable(); 1169 } 1170 1166 1171 } // namespace WebCore 1167 1172 -
trunk/Source/WebCore/html/HTMLElement.h
r140436 r141395 108 108 109 109 virtual bool isLabelable() const { return false; } 110 virtual bool isFocusableByClickOnLabel() const; 110 111 111 112 protected: -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r141228 r141395 1233 1233 } 1234 1234 1235 bool HTMLInputElement::isFocusableByClickOnLabel() const 1236 { 1237 return m_inputType->isFocusableByClickOnLabel(); 1238 } 1239 1235 1240 String HTMLInputElement::defaultValue() const 1236 1241 { -
trunk/Source/WebCore/html/HTMLInputElement.h
r141277 r141395 361 361 362 362 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; 363 363 virtual bool isFocusableByClickOnLabel() const OVERRIDE; 364 364 virtual bool isInRange() const; 365 365 virtual bool isOutOfRange() const; -
trunk/Source/WebCore/html/HTMLLabelElement.cpp
r137406 r141395 137 137 element->dispatchSimulatedClick(evt); 138 138 139 // If the control can be focused via the mouse, then do that too. 140 if (element->isMouseFocusable()) 139 if (element->isFocusableByClickOnLabel()) 141 140 element->focus(); 142 141 -
trunk/Source/WebCore/html/InputType.cpp
r141195 r141395 548 548 } 549 549 550 bool InputType::isFocusableByClickOnLabel() const 551 { 552 return isMouseFocusable(); 553 } 554 550 555 bool InputType::isKeyboardFocusable(KeyboardEvent* event) const 551 556 { -
trunk/Source/WebCore/html/InputType.h
r141195 r141395 202 202 virtual PassRefPtr<HTMLFormElement> formForSubmission() const; 203 203 virtual bool hasCustomFocusLogic() const; 204 virtual bool isFocusableByClickOnLabel() const; 204 205 virtual bool isKeyboardFocusable(KeyboardEvent*) const; 205 206 virtual bool isMouseFocusable() const;
Note: See TracChangeset
for help on using the changeset viewer.