fune/layout/base/Baseline.h
Ting-Yu Lin 19a0c5fb59 Bug 1819211 - Export Baseline.h under mozilla. r=emilio
It is because `Baseline` is a utility class under `namespace mozilla`.

Also change the include guard to match the coding style.
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#header-files

Differential Revision: https://phabricator.services.mozilla.com/D171162
2023-03-01 03:50:03 +00:00

45 lines
1.3 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef LAYOUT_BASE_BASELINE_H_
#define LAYOUT_BASE_BASELINE_H_
#include "nsCoord.h"
#include "mozilla/WritingModes.h"
class nsIFrame;
namespace mozilla {
// https://drafts.csswg.org/css-align-3/#baseline-sharing-group
enum class BaselineSharingGroup : uint8_t {
// NOTE Used as an array index so must be 0 and 1.
First = 0,
Last = 1,
};
class Baseline {
public:
/**
* Synthesize a first(last) inline-axis baseline based on our margin-box.
*/
static nscoord SynthesizeBOffsetFromMarginBox(const nsIFrame*, WritingMode,
BaselineSharingGroup);
/**
* Synthesize a first(last) inline-axis baseline based on our border-box.
*/
static nscoord SynthesizeBOffsetFromBorderBox(const nsIFrame*, WritingMode,
BaselineSharingGroup);
/**
* Synthesize a first(last) inline-axis baseline based on our content-box.
*/
static nscoord SynthesizeBOffsetFromContentBox(const nsIFrame*, WritingMode,
BaselineSharingGroup);
};
} // namespace mozilla
#endif // LAYOUT_BASE_BASELINE_H_