mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Implement CSS perspective property
This commit is contained in:
parent
e44a97e508
commit
eb21ea890c
Notes:
github-actions[bot]
2025-11-11 23:42:45 +00:00
Author: https://github.com/Psychpsyo
Commit: eb21ea890c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6776
Reviewed-by: https://github.com/gmta ✅
13 changed files with 108 additions and 2 deletions
|
|
@ -714,6 +714,20 @@ TransformBox ComputedProperties::transform_box() const
|
|||
return keyword_to_transform_box(value.to_keyword()).release_value();
|
||||
}
|
||||
|
||||
Optional<CSSPixels> ComputedProperties::perspective() const
|
||||
{
|
||||
auto const& value = property(PropertyID::Perspective);
|
||||
if (value.is_keyword() && value.to_keyword() == Keyword::None)
|
||||
return {};
|
||||
|
||||
if (value.is_length())
|
||||
return value.as_length().length().absolute_length_to_px();
|
||||
if (value.is_calculated())
|
||||
return value.as_calculated().resolve_length({ .length_resolution_context = {} })->absolute_length_to_px();
|
||||
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
TransformOrigin ComputedProperties::transform_origin() const
|
||||
{
|
||||
auto length_percentage_with_keywords_resolved = [](StyleValue const& value) -> LengthPercentage {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue