mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb: Make CSS::PercentageOr<T> non-virtual
This shrinks each instance of PercentageOr by 8 bytes and avoids virtual dispatch when resolving calc() values. It's a win-win! Many data structures shrink as a result. An example is ComputedValues which goes from 3376 bytes to 3024 bytes per instance.
This commit is contained in:
parent
b42b7c8dd0
commit
c282138fd0
Notes:
github-actions[bot]
2024-08-02 18:38:37 +00:00
Author: https://github.com/awesomekling
Commit: c282138fd0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/935
10 changed files with 44 additions and 49 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2024, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
@ -222,6 +222,9 @@ public:
|
|||
Optional<Length> absolutize(CSSPixelRect const& viewport_rect, FontMetrics const& font_metrics, FontMetrics const& root_font_metrics) const;
|
||||
Length absolutized(CSSPixelRect const& viewport_rect, FontMetrics const& font_metrics, FontMetrics const& root_font_metrics) const;
|
||||
|
||||
static Length resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&, Length const& reference_value);
|
||||
static Length resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&, CSSPixels reference_value);
|
||||
|
||||
private:
|
||||
char const* unit_name() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue