Bug 1866777 - Disable test_race_cache_with_network.js on windows opt for frequent...
[gecko.git] / layout / generic / ColumnSetWrapperFrame.h
blobe219348189fa671240816cd0cff9ee712efd97e1
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 https://mozilla.org/MPL/2.0/. */
7 // A frame for CSS multi-column layout that wraps nsColumnSetFrames and
8 // column-span frames.
10 #ifndef mozilla_ColumnSetWrapperFrame_h
11 #define mozilla_ColumnSetWrapperFrame_h
13 #include "nsBlockFrame.h"
15 namespace mozilla {
17 class PresShell;
19 // This class is a wrapper for nsColumnSetFrames and column-span frame.
20 // Essentially, we divide the *original* nsColumnSetFrame into multiple
21 // nsColumnSetFrames on the basis of the number and position of spanning
22 // elements.
24 // This wrapper is necessary for implementing column-span as it allows us to
25 // maintain each nsColumnSetFrame as an independent set of columns, and each
26 // column-span element then becomes just a block level element.
28 class ColumnSetWrapperFrame final : public nsBlockFrame {
29 public:
30 NS_DECL_FRAMEARENA_HELPERS(ColumnSetWrapperFrame)
31 NS_DECL_QUERYFRAME
33 friend nsBlockFrame* ::NS_NewColumnSetWrapperFrame(
34 mozilla::PresShell* aPresShell, ComputedStyle* aStyle,
35 nsFrameState aStateFlags);
37 void Init(nsIContent* aContent, nsContainerFrame* aParent,
38 nsIFrame* aPrevInFlow) override;
40 nsContainerFrame* GetContentInsertionFrame() override;
42 void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
44 #ifdef DEBUG_FRAME_DUMP
45 nsresult GetFrameName(nsAString& aResult) const override;
46 #endif
48 void AppendFrames(ChildListID aListID, nsFrameList&& aFrameList) override;
50 void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
51 const nsLineList::iterator* aPrevFrameLine,
52 nsFrameList&& aFrameList) override;
54 void RemoveFrame(DestroyContext&, ChildListID, nsIFrame*) override;
56 void MarkIntrinsicISizesDirty() override;
58 nscoord GetMinISize(gfxContext* aRenderingContext) override;
60 nscoord GetPrefISize(gfxContext* aRenderingContext) override;
62 Maybe<nscoord> GetNaturalBaselineBOffset(
63 WritingMode aWM, BaselineSharingGroup aBaselineGroup,
64 BaselineExportContext aExportContext) const override;
66 private:
67 explicit ColumnSetWrapperFrame(ComputedStyle* aStyle,
68 nsPresContext* aPresContext);
69 ~ColumnSetWrapperFrame() override = default;
71 #ifdef DEBUG
72 static void AssertColumnSpanWrapperSubtreeIsSane(const nsIFrame* aFrame);
74 // True if frame constructor has finished building this frame and all of
75 // its descendants.
76 bool mFinishedBuildingColumns = false;
77 #endif
79 template <typename Iterator>
80 Maybe<nscoord> GetBaselineBOffset(Iterator aStart, Iterator aEnd,
81 WritingMode aWM,
82 BaselineSharingGroup aBaselineGroup,
83 BaselineExportContext aExportContext) const;
86 } // namespace mozilla
88 #endif // mozilla_ColumnSetWrapperFrame_h