-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Handle negative zero BiDi response #15898
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
[dotnet] Handle negative zero BiDi response #15898
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
dotnet/src/webdriver/BiDi/Communication/Json/Converters/BiDiDoubleConverter.cs
Outdated
Show resolved
Hide resolved
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SpecialNumberConverter.cs
Outdated
Show resolved
Hide resolved
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SpecialNumberConverter.cs
Outdated
Show resolved
Hide resolved
dotnet/src/webdriver/BiDi/Communication/Json/Converters/BiDiDoubleConverter.cs
Outdated
Show resolved
Hide resolved
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SpecialNumberConverter.cs
Show resolved
Hide resolved
Thanks Mike, in general this approach looks good, let's review minor comments. |
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SpecialNumberConverter.cs
Show resolved
Hide resolved
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SpecialNumberConverter.cs
Outdated
Show resolved
Hide resolved
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SpecialNumberConverter.cs
Show resolved
Hide resolved
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SpecialNumberConverter.cs
Outdated
Show resolved
Hide resolved
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.
Thank you, Mike. Just minor comments.
…lNumberConverter.cs Co-authored-by: Nikolay Borisenko <[email protected]>
User description
🔗 Related Issues
Per resolution in w3c/webdriver-bidi#887
💥 What does this PR do?
Allow handling of "-0" as a response value, with the understanding that this is intended behavior from BiDi.
🔧 Implementation Notes
Note that
Broker.cs
retains handling of numbers-as-strings, even if that is strictly speaking, not necessary to keep around.I personally do not see the harm in keeping this as is, but I do not have a strong opinion.
selenium/dotnet/src/webdriver/BiDi/Communication/Broker.cs
Lines 69 to 71 in 9be77c1
💡 Additional Considerations
🔄 Types of changes
PR Type
Bug fix
Description
• Add BiDi JSON converter for handling negative zero double values
• Enable proper serialization/deserialization of special double values (-0, NaN, Infinity)
• Remove browser-specific test ignores for negative zero handling
Changes walkthrough 📝
BiDiDoubleConverter.cs
Add BiDi double JSON converter
dotnet/src/webdriver/BiDi/Communication/Json/Converters/BiDiDoubleConverter.cs
• Create new JSON converter for BiDi double values
• Handle special
cases: -0, NaN, Infinity, -Infinity
• Implement bit pattern comparison
for negative zero detection
• Provide spec-compliant
serialization/deserialization
LocalValue.cs
Apply double converter to LocalValue
dotnet/src/webdriver/BiDi/Script/LocalValue.cs
• Apply BiDiDoubleConverter to NumberLocalValue double property
• Add
converter import statement
RemoteValue.cs
Apply double converter to RemoteValue
dotnet/src/webdriver/BiDi/Script/RemoteValue.cs
• Apply BiDiDoubleConverter to NumberRemoteValue double property
• Add
converter import statement
CallFunctionLocalValueTest.cs
Remove negative zero test ignores
dotnet/test/common/BiDi/Script/CallFunctionLocalValueTest.cs
• Remove browser-specific test ignores for Chrome and Edge
• Enable
negative zero test for all browsers