mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
webdriver: Assume more consistently that the BrowsingContext exists (#37389)
1. Tidy up some WebDriver handling with browsing context 2. Enable more wpt-test which no longer panic Testing: `./mach test-wpt -r --log-raw "D:\servo test log\all.txt" .\tests\wpt\tests\webdriver\tests\classic\ --product servodriver` --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
parent
fab958258e
commit
c1ee354c38
7 changed files with 28 additions and 108 deletions
|
@ -76,18 +76,10 @@ fn find_node_by_unique_id(
|
|||
pipeline: PipelineId,
|
||||
node_id: String,
|
||||
) -> Result<DomRoot<Node>, ErrorStatus> {
|
||||
match documents.find_document(pipeline) {
|
||||
Some(doc) => find_node_by_unique_id_in_document(&doc, node_id),
|
||||
None => {
|
||||
// FIXME: This is unreacheable!! Because we already early return in Constellation
|
||||
// To be Fixed soon
|
||||
if ScriptThread::has_node_id(pipeline, &node_id) {
|
||||
Err(ErrorStatus::StaleElementReference)
|
||||
} else {
|
||||
Err(ErrorStatus::NoSuchElement)
|
||||
}
|
||||
},
|
||||
}
|
||||
let doc = documents
|
||||
.find_document(pipeline)
|
||||
.expect("webdriver_handlers::Document should exists");
|
||||
find_node_by_unique_id_in_document(&doc, node_id)
|
||||
}
|
||||
|
||||
pub(crate) fn find_node_by_unique_id_in_document(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue