mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-25 04:22:50 +00:00
LibWeb: Make storage of CSS::StyleValues const-correct
Now we consistently use `RefPtr<StyleValue const>` for all StyleValues.
This commit is contained in:
parent
3fdad8fe22
commit
6d11414957
Notes:
github-actions[bot]
2025-04-16 16:44:32 +00:00
Author: https://github.com/ADKaster
Commit: 6d11414957
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4362
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Hendiadyoin1
113 changed files with 628 additions and 629 deletions
|
@ -1006,7 +1006,7 @@ void StyleComputer::set_all_properties(
|
|||
continue;
|
||||
}
|
||||
|
||||
NonnullRefPtr<CSSStyleValue> property_value = value;
|
||||
NonnullRefPtr<CSSStyleValue const> property_value = value;
|
||||
if (property_value->is_unresolved())
|
||||
property_value = Parser::Parser::resolve_unresolved_style_value(Parser::ParsingParams { document }, element, pseudo_element, property_id, property_value->as_unresolved());
|
||||
if (!property_value->is_unresolved())
|
||||
|
@ -2486,7 +2486,7 @@ static bool is_monospace(CSSStyleValue const& value)
|
|||
// instead of the default font size (16px).
|
||||
// See this blog post for a lot more details about this weirdness:
|
||||
// https://manishearth.github.io/blog/2017/08/10/font-size-an-unexpectedly-complex-css-property/
|
||||
RefPtr<CSSStyleValue> StyleComputer::recascade_font_size_if_needed(
|
||||
RefPtr<CSSStyleValue const> StyleComputer::recascade_font_size_if_needed(
|
||||
DOM::Element& element,
|
||||
Optional<CSS::PseudoElement> pseudo_element,
|
||||
CascadedProperties& cascaded_properties) const
|
||||
|
@ -2510,7 +2510,7 @@ RefPtr<CSSStyleValue> StyleComputer::recascade_font_size_if_needed(
|
|||
for (auto* ancestor = element.parent_element(); ancestor; ancestor = ancestor->parent_element())
|
||||
ancestors.append(*ancestor);
|
||||
|
||||
NonnullRefPtr<CSSStyleValue> new_font_size = CSS::LengthStyleValue::create(CSS::Length::make_px(default_monospace_font_size_in_px));
|
||||
NonnullRefPtr<CSSStyleValue const> new_font_size = CSS::LengthStyleValue::create(CSS::Length::make_px(default_monospace_font_size_in_px));
|
||||
CSSPixels current_size_in_px = default_monospace_font_size_in_px;
|
||||
|
||||
for (auto& ancestor : ancestors.in_reverse()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue