mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 11:39:43 +00:00
LibWeb: Rename CSS::StyleProperties => CSS::ComputedProperties
Now that StyleProperties is only used to hold computed properties, let's name it ComputedProperties.
This commit is contained in:
parent
ed7f4664c2
commit
c1cad8fa0e
Notes:
github-actions[bot]
2024-12-22 09:13:51 +00:00
Author: https://github.com/awesomekling
Commit: c1cad8fa0e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2995
168 changed files with 397 additions and 397 deletions
|
@ -1386,7 +1386,7 @@ void Document::update_animated_style_if_needed()
|
|||
|
||||
for (auto& animation : timeline->associated_animations()) {
|
||||
if (auto effect = animation->effect())
|
||||
effect->update_style_properties();
|
||||
effect->update_computed_properties();
|
||||
}
|
||||
}
|
||||
m_needs_animated_style_update = false;
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
#include <LibWeb/Bindings/ElementPrototype.h>
|
||||
#include <LibWeb/Bindings/ExceptionOrUtils.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/CSS/ComputedProperties.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/PropertyID.h>
|
||||
#include <LibWeb/CSS/ResolvedCSSStyleDeclaration.h>
|
||||
#include <LibWeb/CSS/SelectorEngine.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/CSS/StyleProperties.h>
|
||||
#include <LibWeb/CSS/StyleValues/CSSKeywordValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
|
||||
#include <LibWeb/DOM/Attr.h>
|
||||
|
@ -388,7 +388,7 @@ Vector<String> Element::get_attribute_names() const
|
|||
return names;
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::Node> Element::create_layout_node(CSS::StyleProperties style)
|
||||
GC::Ptr<Layout::Node> Element::create_layout_node(CSS::ComputedProperties style)
|
||||
{
|
||||
if (local_name() == "noscript" && document().is_scripting_enabled())
|
||||
return nullptr;
|
||||
|
@ -397,7 +397,7 @@ GC::Ptr<Layout::Node> Element::create_layout_node(CSS::StyleProperties style)
|
|||
return create_layout_node_for_display_type(document(), display, move(style), this);
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::NodeWithStyle> Element::create_layout_node_for_display_type(DOM::Document& document, CSS::Display const& display, CSS::StyleProperties style, Element* element)
|
||||
GC::Ptr<Layout::NodeWithStyle> Element::create_layout_node_for_display_type(DOM::Document& document, CSS::Display const& display, CSS::ComputedProperties style, Element* element)
|
||||
{
|
||||
if (display.is_table_inside() || display.is_table_row_group() || display.is_table_header_group() || display.is_table_footer_group() || display.is_table_row())
|
||||
return document.heap().allocate<Layout::Box>(document, element, move(style));
|
||||
|
@ -454,7 +454,7 @@ void Element::run_attribute_change_steps(FlyString const& local_name, Optional<S
|
|||
}
|
||||
}
|
||||
|
||||
static CSS::RequiredInvalidationAfterStyleChange compute_required_invalidation(CSS::StyleProperties const& old_style, CSS::StyleProperties const& new_style)
|
||||
static CSS::RequiredInvalidationAfterStyleChange compute_required_invalidation(CSS::ComputedProperties const& old_style, CSS::ComputedProperties const& new_style)
|
||||
{
|
||||
CSS::RequiredInvalidationAfterStyleChange invalidation;
|
||||
|
||||
|
@ -552,10 +552,10 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_style()
|
|||
return invalidation;
|
||||
}
|
||||
|
||||
CSS::StyleProperties Element::resolved_css_values(Optional<CSS::Selector::PseudoElement::Type> type)
|
||||
CSS::ComputedProperties Element::resolved_css_values(Optional<CSS::Selector::PseudoElement::Type> type)
|
||||
{
|
||||
auto element_computed_style = CSS::ResolvedCSSStyleDeclaration::create(*this, type);
|
||||
CSS::StyleProperties properties = {};
|
||||
CSS::ComputedProperties properties = {};
|
||||
|
||||
for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) {
|
||||
auto property_id = (CSS::PropertyID)i;
|
||||
|
@ -2297,13 +2297,13 @@ void Element::set_cascaded_properties(Optional<CSS::Selector::PseudoElement::Typ
|
|||
}
|
||||
}
|
||||
|
||||
void Element::set_computed_css_values(Optional<CSS::StyleProperties> style)
|
||||
void Element::set_computed_css_values(Optional<CSS::ComputedProperties> style)
|
||||
{
|
||||
m_computed_css_values = move(style);
|
||||
computed_css_values_changed();
|
||||
}
|
||||
|
||||
void Element::set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type pseudo_element, Optional<CSS::StyleProperties> style)
|
||||
void Element::set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type pseudo_element, Optional<CSS::ComputedProperties> style)
|
||||
{
|
||||
if (!m_pseudo_element_data && !style.has_value())
|
||||
return;
|
||||
|
@ -2315,7 +2315,7 @@ void Element::set_pseudo_element_computed_css_values(CSS::Selector::PseudoElemen
|
|||
ensure_pseudo_element(pseudo_element).computed_css_values = move(style);
|
||||
}
|
||||
|
||||
Optional<CSS::StyleProperties&> Element::pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type type)
|
||||
Optional<CSS::ComputedProperties&> Element::pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type type)
|
||||
{
|
||||
auto pseudo_element = get_pseudo_element(type);
|
||||
if (pseudo_element.has_value())
|
||||
|
@ -2917,7 +2917,7 @@ CSS::CountersSet& Element::ensure_counters_set()
|
|||
}
|
||||
|
||||
// https://drafts.csswg.org/css-lists-3/#auto-numbering
|
||||
void Element::resolve_counters(CSS::StyleProperties& style)
|
||||
void Element::resolve_counters(CSS::ComputedProperties& style)
|
||||
{
|
||||
// Resolving counter values on a given element is a multi-step process:
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/ShadowRootPrototype.h>
|
||||
#include <LibWeb/CSS/CascadedProperties.h>
|
||||
#include <LibWeb/CSS/ComputedProperties.h>
|
||||
#include <LibWeb/CSS/CountersSet.h>
|
||||
#include <LibWeb/CSS/Selector.h>
|
||||
#include <LibWeb/CSS/StyleInvalidation.h>
|
||||
#include <LibWeb/CSS/StyleProperties.h>
|
||||
#include <LibWeb/CSS/StyleProperty.h>
|
||||
#include <LibWeb/DOM/ChildNode.h>
|
||||
#include <LibWeb/DOM/NonDocumentTypeChildNode.h>
|
||||
|
@ -185,16 +185,16 @@ public:
|
|||
GC::Ptr<Layout::NodeWithStyle> layout_node();
|
||||
GC::Ptr<Layout::NodeWithStyle const> layout_node() const;
|
||||
|
||||
Optional<CSS::StyleProperties>& computed_css_values() { return m_computed_css_values; }
|
||||
Optional<CSS::StyleProperties> const& computed_css_values() const { return m_computed_css_values; }
|
||||
void set_computed_css_values(Optional<CSS::StyleProperties>);
|
||||
CSS::StyleProperties resolved_css_values(Optional<CSS::Selector::PseudoElement::Type> = {});
|
||||
Optional<CSS::ComputedProperties>& computed_css_values() { return m_computed_css_values; }
|
||||
Optional<CSS::ComputedProperties> const& computed_css_values() const { return m_computed_css_values; }
|
||||
void set_computed_css_values(Optional<CSS::ComputedProperties>);
|
||||
CSS::ComputedProperties resolved_css_values(Optional<CSS::Selector::PseudoElement::Type> = {});
|
||||
|
||||
[[nodiscard]] GC::Ptr<CSS::CascadedProperties> cascaded_properties(Optional<CSS::Selector::PseudoElement::Type>) const;
|
||||
void set_cascaded_properties(Optional<CSS::Selector::PseudoElement::Type>, GC::Ptr<CSS::CascadedProperties>);
|
||||
|
||||
void set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type, Optional<CSS::StyleProperties>);
|
||||
Optional<CSS::StyleProperties&> pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type);
|
||||
void set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type, Optional<CSS::ComputedProperties>);
|
||||
Optional<CSS::ComputedProperties&> pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type);
|
||||
|
||||
void reset_animated_css_properties();
|
||||
|
||||
|
@ -240,13 +240,13 @@ public:
|
|||
GC::Ref<Geometry::DOMRect> get_bounding_client_rect() const;
|
||||
GC::Ref<Geometry::DOMRectList> get_client_rects() const;
|
||||
|
||||
virtual GC::Ptr<Layout::Node> create_layout_node(CSS::StyleProperties);
|
||||
virtual void adjust_computed_style(CSS::StyleProperties&) { }
|
||||
virtual GC::Ptr<Layout::Node> create_layout_node(CSS::ComputedProperties);
|
||||
virtual void adjust_computed_style(CSS::ComputedProperties&) { }
|
||||
|
||||
virtual void did_receive_focus() { }
|
||||
virtual void did_lose_focus() { }
|
||||
|
||||
static GC::Ptr<Layout::NodeWithStyle> create_layout_node_for_display_type(DOM::Document&, CSS::Display const&, CSS::StyleProperties, Element*);
|
||||
static GC::Ptr<Layout::NodeWithStyle> create_layout_node_for_display_type(DOM::Document&, CSS::Display const&, CSS::ComputedProperties, Element*);
|
||||
|
||||
void set_pseudo_element_node(Badge<Layout::TreeBuilder>, CSS::Selector::PseudoElement::Type, GC::Ptr<Layout::NodeWithStyle>);
|
||||
GC::Ptr<Layout::NodeWithStyle> get_pseudo_element_node(CSS::Selector::PseudoElement::Type) const;
|
||||
|
@ -369,7 +369,7 @@ public:
|
|||
bool has_non_empty_counters_set() const { return m_counters_set; }
|
||||
Optional<CSS::CountersSet const&> counters_set();
|
||||
CSS::CountersSet& ensure_counters_set();
|
||||
void resolve_counters(CSS::StyleProperties&);
|
||||
void resolve_counters(CSS::ComputedProperties&);
|
||||
void inherit_counters();
|
||||
|
||||
protected:
|
||||
|
@ -416,13 +416,13 @@ private:
|
|||
|
||||
GC::Ptr<CSS::CascadedProperties> m_cascaded_properties;
|
||||
|
||||
Optional<CSS::StyleProperties> m_computed_css_values;
|
||||
Optional<CSS::ComputedProperties> m_computed_css_values;
|
||||
HashMap<FlyString, CSS::StyleProperty> m_custom_properties;
|
||||
|
||||
struct PseudoElement {
|
||||
GC::Ptr<Layout::NodeWithStyle> layout_node;
|
||||
GC::Ptr<CSS::CascadedProperties> cascaded_properties;
|
||||
Optional<CSS::StyleProperties> computed_css_values;
|
||||
Optional<CSS::ComputedProperties> computed_css_values;
|
||||
HashMap<FlyString, CSS::StyleProperty> custom_properties;
|
||||
};
|
||||
// TODO: CSS::Selector::PseudoElement::Type includes a lot of pseudo-elements that exist in shadow trees,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue