layout/forms/nsSelectsAreaFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/nsSelectsAreaFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +#ifndef nsSelectsAreaFrame_h___
     1.9 +#define nsSelectsAreaFrame_h___
    1.10 +
    1.11 +#include "mozilla/Attributes.h"
    1.12 +#include "nsBlockFrame.h"
    1.13 +
    1.14 +class nsSelectsAreaFrame : public nsBlockFrame
    1.15 +{
    1.16 +public:
    1.17 +  NS_DECL_FRAMEARENA_HELPERS
    1.18 +
    1.19 +  friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameState aFlags);
    1.20 +
    1.21 +  virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
    1.22 +                                const nsRect&           aDirtyRect,
    1.23 +                                const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    1.24 +
    1.25 +  void BuildDisplayListInternal(nsDisplayListBuilder*   aBuilder,
    1.26 +                                const nsRect&           aDirtyRect,
    1.27 +                                const nsDisplayListSet& aLists);
    1.28 +
    1.29 +  virtual nsresult Reflow(nsPresContext*           aCX,
    1.30 +                          nsHTMLReflowMetrics&     aDesiredSize,
    1.31 +                          const nsHTMLReflowState& aReflowState,
    1.32 +                          nsReflowStatus&          aStatus) MOZ_OVERRIDE;
    1.33 +
    1.34 +  nscoord HeightOfARow() const { return mHeightOfARow; }
    1.35 +  
    1.36 +protected:
    1.37 +  nsSelectsAreaFrame(nsStyleContext* aContext) :
    1.38 +    nsBlockFrame(aContext),
    1.39 +    mHeightOfARow(0)
    1.40 +  {}
    1.41 +
    1.42 +  // We cache the height of a single row so that changes to the "size"
    1.43 +  // attribute, padding, etc. can all be handled with only one reflow.  We'll
    1.44 +  // have to reflow twice if someone changes our font size or something like
    1.45 +  // that, so that the heights of our options will change.
    1.46 +  nscoord mHeightOfARow;
    1.47 +};
    1.48 +
    1.49 +#endif /* nsSelectsAreaFrame_h___ */

mercurial