mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 13:58:40 +09:00
CSS: inline-block with a display:block <input> child element has a wrong baseline (HTML forms)
This commit is contained in:
parent
8d256442ca
commit
67a10f51a0
20 changed files with 990 additions and 29 deletions
|
|
@ -106,6 +106,7 @@ private:
|
|||
|
||||
nsTextControlFrame::nsTextControlFrame(nsStyleContext* aContext)
|
||||
: nsContainerFrame(aContext)
|
||||
, mFirstBaseline(NS_INTRINSIC_WIDTH_UNKNOWN)
|
||||
, mEditorHasBeenInitialized(false)
|
||||
, mIsProcessing(false)
|
||||
#ifdef DEBUG
|
||||
|
|
@ -538,20 +539,20 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
aReflowInput.ComputedLogicalBorderPadding().BStartEnd(wm));
|
||||
aDesiredSize.SetSize(wm, finalSize);
|
||||
|
||||
// computation of the ascent wrt the input height
|
||||
// Calculate the baseline and store it in mFirstBaseline.
|
||||
nscoord lineHeight = aReflowInput.ComputedBSize();
|
||||
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
||||
if (!IsSingleLineTextControl()) {
|
||||
lineHeight = ReflowInput::CalcLineHeight(GetContent(), StyleContext(),
|
||||
NS_AUTOHEIGHT, inflation);
|
||||
NS_AUTOHEIGHT, inflation);
|
||||
}
|
||||
RefPtr<nsFontMetrics> fontMet =
|
||||
nsLayoutUtils::GetFontMetricsForFrame(this, inflation);
|
||||
// now adjust for our borders and padding
|
||||
aDesiredSize.SetBlockStartAscent(
|
||||
mFirstBaseline =
|
||||
nsLayoutUtils::GetCenteredFontBaseline(fontMet, lineHeight,
|
||||
wm.IsLineInverted()) +
|
||||
aReflowInput.ComputedLogicalBorderPadding().BStart(wm));
|
||||
aReflowInput.ComputedLogicalBorderPadding().BStart(wm);
|
||||
aDesiredSize.SetBlockStartAscent(mFirstBaseline);
|
||||
|
||||
// overflow handling
|
||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue