[Webkit-unassigned] [Bug 53296] Implicit form submission shouldn’t work when the default button is disabled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 31 16:44:11 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=53296





--- Comment #13 from Mathias Bynens <mathias at qiwi.be>  2011-01-31 16:44:11 PST ---
(From update of attachment 80632)
View in context: https://bugs.webkit.org/attachment.cgi?id=80632&action=review

>>>> Source/WebCore/html/HTMLFormElement.cpp:188
>>>> +        if (formElement->getAttribute(typeAttr).lower() == "submit" || formElement->hasLocalName(buttonTag)) {
>>> 
>>> This is horrible. We shouldn't need to reach into attributes at this level. Why did you change this?
>> 
>> I didn’t change this — it’s new code.
>> Why did I write it like this? I simply don’t know of a better way. There’s no `isSubmitButton()` method. Should I add one? Any suggestions?
> 
> Yes -- you can plumb HTMLInputElement::isSubmitButton() and remove the use of isSuccessfulSubmitButton altogether. Just check for disabled().
> 
> Also, you don't need two variables here. Increment when found, decrement if disabled. You only need to make sure that there's at least one non-disabled submit button.

…or none at all, in which case implicit submission should still work. This is why I used two variables. Am I missing something?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list