1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/nsLeafBoxFrame.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,92 @@ 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 nsLeafBoxFrame_h___ 1.9 +#define nsLeafBoxFrame_h___ 1.10 + 1.11 +#include "mozilla/Attributes.h" 1.12 +#include "nsLeafFrame.h" 1.13 +#include "nsBox.h" 1.14 + 1.15 +class nsAccessKeyInfo; 1.16 + 1.17 +class nsLeafBoxFrame : public nsLeafFrame 1.18 +{ 1.19 +public: 1.20 + NS_DECL_FRAMEARENA_HELPERS 1.21 + 1.22 + friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.23 + 1.24 + virtual nsSize GetPrefSize(nsBoxLayoutState& aState) MOZ_OVERRIDE; 1.25 + virtual nsSize GetMinSize(nsBoxLayoutState& aState) MOZ_OVERRIDE; 1.26 + virtual nsSize GetMaxSize(nsBoxLayoutState& aState) MOZ_OVERRIDE; 1.27 + virtual nscoord GetFlex(nsBoxLayoutState& aState) MOZ_OVERRIDE; 1.28 + virtual nscoord GetBoxAscent(nsBoxLayoutState& aState) MOZ_OVERRIDE; 1.29 + 1.30 + virtual nsIAtom* GetType() const MOZ_OVERRIDE; 1.31 + virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE 1.32 + { 1.33 + // This is bogus, but it's what we've always done. 1.34 + // Note that nsLeafFrame is also eReplacedContainsBlock. 1.35 + return nsLeafFrame::IsFrameOfType(aFlags & 1.36 + ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox)); 1.37 + } 1.38 + 1.39 +#ifdef DEBUG_FRAME_DUMP 1.40 + virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE; 1.41 +#endif 1.42 + 1.43 + // nsIHTMLReflow overrides 1.44 + 1.45 + virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE; 1.46 + virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; 1.47 + virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; 1.48 + 1.49 + // Our auto size is that provided by nsFrame, not nsLeafFrame 1.50 + virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext, 1.51 + nsSize aCBSize, nscoord aAvailableWidth, 1.52 + nsSize aMargin, nsSize aBorder, 1.53 + nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE; 1.54 + 1.55 + virtual nsresult Reflow(nsPresContext* aPresContext, 1.56 + nsHTMLReflowMetrics& aDesiredSize, 1.57 + const nsHTMLReflowState& aReflowState, 1.58 + nsReflowStatus& aStatus) MOZ_OVERRIDE; 1.59 + 1.60 + virtual nsresult CharacterDataChanged(CharacterDataChangeInfo* aInfo) MOZ_OVERRIDE; 1.61 + 1.62 + virtual void Init(nsIContent* aContent, 1.63 + nsIFrame* aParent, 1.64 + nsIFrame* asPrevInFlow) MOZ_OVERRIDE; 1.65 + 1.66 + virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, 1.67 + const nsRect& aDirtyRect, 1.68 + const nsDisplayListSet& aLists) MOZ_OVERRIDE; 1.69 + 1.70 + virtual nsresult AttributeChanged(int32_t aNameSpaceID, 1.71 + nsIAtom* aAttribute, 1.72 + int32_t aModType) MOZ_OVERRIDE; 1.73 + 1.74 + virtual bool ComputesOwnOverflowArea() MOZ_OVERRIDE { return false; } 1.75 + 1.76 +protected: 1.77 + 1.78 + NS_IMETHOD DoLayout(nsBoxLayoutState& aState) MOZ_OVERRIDE; 1.79 + 1.80 +#ifdef DEBUG_LAYOUT 1.81 + virtual void GetBoxName(nsAutoString& aName) MOZ_OVERRIDE; 1.82 +#endif 1.83 + 1.84 + virtual nscoord GetIntrinsicWidth() MOZ_OVERRIDE; 1.85 + 1.86 + nsLeafBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext); 1.87 + 1.88 +private: 1.89 + 1.90 + void UpdateMouseThrough(); 1.91 + 1.92 + 1.93 +}; // class nsLeafBoxFrame 1.94 + 1.95 +#endif /* nsLeafBoxFrame_h___ */