mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 16:28:54 +00:00
LibWeb/CSS: Take AbstractElement in compute_transitioned_properties()
This commit is contained in:
parent
77f1057992
commit
e6bb0ab000
Notes:
github-actions[bot]
2025-09-11 16:46:51 +00:00
Author: https://github.com/AtkinsSJ
Commit: e6bb0ab000
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6118
1 changed files with 6 additions and 3 deletions
|
@ -1215,13 +1215,16 @@ static void apply_dimension_attribute(CascadedProperties& cascaded_properties, D
|
|||
cascaded_properties.set_property_from_presentational_hint(property_id, parsed_value.release_nonnull());
|
||||
}
|
||||
|
||||
static void compute_transitioned_properties(ComputedProperties const& style, DOM::Element& element, Optional<PseudoElement> pseudo_element)
|
||||
static void compute_transitioned_properties(ComputedProperties const& style, DOM::AbstractElement abstract_element)
|
||||
{
|
||||
auto const source_declaration = style.transition_property_source();
|
||||
if (!source_declaration)
|
||||
return;
|
||||
if (!element.computed_properties())
|
||||
if (!abstract_element.computed_properties())
|
||||
return;
|
||||
// FIXME: Add transition helpers on AbstractElement.
|
||||
auto& element = abstract_element.element();
|
||||
auto pseudo_element = abstract_element.pseudo_element();
|
||||
if (source_declaration == element.cached_transition_property_source(pseudo_element))
|
||||
return;
|
||||
// Reparse this transition property
|
||||
|
@ -2647,7 +2650,7 @@ GC::Ref<ComputedProperties> StyleComputer::compute_properties(DOM::AbstractEleme
|
|||
|
||||
// 8. Transition declarations [css-transitions-1]
|
||||
// Theoretically this should be part of the cascade, but it works with computed values, which we don't have until now.
|
||||
compute_transitioned_properties(computed_style, abstract_element.element(), abstract_element.pseudo_element());
|
||||
compute_transitioned_properties(computed_style, abstract_element);
|
||||
if (auto previous_style = abstract_element.computed_properties()) {
|
||||
start_needed_transitions(*previous_style, computed_style, abstract_element);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue