mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb/CSS: Use generated FooUnit types instead of Foo::Type
I've also renamed the `m_type` and `type()` members to be `m_unit` and `unit()` instead, to match what they actually are.
This commit is contained in:
parent
bda4f8cbe8
commit
b3e32445d3
Notes:
github-actions[bot]
2025-09-11 16:08:15 +00:00
Author: https://github.com/AtkinsSJ
Commit: b3e32445d3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6071
29 changed files with 232 additions and 669 deletions
|
|
@ -143,7 +143,7 @@ void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style)
|
|||
|
||||
if (type_state() != TypeAttributeState::FileUpload) {
|
||||
if (style.property(CSS::PropertyID::Width).has_auto())
|
||||
style.set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(size(), CSS::Length::Type::Ch)));
|
||||
style.set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(size(), CSS::LengthUnit::Ch)));
|
||||
}
|
||||
|
||||
// NOTE: Other browsers apply a minimum height of a single line's line-height to single-line input elements.
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ void HTMLTextAreaElement::adjust_computed_style(CSS::ComputedProperties& style)
|
|||
style.set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::InlineBlock)));
|
||||
|
||||
if (style.property(CSS::PropertyID::Width).has_auto())
|
||||
style.set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(cols(), CSS::Length::Type::Ch)));
|
||||
style.set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(cols(), CSS::LengthUnit::Ch)));
|
||||
if (style.property(CSS::PropertyID::Height).has_auto())
|
||||
style.set_property(CSS::PropertyID::Height, CSS::LengthStyleValue::create(CSS::Length(rows(), CSS::Length::Type::Lh)));
|
||||
style.set_property(CSS::PropertyID::Height, CSS::LengthStyleValue::create(CSS::Length(rows(), CSS::LengthUnit::Lh)));
|
||||
}
|
||||
|
||||
void HTMLTextAreaElement::initialize(JS::Realm& realm)
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
|
|||
// FIXME: Make this a preference
|
||||
return CSS::MediaFeatureValue(CSS::Keyword::NoPreference);
|
||||
case CSS::MediaFeatureID::Resolution:
|
||||
return CSS::MediaFeatureValue(CSS::Resolution(device_pixel_ratio(), CSS::Resolution::Type::Dppx));
|
||||
return CSS::MediaFeatureValue(CSS::Resolution::make_dots_per_pixel(device_pixel_ratio()));
|
||||
case CSS::MediaFeatureID::Scan:
|
||||
// FIXME: Detect this from the display, if we can. Most displays aren't scanning and should return None.
|
||||
return CSS::MediaFeatureValue(CSS::Keyword::None);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue