From f053a6b59ef498889c148c76e88c4aabd01b700a Mon Sep 17 00:00:00 2001 From: "peterlubczynski%netscape.com" Date: Fri, 14 Dec 2001 03:48:49 +0000 Subject: [PATCH] Fix for bad vertical alignment on replaced object frames, bug 36997 r=dbaron sr=attinasi a=brendan git-svn-id: svn://10.0.0.236/trunk@110452 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsObjectFrame.cpp | 10 ++++++++-- mozilla/layout/html/base/src/nsObjectFrame.cpp | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 8d0674f5e89..4109d0a7a2f 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -1138,8 +1138,14 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, } // finish up if (NS_FAILED(rv)) { - // if we got an error, we'll check for alternative content with - // CantRenderReplacedElement() + // if we got an error, we are probably going to be replaced + + // for a replaced object frame, clear our vertical alignment style info, see bug 36997 + nsStyleTextReset* text = NS_STATIC_CAST(nsStyleTextReset*, + mStyleContext->GetUniqueStyleData(mPresContext, eStyleStruct_TextReset)); + text->mVerticalAlign.SetNormalValue(); + + //check for alternative content with CantRenderReplacedElement() nsIPresShell* presShell; aPresContext->GetShell(&presShell); rv = presShell->CantRenderReplacedElement(aPresContext, this); diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index 8d0674f5e89..4109d0a7a2f 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -1138,8 +1138,14 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, } // finish up if (NS_FAILED(rv)) { - // if we got an error, we'll check for alternative content with - // CantRenderReplacedElement() + // if we got an error, we are probably going to be replaced + + // for a replaced object frame, clear our vertical alignment style info, see bug 36997 + nsStyleTextReset* text = NS_STATIC_CAST(nsStyleTextReset*, + mStyleContext->GetUniqueStyleData(mPresContext, eStyleStruct_TextReset)); + text->mVerticalAlign.SetNormalValue(); + + //check for alternative content with CantRenderReplacedElement() nsIPresShell* presShell; aPresContext->GetShell(&presShell); rv = presShell->CantRenderReplacedElement(aPresContext, this);