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:
ickshonpe 2025-04-30 22:00:42 +01:00 committed by GitHub
parent 3631a64a3d
commit 21b62d640b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -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,

View File

@ -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`.