mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 06:29:43 +00:00
LibWeb: Remove auto
length from SourceSet
The spec is a bit awkward here: A few algorithms create an "empty" SourceSet, and then assign its source-size value a few steps later, so we have a temporary state with no length. In order to avoid complicating the types with Optional, I've chosen to just assign it to 0px. Previously we used `auto`, but `auto` is not a valid value here - it is used inside the "parse a sizes attribute" algorithm, but that always returns an actual length (or calc).
This commit is contained in:
parent
577564a1a2
commit
240536acaa
Notes:
github-actions[bot]
2025-09-04 12:33:41 +00:00
Author: https://github.com/AtkinsSJ
Commit: 240536acaa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6043
3 changed files with 18 additions and 15 deletions
|
@ -17,7 +17,9 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
SourceSet::SourceSet()
|
||||
: m_source_size(CSS::Length::make_auto())
|
||||
// Note: m_source_size always gets reassigned to its proper value during one of the construction algorithms.
|
||||
// 0px is just a fake value here so that we don't have to muddy the type system by using Optional.
|
||||
: m_source_size(CSS::Length::make_px(0))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue