// FIXME: 3. If url is not an absolute URL or is not an absolute URL with fragment or not a local scheme, return error with error code invalid argument.
// FIXME: 4. Handle any user prompts and return its value if it is an error.
// FIXME: 5. Let current URL be the current top-level browsing context’s active document’s URL.
// FIXME: 6. If current URL and url do not have the same absolute URL:
// FIXME: a. If timer has not been started, start a timer. If this algorithm has not completed before timer reaches the session’s session page load timeout in milliseconds, return an error with error code timeout.
// 7. Navigate the current top-level browsing context to url.
m_page_host.page().load(url);
// FIXME: 8. If url is special except for file and current URL and URL do not have the same absolute URL:
// FIXME: a. Try to wait for navigation to complete.
// FIXME: b. Try to run the post-navigation checks.
// FIXME: 9. Set the current browsing context with the current top-level browsing context.
// FIXME: 10. If the current top-level browsing context contains a refresh state pragma directive of time 1 second or less, wait until the refresh timeout has elapsed, a new navigate has begun, and return to the first step of this algorithm.
returnWeb::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::InvalidArgument,String::formatted("Property '{}' is not a Number",name));
autonumber=property->templateto_number<i64>();
if(number<min)
returnWeb::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::InvalidArgument,String::formatted("Property '{}' value {} exceeds the minimum allowed value {}",name,number,min));
if(number>max)
returnWeb::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::InvalidArgument,String::formatted("Property '{}' value {} exceeds the maximum allowed value {}",name,number,max));
returnstatic_cast<i32>(number);
};
// 1. Let width be the result of getting a property named width from the parameters argument, else let it be null.
// 7. If the remote end does not support the Set Window Rect command for the current top-level browsing context for any reason, return error with error code unsupported operation.
// 8. If the current top-level browsing context is no longer open, return error with error code no such window.
TRY(ensure_open_top_level_browsing_context());
// FIXME: 9. Handle any user prompts and return its value if it is an error.
// FIXME: 10. Fully exit fullscreen.
// 11. Restore the window.
restore_the_window();
Gfx::IntRectwindow_rect;
// 11. If width and height are not null:
if(width.has_value()&&height.has_value()){
// a. Set the width, in CSS pixels, of the operating system window containing the current top-level browsing context, including any browser chrome and externally drawn window decorations to a value that is as close as possible to width.
// b. Set the height, in CSS pixels, of the operating system window containing the current top-level browsing context, including any browser chrome and externally drawn window decorations to a value that is as close as possible to height.
// a. Run the implementation-specific steps to set the position of the operating system level window containing the current top-level browsing context to the position given by the x and y coordinates.
// To restore the window, given an operating system level window with an associated top-level browsing context, run implementation-specific steps to restore or unhide the window to the visible screen.
// Do not return from this operation until the visibility state of the top-level browsing context’s active document has reached the visible state, or until the operation times out.