[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 09:44:18 PST 2011


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





--- Comment #8 from Mathias Bynens <mathias at qiwi.be>  2011-01-31 09:44:17 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?

>> LayoutTests/fast/forms/implicit-submission.html:-19
>> -    [ "Text input and text area and a disabled submit, text input focused", "!text,textarea,-submit", "y" ], // match IE, not FF.
> 
> Aha. This is interesting. So this change may break sites, expecting IE behavior?

The spec states that if the only submit button in a form is disabled, it shouldn’t submit implicitly. If there are no submit buttons at all, implicit submission should still work. This patch would make it so.

So yes, it would break sites that rely on IE-style behavior for forms that only have disabled submit buttons. (Not that it matters, but that sure sounds like an edge case to me.) For this particular case, it would instead match Firefox and Opera’s behavior, which happens to conform to the HTML spec and also makes much more sense.

Would this change be acceptable or not?

-- 
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