Closed Bug 1859814 Opened 1 year ago Closed 3 months ago

Always set `defaultValue` to the type `prompt`

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
2

Tracking

(firefox129 fixed)

RESOLVED FIXED
129 Branch
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.

See Also: → 1851761

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.

Component: General → JavaScript Engine

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.

Component: JavaScript Engine → General
Flags: needinfo?(aborovova)

I'm looking for Gecko change to have access to defaulValue of the prompt.

Flags: needinfo?(aborovova)
Component: General → Content Prompts
Product: Core → Toolkit

Hi Micah, could you please help us with Sasha's question? Thanks

Flags: needinfo?(mtigley)

Micah seems to be out. Paul, maybe you could give an advice here? Thanks.

Flags: needinfo?(pbz)

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

Flags: needinfo?(pbz)
Flags: needinfo?(mtigley)
Flags: needinfo?(aborovova)

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.

Component: Content Prompts → WebDriver BiDi
Flags: needinfo?(aborovova)
Product: Toolkit → Remote Protocol
Summary: Add `defaultValue` to the prompt `args` property → Alwasy set `defaultValue` to the type `prompt`
Summary: Alwasy set `defaultValue` to the type `prompt` → Always set `defaultValue` to the type `prompt`
Assignee: nobody → aborovova
Status: NEW → ASSIGNED
Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:m11]
Regressions: 1905438

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'}
Flags: needinfo?(aborovova)

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.

I've rebased on autoland and updated the metadata to align with downstreamed test changes, should be good to go now.

Flags: needinfo?(aborovova)
Pushed by aborovova@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8414bf43afc7 Always set 'defaultValue' to the type 'prompt'. r=webdriver-reviewers,whimboo
Pushed by abutkovits@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/4dd320dc2978 Always set 'defaultValue' to the type 'prompt'. r=webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
Whiteboard: [webdriver:m11] → [webdriver:m11][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: