nsSelectsAreaFrame.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/. */
  5. #ifndef nsSelectsAreaFrame_h___
  6. #define nsSelectsAreaFrame_h___
  7. #include "mozilla/Attributes.h"
  8. #include "nsBlockFrame.h"
  9. class nsSelectsAreaFrame : public nsBlockFrame
  10. {
  11. public:
  12. NS_DECL_FRAMEARENA_HELPERS
  13. friend nsContainerFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell,
  14. nsStyleContext* aContext,
  15. nsFrameState aFlags);
  16. virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
  17. const nsDisplayListSet& aLists) override;
  18. void BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
  19. const nsDisplayListSet& aLists);
  20. virtual void Reflow(nsPresContext* aCX,
  21. ReflowOutput& aDesiredSize,
  22. const ReflowInput& aReflowInput,
  23. nsReflowStatus& aStatus) override;
  24. nscoord BSizeOfARow() const { return mBSizeOfARow; }
  25. protected:
  26. explicit nsSelectsAreaFrame(nsStyleContext* aContext) :
  27. nsBlockFrame(aContext),
  28. mBSizeOfARow(0)
  29. {}
  30. // We cache the block size of a single row so that changes to the
  31. // "size" attribute, padding, etc. can all be handled with only one
  32. // reflow. We'll have to reflow twice if someone changes our font
  33. // size or something like that, so that the block size of our options
  34. // will change.
  35. nscoord mBSizeOfARow;
  36. };
  37. #endif /* nsSelectsAreaFrame_h___ */