Bug 1890277: part 4) Add CSPParser support for the `trusted-types` directive, guarded...
[gecko.git] / layout / forms / nsDateTimeControlFrame.h
blob0f2af85a340e104339f5f1a48d994fb616f9fbe8
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /**
8 * This frame type is used for input type=date, time, month, week, and
9 * datetime-local.
11 * NOTE: some of the above-mentioned input types are still to-be-implemented.
12 * See nsCSSFrameConstructor::FindInputData, as well as bug 1286182 (date),
13 * bug 1306215 (month), bug 1306216 (week) and bug 1306217 (datetime-local).
16 #ifndef nsDateTimeControlFrame_h__
17 #define nsDateTimeControlFrame_h__
19 #include "mozilla/Attributes.h"
20 #include "nsContainerFrame.h"
21 #include "nsIAnonymousContentCreator.h"
22 #include "nsCOMPtr.h"
24 namespace mozilla {
25 class PresShell;
26 namespace dom {
27 struct DateTimeValue;
28 } // namespace dom
29 } // namespace mozilla
31 class nsDateTimeControlFrame final : public nsContainerFrame {
32 typedef mozilla::dom::DateTimeValue DateTimeValue;
34 explicit nsDateTimeControlFrame(ComputedStyle* aStyle,
35 nsPresContext* aPresContext);
37 public:
38 friend nsIFrame* NS_NewDateTimeControlFrame(mozilla::PresShell* aPresShell,
39 ComputedStyle* aStyle);
41 NS_DECL_QUERYFRAME
42 NS_DECL_FRAMEARENA_HELPERS(nsDateTimeControlFrame)
44 #ifdef DEBUG_FRAME_DUMP
45 nsresult GetFrameName(nsAString& aResult) const override {
46 return MakeFrameName(u"DateTimeControl"_ns, aResult);
48 #endif
50 // Reflow
51 nscoord GetMinISize(gfxContext* aRenderingContext) override;
53 nscoord GetPrefISize(gfxContext* aRenderingContext) override;
55 void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
56 const ReflowInput& aReflowInput,
57 nsReflowStatus& aStatus) override;
59 Maybe<nscoord> GetNaturalBaselineBOffset(
60 mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
61 BaselineExportContext) const override;
63 nscoord mFirstBaseline = NS_INTRINSIC_ISIZE_UNKNOWN;
66 #endif // nsDateTimeControlFrame_h__