From 44ad3bb3923ec975a6a6dee1db888113ede26570 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Wed, 6 Oct 2010 21:25:46 -0700 Subject: [PATCH] Now that overflow areas are split, change nsIFrame::ComputeTightBounds to use visual overflow. While it really only needs to include frame bounds, glyph bounds, and text decorations, since glyph bounds are not part of scrollable overflow, it must use visual overflow. (Bug 542595, patch 15) r=roc a2.0=blocking2.0:beta8 --- layout/generic/nsBlockFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 4 ++-- layout/generic/nsIFrame.h | 5 +++++ layout/generic/nsInlineFrame.cpp | 2 +- layout/generic/nsTextFrameThebes.cpp | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 278eebc31ccf..a12ce1e17679 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -834,7 +834,7 @@ nsBlockFrame::ComputeTightBounds(gfxContext* aContext) const { // be conservative if (GetStyleContext()->HasTextDecorations()) - return GetOverflowRect(); + return GetVisualOverflowRect(); return ComputeSimpleTightBounds(aContext); } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 273ac180bd1a..44acbbe64944 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -3439,7 +3439,7 @@ nsFrame::ComputeSize(nsIRenderingContext *aRenderingContext, nsRect nsIFrame::ComputeTightBounds(gfxContext* aContext) const { - return GetOverflowRect(); + return GetVisualOverflowRect(); } nsRect @@ -3450,7 +3450,7 @@ nsFrame::ComputeSimpleTightBounds(gfxContext* aContext) const GetStyleDisplay()->mAppearance) { // Not necessarily tight, due to clipping, negative // outline-offset, and lots of other issues, but that's OK - return GetOverflowRect(); + return GetVisualOverflowRect(); } nsRect r(0, 0, 0, 0); diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 415c212f1998..a41fee3b33ef 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1586,6 +1586,11 @@ public: * that encloses the pixels that are actually drawn. We're allowed to be * conservative and currently we don't try very hard. The rectangle is * in appunits and relative to the origin of this frame. + * + * This probably only needs to include frame bounds, glyph bounds, and + * text decorations, but today it sometimes includes other things that + * contribute to visual overflow. + * * @param aContext a rendering context that can be used if we need * to do measurement */ diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index 4b50179bed63..b154e34a241c 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -231,7 +231,7 @@ nsInlineFrame::ComputeTightBounds(gfxContext* aContext) const { // be conservative if (GetStyleContext()->HasTextDecorations()) - return GetOverflowRect(); + return GetVisualOverflowRect(); return ComputeSimpleTightBounds(aContext); } diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 6e9354f585ee..e1ded06a56f4 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -6075,7 +6075,7 @@ nsTextFrame::ComputeTightBounds(gfxContext* aContext) const eCompatibility_NavQuirks == PresContext()->CompatibilityMode()) || (GetStateBits() & TEXT_HYPHEN_BREAK)) { // This is conservative, but OK. - return GetOverflowRect(); + return GetVisualOverflowRect(); } gfxSkipCharsIterator iter = const_cast(this)->EnsureTextRun();