capricorn86 / happy-dom

A JavaScript implementation of a web browser without its graphical user interface
MIT License
3.09k stars 185 forks source link

Support Screen Orientation API #1382

Open odanado opened 3 months ago

odanado commented 3 months ago

Is your feature request related to a problem? Please describe. The Screen Orientation API is implemented in modern browsers but not in happy-dom.

Describe the solution you'd like Implement the Screen Orientation API and make it available via window.screen.orientation. Change the value of window.screen.orientation.type in response to a call to window.happyDOM.setViewport.

Describe alternatives you've considered It is possible to simulate the behavior of the Screen Orientation API by using the jest and vitest mocking functions. However, it would save a lot of people time if implemented in happy-dom.

Additional context Add any other context or screenshots about the feature request here.