LibWeb+WebContent: Implement the WebDriver JSON clone steps for elements

This is needed by WPT to serialize NodeList instances.
This commit is contained in:
Timothy Flynn 2024-09-13 19:41:31 -04:00 committed by Tim Ledbetter
commit bf60765903
Notes: github-actions[bot] 2024-09-14 23:57:21 +00:00
5 changed files with 36 additions and 1 deletions

View file

@ -1783,6 +1783,9 @@ Messages::WebDriverClient::ExecuteScriptResponse WebDriverConnection::execute_sc
case Web::WebDriver::ExecuteScriptResultType::BrowsingContextDiscarded:
response = Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::StaleElementReference, "Browsing context has been discarded", move(result.value));
break;
case Web::WebDriver::ExecuteScriptResultType::StaleElement:
response = Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::StaleElementReference, "Referenced element has become stale", move(result.value));
break;
}
async_script_executed(move(response));
@ -1831,6 +1834,9 @@ Messages::WebDriverClient::ExecuteAsyncScriptResponse WebDriverConnection::execu
case Web::WebDriver::ExecuteScriptResultType::BrowsingContextDiscarded:
response = Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::StaleElementReference, "Browsing context has been discarded", move(result.value));
break;
case Web::WebDriver::ExecuteScriptResultType::StaleElement:
response = Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::StaleElementReference, "Referenced element has become stale", move(result.value));
break;
}
async_script_executed(move(response));