Always set `defaultValue` to the type `prompt`
Categories
(Remote Protocol :: WebDriver BiDi, task, P2)
Tracking
(firefox129 fixed)
| Tracking | Status | |
|---|---|---|
| firefox129 | --- | fixed |
People
(Reporter: Sasha, Assigned: Sasha)
References
Details
(Whiteboard: [webdriver:m11][webdriver:relnote])
Attachments
(1 file)
In the scope of the bug 1851761 to add defaultValue of the prompt to the payload of browsingContext.userPromptOpened event, we utilized args.value property from the Dialog object which we get from a subject of common-dialog-loaded notification. It mostly works, except we can not distinguish between the cases when the defaultValue of the prompt was set as an empty string and when it's not provided at all, in both cases args.value will be equal to an empty string. My assumption would be that in order to implement this feature correctly, we would need to have access to the actual defaultValue which was set by the user, and the good place for us would be args property.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
Should this be in the Remote Protocol component? Or are you looking for some kind of Gecko change to support this? I don't really understand the initial request.
| Assignee | ||
Comment 3•2 years ago
|
||
I'm looking for Gecko change to have access to defaulValue of the prompt.
Updated•2 years ago
|
Comment 4•1 year ago
|
||
Hi Micah, could you please help us with Sasha's question? Thanks
Comment 5•1 year ago
|
||
Micah seems to be out. Paul, maybe you could give an advice here? Thanks.
Comment 6•1 year ago
•
|
||
I'm missing a lot of context for the question here. Is this about window.prompt?
Is this the field you're looking to get the default or initial value of? https://searchfox.org/mozilla-central/rev/b11735b86bb4d416c918e2b2413456561beff50c/toolkit/components/prompts/content/commonDialog.js#89
I assume you want to access it via https://searchfox.org/mozilla-central/rev/b11735b86bb4d416c918e2b2413456561beff50c/remote/shared/Prompt.sys.mjs#89 ?
Maybe we can expose it here in this.ui here: https://searchfox.org/mozilla-central/rev/b11735b86bb4d416c918e2b2413456561beff50c/toolkit/components/prompts/content/commonDialog.js#86-105
Do you need the default value even if the user has already modified the text input? In that case we might have to store it somewhere. I can see that the helper code populates the input directly https://searchfox.org/mozilla-central/rev/b11735b86bb4d416c918e2b2413456561beff50c/toolkit/components/prompts/src/CommonDialog.sys.mjs#79
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 7•1 year ago
|
||
Ok, so I've checked again, and we recently had an update of tests, where it was also discovered, that according to the html spec, the defaultValue for type prompt defaults to an empty string. Considering this, I think, we actually don’t really need the platform change anymore and can keep using the prompt value (args.value), we will just have to change our implementation to always set the defaultValue in case of type prompt.
Sorry for the confusion, I will move this bug to the WebDriver BiDi component.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 8•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 9•1 year ago
|
||
Backed out for causing wd failures in user_prompt_opened.py
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/browsing_context/user_prompt_opened/user_prompt_opened.py | test_prompt_type[alert] - AssertionError: assert {'context': '8e667685-d4af-4a3a-b6e6-c5a23ac39974', 'type': 'alert', 'message': 'test'} == {'context': '8e667685-d4af-4a3a-b6e6-c5a23ac39974', 'type': 'alert', 'message': 'test', 'handler': 'dismiss'}
Comment 10•1 year ago
|
||
The problem here is that we cannot yet remove the file testing/web-platform/meta/webdriver/tests/bidi/browsing_context/user_prompt_opened/user_prompt_opened.py.ini because of bug 1904822. If Sasha cannot fix it I'll take a look early next week.
| Assignee | ||
Comment 11•1 year ago
|
||
I've rebased on autoland and updated the metadata to align with downstreamed test changes, should be good to go now.
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
Comment 14•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Description
•