mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 16:58:38 +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
|
|
@ -62,6 +62,29 @@ public:
|
|||
const ReflowInput& aReflowInput,
|
||||
nsReflowStatus& aStatus) override;
|
||||
|
||||
bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
|
||||
nscoord* aBaseline) const override
|
||||
{
|
||||
return GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::eFirst, aBaseline);
|
||||
}
|
||||
|
||||
bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
|
||||
BaselineSharingGroup aBaselineGroup,
|
||||
nscoord* aBaseline) const override
|
||||
{
|
||||
if (!IsSingleLineTextControl()) {
|
||||
return false;
|
||||
}
|
||||
NS_ASSERTION(mFirstBaseline != NS_INTRINSIC_WIDTH_UNKNOWN,
|
||||
"please call Reflow before asking for the baseline");
|
||||
if (aBaselineGroup == BaselineSharingGroup::eFirst) {
|
||||
*aBaseline = mFirstBaseline;
|
||||
} else {
|
||||
*aBaseline = BSize(aWM) - mFirstBaseline;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
|
||||
virtual bool IsXULCollapsed() override;
|
||||
|
||||
|
|
@ -87,6 +110,14 @@ public:
|
|||
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void MarkIntrinsicISizesDirty() override
|
||||
{
|
||||
// Need another Reflow to have a correct baseline value again.
|
||||
mFirstBaseline = NS_INTRINSIC_WIDTH_UNKNOWN;
|
||||
}
|
||||
#endif
|
||||
|
||||
// nsIAnonymousContentCreator
|
||||
virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
|
||||
virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
||||
|
|
@ -300,6 +331,10 @@ private:
|
|||
}
|
||||
|
||||
private:
|
||||
// Our first baseline, or NS_INTRINSIC_WIDTH_UNKNOWN if we have a pending
|
||||
// Reflow.
|
||||
nscoord mFirstBaseline;
|
||||
|
||||
// these packed bools could instead use the high order bits on mState, saving 4 bytes
|
||||
bool mEditorHasBeenInitialized;
|
||||
bool mIsProcessing;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue