diff options
author | Moonchild <moonchild@palemoon.org> | 2022-07-24 12:31:32 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-07-24 17:25:36 +0000 |
commit | 071412ab291a9f6181780dd0e5e2316c4a292a7c (patch) | |
tree | 7bdd92955ce024d07f3ad13422f011a43d2b035e /layout/generic/ReflowInput.h | |
parent | 5487515bcab438ae29fa6342583b8b5c5bde6b92 (diff) | |
download | uxp-1970-form-focusring-styling.tar.gz |
Issue #1970 - Part 7: Restore proper spacing in select for CJK/asian1970-form-focusring-styling
The issue is that select elements may contain some non-Latin characters that
need extra block-size to display than the one line-height calculated by using a
Latin font spec in the style.
Before this patch, when a control has an unconstrained block-size, we set
the element's block-size to one line-height in Reflow(), which is intended to
properly initialize `BlockReflowInput::mMinLineHeight` since it uses
`line-height:-moz-block-height`.
However, this simply prevents the display from choosing a larger block-size
after the reflow occurs. Previously, this discrepancy was absorbed by the extra
padding present to make select elements the same intrinsic size as buttons, but
since we did away with that, we're losing the extra space and the font glyphs
get clipped.
This patch fixes the issue by carrying the computed line height over to the
element's display so that its computed block-size is still unconstrained.
This way it can accommodate taller characters in the display text.
After this patch, a <select><option> containing non-Latin characters should have
the same block-size as <button>, and no characters should be clipped.
Diffstat (limited to 'layout/generic/ReflowInput.h')
-rw-r--r-- | layout/generic/ReflowInput.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index d8e0518399..a70549d8eb 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -747,6 +747,11 @@ public: * Get the used line-height property. The return value will be >= 0. */ nscoord GetLineHeight() const; + + /** + * Set the used line-height. aLineHeight must be >= 0. + */ + void SetLineHeight(nscoord aLineHeight); /** * Calculate the used line-height property without a reflow input instance. |