1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

LibWeb: Resolve the transition-delay property

This commit is contained in:
stelar7 2023-05-27 22:05:48 +02:00 committed by Andreas Kling
parent aa691c22d4
commit a5f2024afa
4 changed files with 26 additions and 2 deletions

View file

@ -14,6 +14,7 @@
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
#include <LibWeb/CSS/StyleValues/TimeStyleValue.h>
#include <LibWeb/CSS/StyleValues/URLStyleValue.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Dump.h>
@ -609,6 +610,15 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
computed_values.set_transformations(computed_style.transformations());
computed_values.set_transform_origin(computed_style.transform_origin());
auto transition_delay_property = computed_style.property(CSS::PropertyID::TransitionDelay);
if (transition_delay_property->is_time()) {
auto& transition_delay = transition_delay_property->as_time();
computed_values.set_transition_delay(transition_delay.time());
} else if (transition_delay_property->is_calculated()) {
auto& transition_delay = transition_delay_property->as_calculated();
computed_values.set_transition_delay(transition_delay.resolve_time().value());
}
auto do_border_style = [&](CSS::BorderData& border, CSS::PropertyID width_property, CSS::PropertyID color_property, CSS::PropertyID style_property) {
// FIXME: The default border color value is `currentcolor`, but since we can't resolve that easily,
// we just manually grab the value from `color`. This makes it dependent on `color` being