mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-17 05:29:56 +00:00
LibWeb/CSS: Use generated code to convert between dimension units
This commit is contained in:
parent
82f5be871a
commit
5534ed6715
Notes:
github-actions[bot]
2025-09-11 16:07:38 +00:00
Author: https://github.com/AtkinsSJ
Commit: 5534ed6715
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6071
6 changed files with 8 additions and 69 deletions
|
@ -47,13 +47,7 @@ String Frequency::to_string(SerializationMode serialization_mode) const
|
|||
|
||||
double Frequency::to_hertz() const
|
||||
{
|
||||
switch (m_unit) {
|
||||
case FrequencyUnit::Hz:
|
||||
return m_value;
|
||||
case FrequencyUnit::KHz:
|
||||
return m_value * 1000;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
return ratio_between_units(m_unit, FrequencyUnit::Hz) * m_value;
|
||||
}
|
||||
|
||||
Frequency Frequency::resolve_calculated(NonnullRefPtr<CalculatedStyleValue const> const& calculated, Layout::Node const& layout_node, Frequency const& reference_value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue