Changeset 141889 in webkit
- Timestamp:
- Feb 5, 2013 5:54:16 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r141888 r141889 1 2013-02-05 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: element.focus() should not focus on disabled sub-fields. 4 https://bugs.webkit.org/show_bug.cgi?id=108924 5 6 Reviewed by Kentaro Hara. 7 8 * fast/forms/date-multiple-fields/date-multiple-fields-focus-expected.txt: Added. 9 * fast/forms/date-multiple-fields/date-multiple-fields-focus.html: Added. 10 1 11 2013-02-04 Vsevolod Vlasov <vsevik@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r141888 r141889 1 2013-02-05 Kent Tamura <tkent@chromium.org> 2 3 INPUT_MULTIPLE_FIELDS_UI: element.focus() should not focus on disabled sub-fields. 4 https://bugs.webkit.org/show_bug.cgi?id=108924 5 6 Reviewed by Kentaro Hara. 7 8 The first field may be non-focusable. We should search sub-fields for 9 focusable one. 10 11 Test: fast/forms/date-multiple-fields/date-multiple-fields-focus.html 12 13 * html/shadow/DateTimeEditElement.cpp: 14 (WebCore::DateTimeEditElement::focusOnNextFocusableField): 15 Added. A private helper function. 16 (WebCore::DateTimeEditElement::focusIfNoFocus): Use focusOnNextFocusableField. 17 (WebCore::DateTimeEditElement::focusByOwner): Ditto. 18 (WebCore::DateTimeEditElement::focusOnNextField): Ditto. 19 * html/shadow/DateTimeEditElement.h: 20 (DateTimeEditElement): Declare focusOnNextFocusableField. 21 1 22 2013-02-04 Vsevolod Vlasov <vsevik@chromium.org> 2 23 -
trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp
r141866 r141889 507 507 if (focusedFieldIndex() != invalidFieldIndex) 508 508 return; 509 510 if (DateTimeFieldElement* field = fieldAt(0)) 511 field->focus(); 509 focusOnNextFocusableField(0); 512 510 } 513 511 514 512 void DateTimeEditElement::focusByOwner() 515 513 { 516 if (DateTimeFieldElement* field = fieldAt(0)) 517 field->focus(); 514 focusOnNextFocusableField(0); 518 515 } 519 516 … … 539 536 } 540 537 538 bool DateTimeEditElement::focusOnNextFocusableField(size_t startIndex) 539 { 540 for (size_t fieldIndex = startIndex; fieldIndex < m_fields.size(); ++fieldIndex) { 541 if (m_fields[fieldIndex]->isFocusable()) { 542 m_fields[fieldIndex]->focus(); 543 return true; 544 } 545 } 546 return false; 547 } 548 541 549 bool DateTimeEditElement::focusOnNextField(const DateTimeFieldElement& field) 542 550 { … … 544 552 if (startFieldIndex == invalidFieldIndex) 545 553 return false; 546 for (size_t fieldIndex = startFieldIndex + 1; fieldIndex < m_fields.size(); ++fieldIndex) { 547 if (m_fields[fieldIndex]->isFocusable()) { 548 m_fields[fieldIndex]->focus(); 549 return true; 550 } 551 } 552 return false; 554 return focusOnNextFocusableField(startFieldIndex + 1); 553 555 } 554 556 -
trunk/Source/WebCore/html/shadow/DateTimeEditElement.h
r141195 r141889 124 124 DateTimeFieldElement* focusedField() const; 125 125 size_t focusedFieldIndex() const; 126 bool focusOnNextFocusableField(size_t startIndex); 126 127 bool isDisabled() const; 127 128 bool isReadOnly() const;
Note: See TracChangeset
for help on using the changeset viewer.