summaryrefslogtreecommitdiffstats
path: root/layout/forms/nsTextControlFrame.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-03-12 11:18:06 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-03-12 11:18:06 +0100
commitba74a4174d2cd6ccbabbc5aa6f4ffdf74b48f45c (patch)
tree42296be483ab2f1f3042f5aca8ce91c2aa669ec3 /layout/forms/nsTextControlFrame.h
parenteda34d02aa8159def0d811846e9417c37cea15cd (diff)
parent519775b8d9d823b8cee786bc668e050110a8aa67 (diff)
downloadUXP-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/nsTextControlFrame.h')
-rw-r--r--layout/forms/nsTextControlFrame.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/layout/forms/nsTextControlFrame.h b/layout/forms/nsTextControlFrame.h
index a76cba514..9d4d0b77c 100644
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -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;