mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 10:09:14 +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:
parent
b4dd477644
commit
8163ee1500
Notes:
sideshowbarker
2024-07-17 22:01:16 +09:00
Author: https://github.com/martinfalisse
Commit: 8163ee1500
Pull-request: https://github.com/SerenityOS/serenity/pull/14730
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/MacDue ✅
Reviewed-by: https://github.com/awesomekling
9 changed files with 84 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue