layout/mathml/nsMathMLmspaceFrame.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsMathMLmspaceFrame_h___
     7 #define nsMathMLmspaceFrame_h___
     9 #include "mozilla/Attributes.h"
    10 #include "nsMathMLContainerFrame.h"
    12 //
    13 // <mspace> -- space
    14 //
    16 class nsMathMLmspaceFrame : public nsMathMLContainerFrame {
    17 public:
    18   NS_DECL_FRAMEARENA_HELPERS
    20   friend nsIFrame* NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
    22   NS_IMETHOD
    23   TransmitAutomaticData() MOZ_OVERRIDE {
    24     // The REC defines the following elements to be space-like:
    25     // * an mtext, mspace, maligngroup, or malignmark element;
    26     mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
    27     return NS_OK;
    28   }
    30   virtual bool IsLeaf() const MOZ_OVERRIDE;
    32   virtual nsresult
    33   Reflow(nsPresContext*          aPresContext,
    34          nsHTMLReflowMetrics&     aDesiredSize,
    35          const nsHTMLReflowState& aReflowState,
    36          nsReflowStatus&          aStatus) MOZ_OVERRIDE;
    38 protected:
    39   nsMathMLmspaceFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
    40   virtual ~nsMathMLmspaceFrame();
    42   virtual nsresult
    43   MeasureForWidth(nsRenderingContext& aRenderingContext,
    44                   nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
    46 private:
    47   nscoord mWidth;
    48   nscoord mHeight;
    49   nscoord mDepth;
    51   // helper method to initialize our member data
    52   void 
    53   ProcessAttributes(nsPresContext* aPresContext);
    54 };
    56 #endif /* nsMathMLmspaceFrame_h___ */

mercurial