Temporarily convert existing cfg(debug_assertions) crashes to warnings (#30578)

This commit is contained in:
Delan Azabani 2023-10-18 21:16:11 +08:00 committed by GitHub
parent 351b5036bf
commit 66258bfbbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 53 additions and 16 deletions

View file

@ -544,7 +544,11 @@ impl StackingContext {
first
} else {
// This should only happen if the root element has `display: none`
debug_panic!("`CanvasBackground::for_root_element` should have returned `style: None`");
// TODO(servo#30569) revert to debug_panic!() once underlying bug is fixed
log::warn!(
"debug assertion failed! `CanvasBackground::for_root_element` should have returned `style: None`",
);
return;
};
let StackingContextContent::Fragment { fragment, scroll_node_id, containing_block, .. }

View file

@ -258,10 +258,11 @@ impl BoxFragment {
return PhysicalSides::new(top, right, bottom, left);
}
debug_assert!(
position == ComputedPosition::Fixed || position == ComputedPosition::Absolute,
"Got unknown position."
);
// TODO(servo#30570) revert to debug_assert!() once underlying bug is fixed
#[cfg(debug_assertions)]
if !(position == ComputedPosition::Fixed || position == ComputedPosition::Absolute) {
log::warn!("debug assertion failed! Got unknown position.");
}
let resolve = |value: &LengthPercentageOrAuto, container_length| {
value