Bug 145687 - Ignore radio buttons with different associated forms on keydown when the form element is descendants of main form.
Summary: Ignore radio buttons with different associated forms on keydown when the form...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-04 23:42 PDT by Rohit
Modified: 2019-02-06 22:06 PST (History)
4 users (show)

See Also:


Attachments
Patch (6.44 KB, patch)
2015-06-05 02:02 PDT, Rohit
darin: review+
rniwa: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rohit 2015-06-04 23:42:19 PDT
Currently if a new form is encountered on key down in a radio group, the pressing keydown does not jump to another next radio button in the group. We should just ignore radio buttons with different associated forms. The associated form element of a control may have a form element as one of its descendants. It can happen in case of mixing buttons from different form control groups and other elements.

Webkit should handleccomplicated cases Like, mixing buttons from different groups and other elements.

<input type=radio name=foo>
<input type=radio name=bar>
<div><input type=radio name=foo></div>

And attaching form elements to form elements
<form name=alpha>
<input type=radio name=foo>
<input type=radio name=foo>
</form>
<form name=beta>
<input type=radio name=foo>
</form>
<script>
document.alpha.appendChild(document.beta);
</script>
Comment 1 Rohit 2015-06-05 02:02:42 PDT
Created attachment 254347 [details]
Patch
Comment 2 Darin Adler 2015-06-06 22:45:23 PDT
Comment on attachment 254347 [details]
Patch

Change seems OK. One small problem is that we’ll now always traverse the entire document once we are past the last radio button. That could take a long time.
Comment 3 Rohit 2015-06-08 04:05:01 PDT
Thanks Darin. 

I am working on a patch that will cycle the radio button in a group on "downArrow"/"upArrow" keydown event when we reach the last/first radio button in a group. That should solve the entire document traversal issue. I will raise the bug and submit it soon.
Comment 4 Lucas Forschler 2019-02-06 09:18:44 PST
Mass move bugs into the DOM component.
Comment 5 Ryosuke Niwa 2019-02-06 22:06:50 PST
Comment on attachment 254347 [details]
Patch

This 3.5 year old patch is probably not going to land properly.