mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Make factory method of CSS::Screen fallible
This commit is contained in:
parent
1e24126004
commit
57c34e6325
Notes:
sideshowbarker
2024-07-17 01:53:23 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/57c34e6325 Pull-request: https://github.com/SerenityOS/serenity/pull/17491 Reviewed-by: https://github.com/linusg ✅
@ -13,9 +13,9 @@
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
JS::NonnullGCPtr<Screen> Screen::create(HTML::Window& window)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Screen>> Screen::create(HTML::Window& window)
|
||||
{
|
||||
return window.heap().allocate<Screen>(window.realm(), window).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(window.heap().allocate<Screen>(window.realm(), window));
|
||||
}
|
||||
|
||||
Screen::Screen(HTML::Window& window)
|
||||
|
@ -17,7 +17,7 @@ class Screen final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(Screen, Bindings::PlatformObject);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<Screen> create(HTML::Window&);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Screen>> create(HTML::Window&);
|
||||
|
||||
i32 width() const { return screen_rect().width(); }
|
||||
i32 height() const { return screen_rect().height(); }
|
||||
|
Loading…
Reference in New Issue
Block a user