w3c / window-management

Window Management API
https://www.w3.org/TR/window-management/
Other
96 stars 25 forks source link

FullscreenOptions `screen` member should not be nullable #13

Closed domenic closed 4 years ago

domenic commented 4 years ago
dictionary FullscreenOptions {
  FullscreenNavigationUI navigationUI = "auto";

  // https://github.com/webscreens/window-placement
  Screen? screen;
};

This should just be Screen, not Screen?. There's no reason to accept null here.

inexorabletash commented 4 years ago

To be clear to folks new to Web IDL: if a dictionary member is not required it's implicitly optional, which callers can take advantage of by leaving off the member (or explicitly passing undefined if that's how they roll). null for optional is avoided with modern web APIs.

michaelwasserman commented 4 years ago

Awesome, thank you for clarifying the best practice here! I updated the explainer: https://github.com/webscreens/window-placement/commit/861edf0c9e6cfb54098612f3719848ba1bfd1050 I will also update Chromium's experimental code.