Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsCollapsingMargin Struct Reference

An nsCollapsingMargin represents a vertical collapsing margin between blocks as described in section 8.3.1 of CSS2, <URL: http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins >. More...

#include <nsHTMLReflowMetrics.h>

List of all members.

Public Member Functions

 nsCollapsingMargin ()
 nsCollapsingMargin (const nsCollapsingMargin &aOther)
PRBool operator== (const nsCollapsingMargin &aOther)
PRBool operator!= (const nsCollapsingMargin &aOther)
nsCollapsingMarginoperator= (const nsCollapsingMargin &aOther)
void Include (nscoord aCoord)
void Include (const nsCollapsingMargin &aOther)
void Zero ()
PRBool IsZero () const
nscoord get () const

Private Attributes

nscoord mMostPos
nscoord mMostNeg

Detailed Description

An nsCollapsingMargin represents a vertical collapsing margin between blocks as described in section 8.3.1 of CSS2, <URL: http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins >.

All adjacent vertical margins collapse, and the resulting margin is the sum of the largest positive margin included and the smallest (most negative) negative margin included.

Definition at line 64 of file nsHTMLReflowMetrics.h.


Constructor & Destructor Documentation

Definition at line 70 of file nsHTMLReflowMetrics.h.

        : mMostPos(0),
          mMostNeg(0)
      {
      }

Definition at line 76 of file nsHTMLReflowMetrics.h.

        : mMostPos(aOther.mMostPos),
          mMostNeg(aOther.mMostNeg)
      {
      }

Member Function Documentation

nscoord nsCollapsingMargin::get ( ) const [inline]

Definition at line 127 of file nsHTMLReflowMetrics.h.

      {
        return mMostPos + mMostNeg;
      }

Here is the caller graph for this function:

Definition at line 100 of file nsHTMLReflowMetrics.h.

      {
        if (aCoord > mMostPos)
          mMostPos = aCoord;
        else if (aCoord < mMostNeg)
          mMostNeg = aCoord;
      }

Here is the caller graph for this function:

Definition at line 108 of file nsHTMLReflowMetrics.h.

      {
        if (aOther.mMostPos > mMostPos)
          mMostPos = aOther.mMostPos;
        if (aOther.mMostNeg < mMostNeg)
          mMostNeg = aOther.mMostNeg;
      }
PRBool nsCollapsingMargin::IsZero ( ) const [inline]

Definition at line 122 of file nsHTMLReflowMetrics.h.

      {
        return (mMostPos == 0) && (mMostNeg == 0);
      }

Here is the caller graph for this function:

PRBool nsCollapsingMargin::operator!= ( const nsCollapsingMargin aOther) [inline]

Definition at line 88 of file nsHTMLReflowMetrics.h.

      {
        return !(*this == aOther);
      }
nsCollapsingMargin& nsCollapsingMargin::operator= ( const nsCollapsingMargin aOther) [inline]

Definition at line 93 of file nsHTMLReflowMetrics.h.

      {
        mMostPos = aOther.mMostPos;
        mMostNeg = aOther.mMostNeg;
        return *this;
      }
PRBool nsCollapsingMargin::operator== ( const nsCollapsingMargin aOther) [inline]

Definition at line 82 of file nsHTMLReflowMetrics.h.

      {
        return mMostPos == aOther.mMostPos &&
          mMostNeg == aOther.mMostNeg;
      }

Definition at line 116 of file nsHTMLReflowMetrics.h.

      {
        mMostPos = 0;
        mMostNeg = 0;
      }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 67 of file nsHTMLReflowMetrics.h.

Definition at line 66 of file nsHTMLReflowMetrics.h.


The documentation for this struct was generated from the following file: