selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🚀 Feature]: [dotnet] [bidi] Re-think about EventArgs

Open nvborisenko opened this issue 9 months ago • 1 comments

Feature and motivation

https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/BiDi/EventArgs.cs

Ideally all *EventArgs should be immutable. But from spec perspective, it is just a type, even regular type, which can be mutable. If we really want to make all event args immutable, then we should create a copy of class (including all referenced classed). I don't think we really want to do it.

Another option is to accept that event args can be mutable (no effect for users). But then name all event args as spec defines them (without EventArgs prefix). It also makes sense to convert EventArgs class to IEventArgs interface, because if spec will define inheritance, we cannot support it.

Usage example

Just types renaming.

nvborisenko avatar Apr 01 '25 20:04 nvborisenko

We have learnt that following spec as is is very good. Renaming types from *EventArgs to spec's defined is very good step.

nvborisenko avatar Dec 07 '25 10:12 nvborisenko