Closed
Bug 931900
Opened 9 years ago
Closed 9 years ago
nsIPromptService.prompt's default value parameter acts differently between desktop and mobile
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 30
People
(Reporter: jason.barnabe, Assigned: wesj)
References
Details
Attachments
(1 file)
3.67 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
Firefox 24 on Android Firefox 24 on Linux "aValue" is an inout parameter of nsIPromptService.prompt that sets the default text and gets set to the user-entered value. When this parameter is set to an empty object or to an object with a null "value" member, there is different behaviour between mobile (Android) and desktop. On mobile, the pre-filled value is "null". On desktop, there is no pre-filled value. Desktop's behaviour seems more correct to me. Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService).prompt(window, "test", "test", {}, null, {}); or Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService).prompt(window, "test", "test", {value: null}, null, {}); As a workaround, I can do this: Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService).prompt(window, "test", "test", {value: ""}, null, {});
![]() |
||
Updated•9 years ago
|
Product: Core → Firefox for Android
Updated•9 years ago
|
Assignee: nobody → wjohnston
Assignee | ||
Comment 1•9 years ago
|
||
This fix is trivial, but I have a bunch of WIP for tests for these exact things in bug 757481 that are oh-so-close to landing. Holding off until I have that in place :)
Assignee | ||
Comment 2•9 years ago
|
||
Forgot about this. The tests are a bit hung up, but we should fix this.
Attachment #8377865 -
Flags: review?(margaret.leibovic)
Comment 3•9 years ago
|
||
Comment on attachment 8377865 [details] [diff] [review] Patch Review of attachment 8377865 [details] [diff] [review]: ----------------------------------------------------------------- r+ with comment addressed. ::: mobile/android/components/PromptService.js @@ +303,5 @@ > > nsIPrompt_prompt: function nsIPrompt_prompt(aTitle, aText, aValue, aCheckMsg, aCheckState) { > let p = this._getPrompt(aTitle, aText, null, aCheckMsg, aCheckState); > p.setHint("prompt"); > + this.addTextbox(p, aValue.value); With this change, autofocus will be undefined. Unintentional change?
Attachment #8377865 -
Flags: review?(margaret.leibovic) → review+
Assignee | ||
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/547342061dc3
Comment 5•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/547342061dc3
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
Updated•2 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•