Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / generic / ColumnUtils.h
blob15fa0efca51e92b9035c846fd4f9b7f9a8383364
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 /* A namespace class for static muti-column utilities. */
9 #ifndef mozilla_ColumnUtils_h
10 #define mozilla_ColumnUtils_h
12 #include "nsCoord.h"
13 #include "nsStyleConsts.h"
15 class nsContainerFrame;
17 namespace mozilla {
19 // ColumnUtils is a namespace class containing utility functions used by
20 // multi-column containers like ColumnSetWrapperFrame and nsColumnSetFrame.
22 class ColumnUtils final {
23 public:
24 // Compute used value of 'column-gap' for aFrame.
25 static nscoord GetColumnGap(const nsContainerFrame* aFrame,
26 nscoord aPercentageBasis);
28 // Clamp used column width to a minimum of 1px.
29 static nscoord ClampUsedColumnWidth(const Length& aColumnWidth);
31 // Compute the intrinsic inline-size of a column container, given a non-zero
32 // column-count, column gap, and column box's inline-size.
33 static nscoord IntrinsicISize(uint32_t aColCount, nscoord aColGap,
34 nscoord aColISize);
37 } // namespace mozilla
39 #endif // mozilla_ColumnUtils_h