diff options
Diffstat (limited to 'components/layout_2020/fragment_tree/box_fragment.rs')
-rw-r--r-- | components/layout_2020/fragment_tree/box_fragment.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/layout_2020/fragment_tree/box_fragment.rs b/components/layout_2020/fragment_tree/box_fragment.rs index 6e1039200e2..7b0284efea6 100644 --- a/components/layout_2020/fragment_tree/box_fragment.rs +++ b/components/layout_2020/fragment_tree/box_fragment.rs @@ -15,6 +15,7 @@ use style::Zero; use super::{BaseFragment, BaseFragmentInfo, CollapsedBlockMargins, Fragment}; use crate::cell::ArcRefCell; use crate::formatting_contexts::Baselines; +use crate::fragment_tree::FragmentFlags; use crate::geom::{ AuOrAuto, LengthPercentageOrAuto, PhysicalPoint, PhysicalRect, PhysicalSides, ToLogical, }; @@ -325,4 +326,11 @@ impl BoxFragment { convert_to_au_or_auto(PhysicalSides::new(top, right, bottom, left)) } + + /// Whether this is a non-replaced inline-level box whose inner display type is `flow`. + /// <https://drafts.csswg.org/css-display-3/#inline-box> + pub(crate) fn is_inline_box(&self) -> bool { + self.style.get_box().display.is_inline_flow() && + !self.base.flags.contains(FragmentFlags::IS_REPLACED) + } } |