mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibWeb: Reset line-height for select elements
This commit is contained in:
parent
8975fd7d06
commit
d41f77be64
Notes:
github-actions[bot]
2026-02-06 10:33:25 +00:00
Author: https://github.com/tcl3
Commit: d41f77be64
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7756
Reviewed-by: https://github.com/gmta ✅
3 changed files with 18 additions and 0 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CSS/ComputedProperties.h>
|
||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/KeywordStyleValue.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
|
|
@ -85,6 +86,9 @@ void HTMLSelectElement::adjust_computed_style(CSS::ComputedProperties& style)
|
|||
// This is required for the internal shadow tree to work correctly in layout.
|
||||
if (style.display().is_inline_outside() && style.display().is_flow_inside())
|
||||
style.set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::InlineBlock)));
|
||||
|
||||
// AD-HOC: Enforce normal line-height for select elements. This matches the behavior of other engines.
|
||||
style.set_property(CSS::PropertyID::LineHeight, CSS::KeywordStyleValue::create(CSS::Keyword::Normal));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-select-size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue