Commit c67613fa authored by darin's avatar darin

Reviewed by Trey.

	- fixed 3132141 -- enter key does not work with input type=image

	Made the logic handle image and submit type inputs in the same way.

        * khtml/html/html_formimpl.h: Remove unused m_clicked flags.
        * khtml/html/html_formimpl.cpp:
        (HTMLButtonElementImpl::HTMLButtonElementImpl): Remove code to set the m_clicked flag.
	The only place this flag was looked at is better handled by the m_activeSubmit flag.
        (HTMLButtonElementImpl::defaultEventHandler): Remove more m_clicked flag code.
        (HTMLInputElementImpl::HTMLInputElementImpl): Remove more m_clicked flag code.
        (HTMLInputElementImpl::isSuccessfulSubmitButton): An image is also a successful submit
	button, and unlike a submit element, it doesn't require a name because it will just submit
        x and y with no name in that case. I suppose we could rename this function, but I think it's
        still a pretty clear name even if not 100% accurate.
        (HTMLInputElementImpl::encoding): Remove use of m_clicked and use m_activeSubmit instead.
	This was the only place using m_clicked at all. Also remove bogus check for a -1 coordinate.
	The coordinate defaults to 0, not -1, and it was never happening.
        (HTMLInputElementImpl::defaultEventHandler): Remove more m_clicked flag code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 872e16f0
2002-12-30 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3132141 -- enter key does not work with input type=image
Made the logic handle image and submit type inputs in the same way.
* khtml/html/html_formimpl.h: Remove unused m_clicked flags.
* khtml/html/html_formimpl.cpp:
(HTMLButtonElementImpl::HTMLButtonElementImpl): Remove code to set the m_clicked flag.
The only place this flag was looked at is better handled by the m_activeSubmit flag.
(HTMLButtonElementImpl::defaultEventHandler): Remove more m_clicked flag code.
(HTMLInputElementImpl::HTMLInputElementImpl): Remove more m_clicked flag code.
(HTMLInputElementImpl::isSuccessfulSubmitButton): An image is also a successful submit
button, and unlike a submit element, it doesn't require a name because it will just submit
x and y with no name in that case. I suppose we could rename this function, but I think it's
still a pretty clear name even if not 100% accurate.
(HTMLInputElementImpl::encoding): Remove use of m_clicked and use m_activeSubmit instead.
This was the only place using m_clicked at all. Also remove bogus check for a -1 coordinate.
The coordinate defaults to 0, not -1, and it was never happening.
(HTMLInputElementImpl::defaultEventHandler): Remove more m_clicked flag code.
2002-12-30 David Hyatt <hyatt@apple.com>
Fix for 3129016, make sure that zero-height tables and lists
......
2002-12-30 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3132141 -- enter key does not work with input type=image
Made the logic handle image and submit type inputs in the same way.
* khtml/html/html_formimpl.h: Remove unused m_clicked flags.
* khtml/html/html_formimpl.cpp:
(HTMLButtonElementImpl::HTMLButtonElementImpl): Remove code to set the m_clicked flag.
The only place this flag was looked at is better handled by the m_activeSubmit flag.
(HTMLButtonElementImpl::defaultEventHandler): Remove more m_clicked flag code.
(HTMLInputElementImpl::HTMLInputElementImpl): Remove more m_clicked flag code.
(HTMLInputElementImpl::isSuccessfulSubmitButton): An image is also a successful submit
button, and unlike a submit element, it doesn't require a name because it will just submit
x and y with no name in that case. I suppose we could rename this function, but I think it's
still a pretty clear name even if not 100% accurate.
(HTMLInputElementImpl::encoding): Remove use of m_clicked and use m_activeSubmit instead.
This was the only place using m_clicked at all. Also remove bogus check for a -1 coordinate.
The coordinate defaults to 0, not -1, and it was never happening.
(HTMLInputElementImpl::defaultEventHandler): Remove more m_clicked flag code.
2002-12-30 David Hyatt <hyatt@apple.com>
Fix for 3129016, make sure that zero-height tables and lists
......
......@@ -856,7 +856,6 @@ QString HTMLGenericFormElementImpl::findMatchingState(QStringList &states)
HTMLButtonElementImpl::HTMLButtonElementImpl(DocumentPtr *doc, HTMLFormElementImpl *f)
: HTMLGenericFormElementImpl(doc, f)
{
m_clicked = false;
m_type = SUBMIT;
m_dirty = true;
m_activeSubmit = false;
......@@ -919,7 +918,6 @@ void HTMLButtonElementImpl::attach()
void HTMLButtonElementImpl::defaultEventHandler(EventImpl *evt)
{
if (m_type != BUTTON && (evt->id() == EventImpl::DOMACTIVATE_EVENT)) {
m_clicked = true;
if(m_form && m_type == SUBMIT) {
m_activeSubmit = true;
......@@ -997,7 +995,6 @@ HTMLInputElementImpl::HTMLInputElementImpl(DocumentPtr *doc, HTMLFormElementImpl
m_type = TEXT;
m_maxLen = -1;
m_size = 20;
m_clicked = false;
m_checked = false;
m_haveType = false;
......@@ -1299,7 +1296,7 @@ DOMString HTMLInputElementImpl::altText() const
bool HTMLInputElementImpl::isSuccessfulSubmitButton() const
{
return m_type == SUBMIT && !m_disabled && !name().isEmpty();
return !m_disabled && (m_type == IMAGE || (m_type == SUBMIT && !name().isEmpty()));
}
bool HTMLInputElementImpl::isActivatedSubmit() const
......@@ -1352,9 +1349,8 @@ bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList
case IMAGE:
if(m_clicked && clickX() != -1)
if(m_activeSubmit)
{
m_clicked = false;
QString astr(nme.isEmpty() ? QString::fromLatin1("x") : nme + ".x");
encoding += fixUpfromUnicode(codec, astr);
......@@ -1531,7 +1527,6 @@ void HTMLInputElementImpl::defaultEventHandler(EventImpl *evt)
if (!m_form || !m_render)
return;
m_clicked = true;
if (m_type == RESET) {
m_form->reset();
}
......
......@@ -218,7 +218,6 @@ protected:
QString m_currValue;
typeEnum m_type : 2;
bool m_dirty : 1;
bool m_clicked : 1;
bool m_activeSubmit : 1;
};
......@@ -321,7 +320,6 @@ protected:
short yPos;
typeEnum m_type : 4;
bool m_clicked : 1 ;
bool m_checked : 1;
bool m_haveType : 1;
bool m_activeSubmit : 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment