Closed
Bug 1020245
Opened 11 years ago
Closed 11 years ago
calling openPreferences from utilityOverlay.js with a paneID doesn't work for in-content preferences if the preference tab isn't opened yet
Categories
(Firefox :: Settings UI, defect)
Firefox
Settings UI
Tracking
()
VERIFIED
FIXED
Firefox 33
People
(Reporter: florian, Assigned: peregrino)
References
Details
(Whiteboard: [translation] p=0 s=33.1 [qa!])
Attachments
(2 files, 5 obsolete files)
3.59 KB,
patch
|
Details | Diff | Splinter Review | |
1.06 KB,
patch
|
Details | Diff | Splinter Review |
I noticed this when clicking the "Translation Preferences" menuitem of the "Options" menubutton of the translation infobar.
If about:preferences is already open in a tab, switching to the 'content' pane works correctly.
However, if there was no about:preferences tab yet, the tab is loaded, "Content" is selected in the list on the left side, but the "General" pane is shown on the right side.
To make the translation infobar appear on a trunk build, you currently need to have the preferences browser.translation.detectLanguage and browser.translation.ui.show set to true, and to load a website in a non-English language (eg. http://pt.wikipedia.org).
Flags: firefox-backlog+
Updated•11 years ago
|
Assignee | ||
Comment 1•11 years ago
|
||
I added a check to only load the general pane on init only if no other pane is intended to be open.
Comment 2•11 years ago
|
||
Comment on attachment 8434330 [details] [diff] [review]
bug-1020245.diff
Review of attachment 8434330 [details] [diff] [review]:
-----------------------------------------------------------------
This looks to be a race condition between DOMContentLoaded and the advanced-pane-loaded observer notification. Whichever fires last wins. In the case of the tab already being opened, there is no race condition, and the code in utilityOverlay.js will switch to the correct pane. When the preferences aren't already open, then the race condition is present.
The longer term fix for this is to fix https://bugzilla.mozilla.org/show_bug.cgi?id=754304 so we don't have to do any second guessing about which category to show.
::: browser/components/preferences/in-content/preferences.js
@@ +32,5 @@
>
> let categories = document.getElementById("categories");
> categories.addEventListener("select", event => gotoPref(event.target.value));
>
> + if (document.querySelector('.category[selected="true"]').id == "category-general"){
if (document.getElementById("category-general").selected)) {
Attachment #8434330 -
Flags: review?(jaws) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Comments Addressed
Assignee | ||
Updated•11 years ago
|
Attachment #8434330 -
Attachment is obsolete: true
Comment 4•11 years ago
|
||
Actually, we should have a test that covers the case of comment #0 so it doesn't regress again. Hernan, can you add a test for this?
Assignee | ||
Comment 5•11 years ago
|
||
The problem is that there's already a test for a similar use case on bug 881576, but it doesn't fail. How long should the test wait for something to unexpectedly change the active tab? Feels weird.
Comment 6•11 years ago
|
||
Well, DOMContentLoaded is when the general pane was being opened, so if you wait until "load" then there shouldn't be anymore changes after that.
Assignee | ||
Comment 7•11 years ago
|
||
Ok, I'll look into it tomorrow. The test should be along with the in-content preferences tests, right?
Comment 9•11 years ago
|
||
Had to switch to using add_task to use yield. Note that the current test is insufficient as the test shouldn't be calling selectCategory.
Attachment #8436054 -
Attachment is obsolete: true
Assignee | ||
Comment 10•11 years ago
|
||
Yes, correct test should be using openPreferences, I will switch to that. Thanks for figuring out the strange promise behavior.
Assignee | ||
Comment 11•11 years ago
|
||
Updated test to use openPreferences from utilityOverlay
Attachment #8436081 -
Attachment is obsolete: true
Attachment #8436359 -
Flags: review?(jaws)
Comment 12•11 years ago
|
||
Comment on attachment 8436359 [details] [diff] [review]
proposed fix
Review of attachment 8436359 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the test rename per https://mail.mozilla.org/pipermail/firefox-dev/2013-September/000957.html
::: browser/components/preferences/in-content/tests/browser.ini
@@ +5,5 @@
>
> [browser_advanced_update.js]
> [browser_bug410900.js]
> [browser_bug731866.js]
> +[browser_bug1020245.js]
Please change the test name to browser_bug1020245_openPreferences_to_paneContent.js
Attachment #8436359 -
Flags: review?(jaws) → review+
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #8436359 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 14•11 years ago
|
||
Keywords: checkin-needed
Updated•11 years ago
|
Keywords: checkin-needed
Comment 15•11 years ago
|
||
Assignee | ||
Comment 16•11 years ago
|
||
add a comment to preferences.js to clarify that category-general is selected by default
Attachment #8439377 -
Flags: review?(jaws)
Comment 17•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 33
Updated•11 years ago
|
Whiteboard: p=0 s=33.1 [qa?]
Reporter | ||
Updated•11 years ago
|
QA Contact: bogdan.maris
Whiteboard: p=0 s=33.1 [qa?] → p=0 s=33.1 [qa+]
Comment 18•11 years ago
|
||
Tested on Ubuntu 13.04 64bit and Mac OS X 10.9.3 using latest Nightly.
If 'Translation Preferences' is clicked and about:preferences is not opened, a new tab is opened and 'Content' is selected in the left pane and right pane.
I noticed that if about:preferences is opened in a new window with focus on 'General' for example, and 'Translation Preferences' is clicked, the focus jumps to the about:preferences window but 'General' is focused.
Same scenario but with about:preferences in a new tab, will switch focus to 'Content'. I think the scenario with new window should behave like new tab.
Is this intended behavior?
Flags: needinfo?(colmeiro)
Assignee | ||
Comment 19•11 years ago
|
||
Uhm. I think this is an issue related to how we are opening certain panels in about:preferences. If I run openPreferences from the browser console having an about:preferences tab in another window, I get this error:
> openPreferences('paneContent')
>>> TypeError: browser.contentWindow.selectCategory is not a function
Yesterday I was talking to jaws about the way openPreferences works right now, and he told me he was working on a different bug that would provide a better and more reliable implementation. Maybe we should wait for that one?
Flags: needinfo?(colmeiro) → needinfo?(jaws)
Comment 20•11 years ago
|
||
Yes, the way that preferences are opened to a specific category are being changed in bug 754304. That should fix this issue.
Flags: needinfo?(jaws)
Comment 21•11 years ago
|
||
Thanks for clarification, I will mark this issue as Verified and reverify this when bug 754304 is fixed.
Status: RESOLVED → VERIFIED
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: p=0 s=33.1 [qa+] → p=0 s=33.1 [qa!]
Comment 22•11 years ago
|
||
Comment on attachment 8439377 [details] [diff] [review]
small comment
This patch won't be necessary once bug 754304 is fixed, which looks to be on track.
Attachment #8439377 -
Flags: review?(jaws)
Updated•11 years ago
|
Whiteboard: p=0 s=33.1 [qa!] → [translation] p=0 s=33.1 [qa!]
You need to log in
before you can comment on or make changes to this bug.
Description
•