mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 16:58:58 +00:00
LibWeb/CSS: Take AbstractElement in compute_pe_style_if_needed()
This commit is contained in:
parent
cee84d22a0
commit
263c51f6ac
Notes:
github-actions[bot]
2025-09-11 16:48:25 +00:00
Author: https://github.com/AtkinsSJ
Commit: 263c51f6ac
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6118
3 changed files with 4 additions and 4 deletions
|
@ -2335,9 +2335,9 @@ GC::Ref<ComputedProperties> StyleComputer::compute_style(DOM::AbstractElement ab
|
|||
return *compute_style_impl(abstract_element, ComputeStyleMode::Normal, did_change_custom_properties);
|
||||
}
|
||||
|
||||
GC::Ptr<ComputedProperties> StyleComputer::compute_pseudo_element_style_if_needed(DOM::Element& element, Optional<CSS::PseudoElement> pseudo_element, Optional<bool&> did_change_custom_properties) const
|
||||
GC::Ptr<ComputedProperties> StyleComputer::compute_pseudo_element_style_if_needed(DOM::AbstractElement abstract_element, Optional<bool&> did_change_custom_properties) const
|
||||
{
|
||||
return compute_style_impl({ element, move(pseudo_element) }, ComputeStyleMode::CreatePseudoElementStyleIfNeeded, did_change_custom_properties);
|
||||
return compute_style_impl(abstract_element, ComputeStyleMode::CreatePseudoElementStyleIfNeeded, did_change_custom_properties);
|
||||
}
|
||||
|
||||
GC::Ptr<ComputedProperties> StyleComputer::compute_style_impl(DOM::AbstractElement abstract_element, ComputeStyleMode mode, Optional<bool&> did_change_custom_properties) const
|
||||
|
|
|
@ -153,7 +153,7 @@ public:
|
|||
[[nodiscard]] GC::Ref<ComputedProperties> create_document_style() const;
|
||||
|
||||
[[nodiscard]] GC::Ref<ComputedProperties> compute_style(DOM::AbstractElement, Optional<bool&> did_change_custom_properties = {}) const;
|
||||
[[nodiscard]] GC::Ptr<ComputedProperties> compute_pseudo_element_style_if_needed(DOM::Element&, Optional<CSS::PseudoElement>, Optional<bool&> did_change_custom_properties) const;
|
||||
[[nodiscard]] GC::Ptr<ComputedProperties> compute_pseudo_element_style_if_needed(DOM::AbstractElement, Optional<bool&> did_change_custom_properties) const;
|
||||
|
||||
[[nodiscard]] RuleCache const& get_pseudo_class_rule_cache(PseudoClass) const;
|
||||
|
||||
|
|
|
@ -739,7 +739,7 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_style(bool& did_cha
|
|||
style_computer.push_ancestor(*this);
|
||||
|
||||
auto pseudo_element_style = computed_properties(pseudo_element);
|
||||
auto new_pseudo_element_style = style_computer.compute_pseudo_element_style_if_needed(*this, pseudo_element, did_change_custom_properties);
|
||||
auto new_pseudo_element_style = style_computer.compute_pseudo_element_style_if_needed({ *this, pseudo_element }, did_change_custom_properties);
|
||||
|
||||
// TODO: Can we be smarter about invalidation?
|
||||
if (pseudo_element_style && new_pseudo_element_style) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue