Changeset 50132 in webkit
- Timestamp:
- Oct 27, 2009 12:12:10 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r50119 r50132 1 2009-10-26 Daniel Bates <dbates@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=30491 6 7 Test that the <isindex> element can be submitted without being enclosed 8 within a <form> element. Also tests that the href property of the <base> 9 element can be used to direct where the submission is sent. 10 11 * http/tests/misc/isindex-with-no-form-base-href-expected.txt: Added. 12 * http/tests/misc/isindex-with-no-form-base-href.html: Added. 13 * http/tests/misc/isindex-with-no-form-expected.txt: Added. 14 * http/tests/misc/isindex-with-no-form.html: Added. 15 * http/tests/misc/resources/isindex-with-no-form-base-href-submit.html: Added. 16 * http/tests/misc/resources/isindex-with-no-form-base-href.html: Added. 17 1 18 2009-10-26 Brian Weinstein <bweinstein@apple.com> 2 19 -
trunk/WebCore/ChangeLog
r50131 r50132 1 2009-10-26 Daniel Bates <dbates@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=30491 6 7 Fixes an issue where pressing return/enter on the keyboard 8 in <isindex> does not submit it if is not within a <form>. 9 10 According to the HTML 2.0 thru HTML 4.01 spec 11 (http://www.w3.org/MarkUp/html-spec/html-spec_7.html#SEC7.5), the 12 <isindex> element does not need to be within a <form> element in 13 order to submit it. It can submitted on its own. Also, if present, 14 the href property of the <base> element will dictate where to submit 15 the value of the <isindex> element (this is analogous to the action 16 property of the <form> element). 17 18 Tests: http/tests/misc/isindex-with-no-form-base-href.html 19 http/tests/misc/isindex-with-no-form.html 20 21 * html/HTMLInputElement.cpp: 22 (WebCore::HTMLInputElement::defaultEventHandler): Calls createTemporaryFormForIsIndex() 23 to create a <form> if none is present and we are an <isindex> element. 24 (WebCore::HTMLInputElement::createTemporaryFormForIsIndex): Added. 25 * html/HTMLInputElement.h: 26 1 27 2009-10-26 Oliver Hunt <oliver@apple.com> 2 28 -
trunk/WebCore/html/HTMLInputElement.cpp
r49394 r50132 1550 1550 toRenderTextControl(r)->setEdited(false); 1551 1551 } 1552 // Form may never have been present, or may have been destroyed by the change event. 1553 if (form()) 1554 form()->submitClick(evt); 1552 1553 RefPtr<HTMLFormElement> formForSubmission = form(); 1554 // If there is no form and the element is an <isindex>, then create a temporary form just to be used for submission. 1555 if (!formForSubmission && inputType() == ISINDEX) 1556 formForSubmission = createTemporaryFormForIsIndex(); 1557 1558 // Form may never have been present, or may have been destroyed by code responding to the change event. 1559 if (formForSubmission) 1560 formForSubmission->submitClick(evt); 1561 1555 1562 evt->setDefaultHandled(); 1556 1563 return; … … 1568 1575 if (!callBaseClassEarly && !evt->defaultHandled()) 1569 1576 HTMLFormControlElementWithState::defaultEventHandler(evt); 1577 } 1578 1579 PassRefPtr<HTMLFormElement> HTMLInputElement::createTemporaryFormForIsIndex() 1580 { 1581 RefPtr<HTMLFormElement> form = new HTMLFormElement(formTag, document()); 1582 form->registerFormElement(this); 1583 form->setMethod("GET"); 1584 if (!document()->baseURL().isEmpty()) { 1585 // We treat the href property of the <base> element as the form action, as per section 7.5 1586 // "Queries and Indexes" of the HTML 2.0 spec. <http://www.w3.org/MarkUp/html-spec/html-spec_7.html#SEC7.5>. 1587 form->setAction(document()->baseURL().string()); 1588 } 1589 return form.release(); 1570 1590 } 1571 1591 -
trunk/WebCore/html/HTMLInputElement.h
r49199 r50132 257 257 virtual bool isRequiredFormControl() const; 258 258 259 PassRefPtr<HTMLFormElement> createTemporaryFormForIsIndex(); 260 259 261 #if ENABLE(DATALIST) 260 262 HTMLDataListElement* dataList() const;
Note: See TracChangeset
for help on using the changeset viewer.