Open
Bug 1228802
Opened 9 years ago
Updated 1 years ago
`focus` event shouldn't be fired at the `document` object
Categories
(Core :: DOM: Events, defect, P5)
Core
DOM: Events
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox45 | --- | affected |
People
(Reporter: mozilla, Assigned: smaug)
References
(Blocks 1 open bug, )
Details
(6 keywords)
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
Upstream Bootstrap bug report:
https://github.com/twbs/bootstrap/issues/18365
Steps to reproduce:
1. Open http://jsfiddle.net/cvrebert/mLq3vo6f/show/ in Firefox
2. Click into the <input> on the webpage
Expected console output (which is given by Chrome, Safari, Edge, IE11)
(modulo `focusin` events because bug 687787):
focus CAPTURE Window
focus WINDOW
focus CAPTURE <input type="text" id="q" value="Foo">
focus INPUT
Actual console output in Firefox:
focus CAPTURE HTMLDocument
focus DOCUMENT
focus CAPTURE Window
focus WINDOW
focus CAPTURE <input type="text" id="q" value="Foo">
focus INPUT
This indicates that Firefox is firing `focus` events at the `document` object (HTMLDocument),
which should be impossible under the HTML5 "focus update steps" algorithm (https://html.spec.whatwg.org/multipage/interaction.html#focus-update-steps ),
which says:
> If *entry* is a Document object, let *`focus` event target* be that Document object's Window object.
Additionally, this behavior doesn't match the behavior of Chrome, Safari, Edge, or IE11,
all of which don't fire `focus` events at the `document` object.
Tested in Firefox 44.0a2 (2015-11-28) on OS X 10.11.1.
Updated•9 years ago
|
Component: Untriaged → DOM: Events
See Also: → https://github.com/twbs/bootstrap/issues/18365
Whiteboard: [parity-ie][parity-edge][parity-chrome][parity-opera][parity-safari]
Reporter | ||
Comment 1•9 years ago
|
||
We had to ship a workaround for this in Bootstrap. :-(
https://github.com/twbs/bootstrap/pull/18638
Reporter | ||
Comment 2•9 years ago
|
||
This bug is present since at least OS X Firefox 3.7a5pre (2010-06-06 030908) (despite a few tries, couldn't find an earlier build in mozregression that'd open without crashing), so this isn't a regression.
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Comment 3•9 years ago
|
||
Better testcase
Comment 4•9 years ago
|
||
And UIE requirements https://w3c.github.io/uievents/#event-type-focus
Updated•9 years ago
|
Flags: needinfo?(bugs)
Assignee | ||
Comment 5•9 years ago
|
||
This is _super_ regression risky. But I guess we should try it. However it is possible that we just can't change the behavior here, it might break too many web sites.
(Of course it is trivial to filter out these focus events in scripts.)
Assignee: nobody → bugs
Comment 6•9 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #5)
> This is _super_ regression risky. But I guess we should try it. However it
> is possible that we just can't change the behavior here, it might break too
> many web sites.
We should try to assess this. :) It's an interesting bug. The risk I see is that if we are the only one to do this we break workarounds based on user agent sniffing. (to check).
Assignee | ||
Comment 7•9 years ago
|
||
Let's see how many tests break. At least the browser starts up with this and seems to even work :)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fa9d1fd1ec90
Flags: needinfo?(bugs)
Reporter | ||
Comment 8•9 years ago
|
||
Looks like the Try job got stuck at ~90% complete?
I've no familiarity with Gecko internals, but FWIW: The error messages from some of the failed tests seem to suggest there's some chrome (cursor, contenteditable ?) and extension stuff which might be using these events. Perhaps the event could be made to fire in a way that's only visible to chrome/extension content? IDK.
Reporter | ||
Updated•8 years ago
|
Has Regression Range: --- → irrelevant
Has STR: --- → yes
Comment 9•7 years ago
|
||
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Whiteboard: [parity-ie][parity-edge][parity-chrome][parity-opera][parity-safari]
Updated•6 years ago
|
Priority: -- → P5
smaug, what happened here? When debugging another bug, I came across a comment saying that the check that's the problem could be removed if this bug was fixed.
Flags: needinfo?(bugs)
Updated•2 years ago
|
Severity: normal → S3
Assignee | ||
Comment 12•1 years ago
|
||
I think we should add some telemetry for this, and if people aren't using the document level focus too much, then remove
Flags: needinfo?(smaug)
You need to log in
before you can comment on or make changes to this bug.
Description
•