mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Use rect value in CSS clip property
When a rect value is passed to the clip property via CSS, keep it in ComputedValues so that at a later stage can make use of it.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibWeb/CSS/Clip.h>
|
||||
#include <LibWeb/CSS/StyleProperties.h>
|
||||
#include <LibWeb/FontCache.h>
|
||||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
@@ -235,6 +236,14 @@ Optional<CSS::ImageRendering> StyleProperties::image_rendering() const
|
||||
return value_id_to_image_rendering(value->to_identifier());
|
||||
}
|
||||
|
||||
CSS::Clip StyleProperties::clip() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::Clip);
|
||||
if (!value->has_rect())
|
||||
return CSS::Clip::make_auto();
|
||||
return CSS::Clip(value->as_rect().rect());
|
||||
}
|
||||
|
||||
Optional<CSS::JustifyContent> StyleProperties::justify_content() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::JustifyContent);
|
||||
|
||||
Reference in New Issue
Block a user