diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-12 11:18:06 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-12 11:18:06 +0100 |
commit | ba74a4174d2cd6ccbabbc5aa6f4ffdf74b48f45c (patch) | |
tree | 42296be483ab2f1f3042f5aca8ce91c2aa669ec3 /layout/forms/nsHTMLButtonControlFrame.cpp | |
parent | eda34d02aa8159def0d811846e9417c37cea15cd (diff) | |
parent | 519775b8d9d823b8cee786bc668e050110a8aa67 (diff) | |
download | UXP-ba74a4174d2cd6ccbabbc5aa6f4ffdf74b48f45c.tar UXP-ba74a4174d2cd6ccbabbc5aa6f4ffdf74b48f45c.tar.gz UXP-ba74a4174d2cd6ccbabbc5aa6f4ffdf74b48f45c.tar.lz UXP-ba74a4174d2cd6ccbabbc5aa6f4ffdf74b48f45c.tar.xz UXP-ba74a4174d2cd6ccbabbc5aa6f4ffdf74b48f45c.zip |
Merge branch 'ported-moebius'
Diffstat (limited to 'layout/forms/nsHTMLButtonControlFrame.cpp')
-rw-r--r-- | layout/forms/nsHTMLButtonControlFrame.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index ef9459ef2..2e4fa9f67 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -418,6 +418,47 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext, aButtonDesiredSize.SetOverflowAreasToDesiredBounds(); } +bool +nsHTMLButtonControlFrame::GetVerticalAlignBaseline(mozilla::WritingMode aWM, + nscoord* aBaseline) const +{ + nsIFrame* inner = mFrames.FirstChild(); + if (MOZ_UNLIKELY(inner->GetWritingMode().IsOrthogonalTo(aWM))) { + return false; + } + if (!inner->GetVerticalAlignBaseline(aWM, aBaseline)) { + // <input type=color> has an empty block frame as inner frame + *aBaseline = inner-> + SynthesizeBaselineBOffsetFromBorderBox(aWM, BaselineSharingGroup::eFirst); + } + nscoord innerBStart = inner->BStart(aWM, GetSize()); + *aBaseline += innerBStart; + return true; +} + +bool +nsHTMLButtonControlFrame::GetNaturalBaselineBOffset(mozilla::WritingMode aWM, + BaselineSharingGroup aBaselineGroup, + nscoord* aBaseline) const +{ + nsIFrame* inner = mFrames.FirstChild(); + if (MOZ_UNLIKELY(inner->GetWritingMode().IsOrthogonalTo(aWM))) { + return false; + } + if (!inner->GetNaturalBaselineBOffset(aWM, aBaselineGroup, aBaseline)) { + // <input type=color> has an empty block frame as inner frame + *aBaseline = inner-> + SynthesizeBaselineBOffsetFromBorderBox(aWM, aBaselineGroup); + } + nscoord innerBStart = inner->BStart(aWM, GetSize()); + if (aBaselineGroup == BaselineSharingGroup::eFirst) { + *aBaseline += innerBStart; + } else { + *aBaseline += BSize(aWM) - (innerBStart + inner->BSize(aWM)); + } + return true; +} + nsresult nsHTMLButtonControlFrame::SetFormProperty(nsIAtom* aName, const nsAString& aValue) { if (nsGkAtoms::value == aName) { |