mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Temporarily convert more cfg(debug_assertions) crashes to warnings (#30590)
This commit is contained in:
parent
aabae55407
commit
e95de5d858
2 changed files with 36 additions and 1 deletions
|
@ -1760,7 +1760,10 @@ impl Flow for InlineFlow {
|
|||
first_fragment.style.logical_border_width())
|
||||
.start;
|
||||
containing_block_positions.push(
|
||||
padding_box_origin.to_physical(self.base.writing_mode, container_size),
|
||||
// TODO(servo#30577) revert once underlying bug is fixed
|
||||
// padding_box_origin.to_physical(self.base.writing_mode, container_size),
|
||||
padding_box_origin
|
||||
.to_physical_or_warn(self.base.writing_mode, container_size),
|
||||
);
|
||||
},
|
||||
SpecificFragmentInfo::InlineBlock(_) if fragment.is_positioned() => {
|
||||
|
|
|
@ -771,6 +771,38 @@ impl<T: Copy + Sub<T, Output = T>> LogicalPoint<T> {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(servo#30577) remove this once underlying bugs are fixed
|
||||
#[inline]
|
||||
pub fn to_physical_or_warn(&self, mode: WritingMode, container_size: Size2D<T>) -> Point2D<T> {
|
||||
#[cfg(debug_assertions)]
|
||||
if !(self.debug_writing_mode.mode == mode) {
|
||||
log::warn!("debug assertion failed! self.debug_writing_mode.mode == mode");
|
||||
}
|
||||
if mode.is_vertical() {
|
||||
Point2D::new(
|
||||
if mode.is_vertical_lr() {
|
||||
self.b
|
||||
} else {
|
||||
container_size.width - self.b
|
||||
},
|
||||
if mode.is_inline_tb() {
|
||||
self.i
|
||||
} else {
|
||||
container_size.height - self.i
|
||||
},
|
||||
)
|
||||
} else {
|
||||
Point2D::new(
|
||||
if mode.is_bidi_ltr() {
|
||||
self.i
|
||||
} else {
|
||||
container_size.width - self.i
|
||||
},
|
||||
self.b,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn convert(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue