script: LoadBlocker's drop impl shouldn't run after termination. (#36508)

The logic in LoadBlocker::terminate was modified in #34122 to `clone`
the LoadBlocker's inner `load` member instead of `take`ing it. However,
this member serves as a flag so that `LoadBlocker`'s Drop impl can avoid
calling `doc.finish_load` on already terminated loads. The change
results in
unnecessary 'unknown completed load' warnings when Servo is run with
logging enabled.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2025-04-21 12:47:00 +05:30 committed by GitHub
parent 6bb087e381
commit 2a723a528c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 29 additions and 3 deletions

View file

@ -50,10 +50,18 @@ impl LoadBlocker {
/// Remove this load from the associated document's list of blocking loads.
pub(crate) fn terminate(blocker: &DomRefCell<Option<LoadBlocker>>, can_gc: CanGc) {
if let Some(this) = blocker.borrow().as_ref() {
let load_data = this.load.clone().unwrap();
this.doc.finish_load(load_data, can_gc);
let Some(load) = blocker
.borrow_mut()
.as_mut()
.and_then(|blocker| blocker.load.take())
else {
return;
};
if let Some(blocker) = blocker.borrow().as_ref() {
blocker.doc.finish_load(load, can_gc);
}
*blocker.borrow_mut() = None;
}
}

View file

@ -0,0 +1,3 @@
[Range-cloneContents.html]
bug: https://github.com/servo/servo/issues/36561
expected: ERROR

View file

@ -0,0 +1,3 @@
[Range-deleteContents.html]
bug: https://github.com/servo/servo/issues/36561
expected: ERROR

View file

@ -0,0 +1,3 @@
[Range-extractContents.html]
bug: https://github.com/servo/servo/issues/36561
expected: ERROR

View file

@ -0,0 +1,3 @@
[Range-insertNode.html]
bug: https://github.com/servo/servo/issues/36561
expected: ERROR

View file

@ -0,0 +1,3 @@
[Range-surroundContents.html]
bug: https://github.com/servo/servo/issues/36561
expected: ERROR

View file

@ -0,0 +1,3 @@
[media-sniff.window.html]
bug: https://github.com/servo/servo/issues/36626
expected: TIMEOUT