layout: Add initial support for clip-path: [<basic-shape> || <shape-box>] (#33107)

* Turn on clip-path tests and add results

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* enhance: Add support for `clip-path: [<basic-shape> || <shape-box>]`

Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>

* Changes from review

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Chocolate Pie 2024-08-29 00:00:34 +09:00 committed by GitHub
parent f810983fd2
commit 590527176e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 450 additions and 89 deletions

View file

@ -13,6 +13,7 @@ use style::properties::longhands::backface_visibility::computed_value::T as Back
use style::properties::longhands::box_sizing::computed_value::T as BoxSizing;
use style::properties::longhands::column_span::computed_value::T as ColumnSpan;
use style::properties::ComputedValues;
use style::values::computed::basic_shape::ClipPath;
use style::values::computed::image::Image as ComputedImageLayer;
use style::values::computed::{Length, LengthPercentage, NonNegativeLengthPercentage, Size};
use style::values::generics::box_::Perspective;
@ -608,6 +609,10 @@ impl ComputedValuesExt for ComputedValues {
return true;
}
if self.get_svg().clip_path != ClipPath::None {
return true;
}
// Statically positioned fragments don't establish stacking contexts if the previous
// conditions are not fulfilled. Furthermore, z-index doesn't apply to statically
// positioned fragments (except for flex items, see below).