Change the default visual box for OverflowClipMargin
to PaddingBox
(#18935)
# Objective The default should be `OverflowClipBox::PaddingBox` not `OverflowClipBox::ContentBox` `padding-box` is the default in CSS. ## Solution Set the default to `PaddingBox`. ## Testing Compare the `overflow` UI example on main vs with this PR. You should see that on main the outline around the inner node gets clipped. With this PR by default clipping starts at the inner edge of the border (the `padding-box`) and the outlines are visible. Fixes #18934
This commit is contained in:
parent
3631a64a3d
commit
21b62d640b
@ -1178,7 +1178,7 @@ pub struct OverflowClipMargin {
|
||||
|
||||
impl OverflowClipMargin {
|
||||
pub const DEFAULT: Self = Self {
|
||||
visual_box: OverflowClipBox::ContentBox,
|
||||
visual_box: OverflowClipBox::PaddingBox,
|
||||
margin: 0.,
|
||||
};
|
||||
|
||||
@ -1224,9 +1224,9 @@ impl OverflowClipMargin {
|
||||
)]
|
||||
pub enum OverflowClipBox {
|
||||
/// Clip any content that overflows outside the content box
|
||||
#[default]
|
||||
ContentBox,
|
||||
/// Clip any content that overflows outside the padding box
|
||||
#[default]
|
||||
PaddingBox,
|
||||
/// Clip any content that overflows outside the border box
|
||||
BorderBox,
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
title: OverflowClipBox's default is now Paddingbox
|
||||
pull_requests: [18935]
|
||||
---
|
||||
|
||||
The default variant for `OverflowClipBox` is now `PaddingBox`.
|
||||
The default value for `OverflowClipMargin::visual_box` is now `OverflowClipBox::PaddingBox`.
|
Loading…
Reference in New Issue
Block a user