-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] [bidi] Possibility to reset viewport #16601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
dotnet/src/webdriver/BiDi/BrowsingContext/SetViewportCommand.cs
Outdated
Show resolved
Hide resolved
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
|
||
| namespace OpenQA.Selenium.BiDi; | ||
|
|
||
| public readonly record struct Optional<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly struct, do we see issues? There are limitations of its use. I propose to be safe and don't use it.
User description
New pattern detected.
https://w3c.github.io/webdriver-bidi/#command-browsingContext-setViewport
Here
viewportproperty is nullable. But if remote-end faces realnullinjson, then it behaves differently. So we just always sendnullif it isnull.🔧 Implementation Notes
Mark this special
nullablewith:🔄 Types of changes
PR Type
Bug fix, Enhancement
Description
Add JsonIgnore attribute to Viewport property for null serialization
Enable viewport reset capability via BiDi setViewport command
Ensure null viewport values are properly sent to remote endpoint
Diagram Walkthrough
File Walkthrough
SetViewportCommand.cs
Add JsonIgnore attribute for null viewport serializationdotnet/src/webdriver/BiDi/BrowsingContext/SetViewportCommand.cs
System.Text.Json.Serializationusing statement[property: JsonIgnore(Condition =JsonIgnoreCondition.WhenWritingNull)]attribute toViewport?propertyin
SetViewportParametersrecordvia BiDi protocol