Open Bug 1425988 Opened 7 years ago Updated 2 years ago

Resubmitting form with target attribute shifts focus to target tab

Categories

(Core :: DOM: Core & HTML, defect, P2)

57 Branch
defect

Tracking

()

People

(Reporter: alexhaan, Unassigned)

References

Details

(Keywords: regression, testcase)

Attachments

(1 file)

Attached file previewsubmittest.html
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0.1 Waterfox/56.0.1 Build ID: 20171213145345 Steps to reproduce: - Open attached file - Click first button; result: action is opened in new tab/window - Switch back to first form - Click either button again (second uses Javascript submit, just to be more complete) Actual results: Result in Firefox 57 1: Focus is switched to the second tab/window Expected results: Just like in up to Firefox 53 (possibly also 54, I forgot to bring my notes, will try to update tomorrow): Focus remains in the first tab/window, updating the target in the background. This is also how other browsers act. I combed through the release notes of the version that first acted differently and didn't read any mention about this. In our situation we can simply use PostMessage to update the target. But this is quite a change though it might seem small.
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Untriaged → HTML: Form Submission
Ever confirmed: true
Keywords: testcase
Product: Firefox → Core
Blocks: 1303838
Has Regression Range: --- → yes
Keywords: regression
Oh, you're quick! Reading that bug, that change totally makes sense. That's of course for links with the target attribute and this is about a form being submitted. Thinking about it from that point of view it totally makes sense to switch focus. Except that Chrome/ium and IE (11) then do not switch focus.
Flags: needinfo?(sawang)
Priority: -- → P2
Humm... it seems Safari & Chrome change focus on link click and window.open, but not form submission. I'm a bit reserved for changing the behavior, tho. Firefox doesn't highlight the tab on iframe navigation or hash change, so if there's another form targeting on an iframe of the new tab, submission on the 2nd form feels like nothing happened.
Flags: needinfo?(sawang)
We've discovered this behaviour in our application too. Submitting to an existing target forces the focues in the the tab: the same action in Chrome/IE doesn't do that. Any chance to have a fix in a future release ?
Component: HTML: Form Submission → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: