Let UrlbarInput::focused use document.activeElement instead of the focused attribute
Categories
(Firefox :: Address Bar, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: dao, Assigned: dao)
References
Details
Attachments
(1 file)
To prevent needless flicker in new windows we set focused="true"
on the urlbar by default: https://searchfox.org/mozilla-central/rev/153feabebc2d13bb4c29ef8adf104ec1ebd246ae/browser/base/content/browser.xhtml#864
Since the urlbar's focused
property reflects this attribute, this could potentially confuse API users who want to know the actual focus state early during window opening.
We can address this by looking at document.activeElement
instead. One thing to point out here is that activeElement points to the focused element even in unfocused window, where we'd remove the focused
attribute. I think this is okay, maybe even preferable, but if this turns out to be a problem we could check the focused
attribute in addition to document.activeElement
.
API users who want to know the visible state instead of the actual focus state should check the attribute directly instead of using the focused
property.
Assignee | ||
Comment 1•6 years ago
|
||
Comment 3•6 years ago
|
||
bugherder |
Description
•