Backed out 2 changesets (bug 1943998) for causing wd failures @ phases.py CLOSED...
[gecko.git] / layout / mathml / nsMathMLmspaceFrame.h
blobc482154bae908f6059c5513b6b0bf9c44612f973
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 #ifndef nsMathMLmspaceFrame_h___
8 #define nsMathMLmspaceFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsCSSValue.h"
12 #include "nsMathMLContainerFrame.h"
14 namespace mozilla {
15 class PresShell;
16 } // namespace mozilla
19 // <mspace> -- space
22 class nsMathMLmspaceFrame final : public nsMathMLContainerFrame {
23 public:
24 NS_DECL_FRAMEARENA_HELPERS(nsMathMLmspaceFrame)
26 friend nsIFrame* NS_NewMathMLmspaceFrame(mozilla::PresShell* aPresShell,
27 ComputedStyle* aStyle);
29 NS_IMETHOD
30 TransmitAutomaticData() override {
31 // The REC defines the following elements to be space-like:
32 // * an mtext, mspace, maligngroup, or malignmark element;
33 mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
34 return NS_OK;
37 protected:
38 explicit nsMathMLmspaceFrame(ComputedStyle* aStyle,
39 nsPresContext* aPresContext)
40 : nsMathMLContainerFrame(aStyle, aPresContext, kClassID) {}
41 virtual ~nsMathMLmspaceFrame();
43 private:
44 struct Attribute {
45 nsCSSValue mValue;
46 enum class ParsingState : uint8_t {
47 Valid,
48 Invalid,
49 Dirty,
51 ParsingState mState = ParsingState::Dirty;
53 Attribute mWidth;
54 Attribute mHeight;
55 Attribute mDepth;
57 nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
58 int32_t aModType) final;
59 nscoord CalculateAttributeValue(nsAtom* aAtom, Attribute& aAttribute,
60 uint32_t aFlags, float aFontSizeInflation);
61 nsresult Place(DrawTarget* aDrawTarget, const PlaceFlags& aFlags,
62 ReflowOutput& aDesiredSize) final;
65 #endif /* nsMathMLmspaceFrame_h___ */