1 /* { dg-additional-options "-Wno-return-type" } */ 2 3 typedef unsigned int PRUint32; 4 typedef int PRInt32; 5 typedef unsigned long PRUint64; 6 typedef int PRIntn; 7 typedef PRIntn PRBool; 8 struct nsRect { nsRectnsRect9 nsRect(const nsRect& aRect) { } 10 }; 11 enum nsCompatibility { eCompatibility_NavQuirks = 3 }; 12 class gfxContext; 13 typedef PRUint64 nsFrameState; 14 class nsPresContext { 15 public: CompatibilityMode()16 nsCompatibility CompatibilityMode() const { } 17 }; 18 class nsStyleContext { 19 public: 20 PRBool HasTextDecorations() const; 21 }; 22 class nsIFrame { 23 public: 24 nsPresContext* PresContext() const; 25 nsStyleContext* GetStyleContext() const; 26 nsFrameState GetStateBits() const; 27 nsRect GetOverflowRect() const; 28 }; 29 class nsFrame : public nsIFrame { }; 30 class nsLineList_iterator { }; 31 class nsLineList { 32 public: 33 typedef nsLineList_iterator iterator; 34 }; 35 class gfxSkipCharsIterator { }; 36 class gfxTextRun { 37 public: 38 class PropertyProvider { }; 39 }; 40 class nsTextFrame : public nsFrame 41 { 42 virtual nsRect ComputeTightBounds(gfxContext* aContext) const; 43 gfxSkipCharsIterator EnsureTextRun(gfxContext* aReferenceContext = 0L, 44 nsIFrame* aLineContainer = 0L, 45 const nsLineList::iterator* aLine = 0L, 46 PRUint32* aFlowEndInTextRun = 0L); 47 }; 48 class PropertyProvider : public gfxTextRun::PropertyProvider 49 { 50 public: 51 PropertyProvider(nsTextFrame* aFrame, const gfxSkipCharsIterator& aStart); 52 PRInt32 mLength[64]; 53 }; ComputeTightBounds(gfxContext * aContext)54nsRect nsTextFrame::ComputeTightBounds(gfxContext* aContext) const 55 { 56 if ((GetStyleContext()->HasTextDecorations() 57 && eCompatibility_NavQuirks == PresContext()->CompatibilityMode()) 58 || (GetStateBits() & (nsFrameState(1) << (23)))) 59 return GetOverflowRect(); 60 gfxSkipCharsIterator iter = const_cast<nsTextFrame*>(this)->EnsureTextRun(); 61 PropertyProvider provider(const_cast<nsTextFrame*>(this), iter); 62 } 63