mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
refactor: use is_zero() instead of comparing with Au::Zero() (#36347)
Use `is_zero()` instead of comparing with `Au::Zero()` for zero checks. Testing: This change does not cause behaviour change, a test is not necessary. Fixes: #36300 --------- Signed-off-by: Barigbue <barigbuenbira@gmail.com>
This commit is contained in:
parent
2fe57cc2a2
commit
a0730d7154
7 changed files with 16 additions and 14 deletions
|
@ -11,12 +11,12 @@ use std::sync::{Mutex, MutexGuard};
|
|||
use std::{thread, u32};
|
||||
|
||||
use app_units::Au;
|
||||
use euclid::num::Zero;
|
||||
use layout_2020::flow::float::{
|
||||
Clear, ContainingBlockPositionInfo, FloatBand, FloatBandNode, FloatBandTree, FloatContext,
|
||||
FloatSide, PlacementInfo,
|
||||
};
|
||||
use layout_2020::geom::{LogicalRect, LogicalVec2};
|
||||
use num_traits::identities::Zero;
|
||||
use quickcheck::{Arbitrary, Gen};
|
||||
|
||||
static PANIC_HOOK_MUTEX: Mutex<()> = Mutex::new(());
|
||||
|
@ -559,7 +559,7 @@ fn check_floats_rule_3(placement: &FloatPlacement) {
|
|||
// Where the top of `b` should probably be 32px per Rule 3, but unless this distinction
|
||||
// is made the top of `b` could legally be 0px.
|
||||
if this_float.origin.block >= other_float.rect().max_block_position() ||
|
||||
(this_float.info.size.block == Au::zero() &&
|
||||
(this_float.info.size.block.is_zero() &&
|
||||
this_float.rect().max_block_position() < other_float.origin.block) ||
|
||||
(this_float.info.size.block > Au::zero() &&
|
||||
this_float.rect().max_block_position() <= other_float.origin.block)
|
||||
|
@ -729,7 +729,7 @@ fn check_floats_rule_10(placement: &FloatPlacement) {
|
|||
// Where the top of `b` should probably be 32px per Rule 3, but unless this distinction
|
||||
// is made the top of `b` could legally be 0px.
|
||||
if this_float.origin.block >= other_float.rect().max_block_position() ||
|
||||
(this_float.info.size.block == Au::zero() &&
|
||||
(this_float.info.size.block.is_zero() &&
|
||||
this_float.rect().max_block_position() < other_float.origin.block) ||
|
||||
(this_float.info.size.block > Au::zero() &&
|
||||
this_float.rect().max_block_position() <= other_float.origin.block)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue