PanelMultiView is producing console warnings when it passes the "context" attribute's empty value to getElementById
Categories
(Firefox :: Toolbars and Customization, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: aminomancer, Assigned: aminomancer)
Details
Attachments
(1 file)
This code is evaluating to this.document.getElementById("")
in cases when we navigate with the keyboard on elements that don't have their own context
attribute. This can be seen when tabbing through the static buttons in various panels. Passing an empty string to this method dispatches this console warning: Empty string passed to getElementById().
For example, in the History panel menu, there are 3 static buttons at the top: Recently closed tabs, Recently closed windows, and Clear recent history. Then there are a bunch of dynamically generated history entries. When we tab through the history entries there are no problems, since they each have their own context
attribute, set by the method that creates the nodes from the history query. But the static items have no attribute.
In that case, focus.closest("[context]")
scans up to the panel itself, which has an empty context attribute that's intended to keep us from showing the toolbar context menu. So that's how we're getting an empty string to pass. To fix it, we just need to check that the context
value is truthy, not just the contextNode
.
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/7bdabd03250f Fix PanelMultiView console warnings. r=Gijs
Comment 3•2 years ago
|
||
bugherder |
Description
•