mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Remove clearance parameter from BoxFragment::new()
(#37921)
Clearance only applies to block-level boxes, so it was unnecessary to require it as a parameter. Instead, in block layout we can set it using the new `.with_clearance()` method. Testing: Unnecessary (no behavior change) Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
8d4988f288
commit
c00831f1ed
7 changed files with 11 additions and 19 deletions
|
@ -115,7 +115,6 @@ impl BoxFragment {
|
|||
padding: PhysicalSides<Au>,
|
||||
border: PhysicalSides<Au>,
|
||||
margin: PhysicalSides<Au>,
|
||||
clearance: Option<Au>,
|
||||
specific_layout_info: Option<SpecificLayoutInfo>,
|
||||
) -> BoxFragment {
|
||||
BoxFragment {
|
||||
|
@ -127,7 +126,7 @@ impl BoxFragment {
|
|||
padding,
|
||||
border,
|
||||
margin,
|
||||
clearance,
|
||||
clearance: None,
|
||||
baselines: Baselines::default(),
|
||||
block_margins_collapsed_with_children: None,
|
||||
scrollable_overflow: None,
|
||||
|
@ -194,6 +193,11 @@ impl BoxFragment {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn with_clearance(mut self, clearance: Option<Au>) -> Self {
|
||||
self.clearance = clearance;
|
||||
self
|
||||
}
|
||||
|
||||
/// Get the scrollable overflow for this [`BoxFragment`] relative to its
|
||||
/// containing block.
|
||||
pub fn scrollable_overflow(&self) -> PhysicalRect<Au> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue