Use nsIFrame::GetBorderRadii so that we pick up when it is overridden. (Bug 459144, patch 7) r=roc a2.0=blocking:beta6+

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- *//* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */// YY need to pass isMultiple before create called//#include "nsFormControlFrame.h"#include"nsHTMLContainerFrame.h"#include"nsLegendFrame.h"#include"nsIDOMNode.h"#include"nsIDOMHTMLFieldSetElement.h"#include"nsIDOMHTMLLegendElement.h"#include"nsCSSRendering.h"//#include "nsIDOMHTMLCollection.h"#include"nsIContent.h"#include"nsIFrame.h"#include"nsISupports.h"#include"nsIAtom.h"#include"nsPresContext.h"#include"nsFrameManager.h"#include"nsHTMLParts.h"#include"nsGkAtoms.h"#include"nsStyleConsts.h"#include"nsFont.h"#include"nsCOMPtr.h"#ifdef ACCESSIBILITY#include"nsIAccessibilityService.h"#endif#include"nsIServiceManager.h"#include"nsDisplayList.h"classnsLegendFrame;classnsFieldSetFrame:publicnsHTMLContainerFrame{public:NS_DECL_FRAMEARENA_HELPERSnsFieldSetFrame(nsStyleContext*aContext);NS_IMETHODSetInitialChildList(nsIAtom*aListName,nsFrameList&aChildList);NS_HIDDEN_(nscoord)GetIntrinsicWidth(nsIRenderingContext*aRenderingContext,nsLayoutUtils::IntrinsicWidthType);virtualnscoordGetMinWidth(nsIRenderingContext*aRenderingContext);virtualnscoordGetPrefWidth(nsIRenderingContext*aRenderingContext);virtualnsSizeComputeSize(nsIRenderingContext*aRenderingContext,nsSizeaCBSize,nscoordaAvailableWidth,nsSizeaMargin,nsSizeaBorder,nsSizeaPadding,PRBoolaShrinkWrap);virtualnscoordGetBaseline()const;NS_IMETHODReflow(nsPresContext*aPresContext,nsHTMLReflowMetrics&aDesiredSize,constnsHTMLReflowState&aReflowState,nsReflowStatus&aStatus);NS_IMETHODBuildDisplayList(nsDisplayListBuilder*aBuilder,constnsRect&aDirtyRect,constnsDisplayListSet&aLists);voidPaintBorderBackground(nsIRenderingContext&aRenderingContext,nsPointaPt,constnsRect&aDirtyRect,PRUint32aBGFlags);NS_IMETHODAppendFrames(nsIAtom*aListName,nsFrameList&aFrameList);NS_IMETHODInsertFrames(nsIAtom*aListName,nsIFrame*aPrevFrame,nsFrameList&aFrameList);NS_IMETHODRemoveFrame(nsIAtom*aListName,nsIFrame*aOldFrame);virtualnsIAtom*GetType()const;virtualPRBoolIsContainingBlock()const;#ifdef ACCESSIBILITY virtualalready_AddRefed<nsAccessible>CreateAccessible();#endif#ifdef DEBUGNS_IMETHODGetFrameName(nsAString&aResult)const{returnMakeFrameName(NS_LITERAL_STRING("FieldSet"),aResult);}#endifprotected:virtualPRIntnGetSkipSides()const;voidReparentFrameList(constnsFrameList&aFrameList);nsIFrame*mLegendFrame;nsIFrame*mContentFrame;nsRectmLegendRect;nscoordmLegendSpace;};nsIFrame*NS_NewFieldSetFrame(nsIPresShell*aPresShell,nsStyleContext*aContext){returnnew(aPresShell)nsFieldSetFrame(aContext);}NS_IMPL_FRAMEARENA_HELPERS(nsFieldSetFrame)nsFieldSetFrame::nsFieldSetFrame(nsStyleContext*aContext):nsHTMLContainerFrame(aContext){mContentFrame=nsnull;mLegendFrame=nsnull;mLegendSpace=0;}nsIAtom*nsFieldSetFrame::GetType()const{returnnsGkAtoms::fieldSetFrame;}PRBoolnsFieldSetFrame::IsContainingBlock()const{returnPR_TRUE;}NS_IMETHODIMPnsFieldSetFrame::SetInitialChildList(nsIAtom*aListName,nsFrameList&aChildList){// Get the content and legend frames.if(!aChildList.OnlyChild()){NS_ASSERTION(aChildList.GetLength()==2,"Unexpected child list");mContentFrame=aChildList.LastChild();mLegendFrame=aChildList.FirstChild();}else{mContentFrame=aChildList.FirstChild();mLegendFrame=nsnull;}// Queue up the frames for the content framereturnnsHTMLContainerFrame::SetInitialChildList(nsnull,aChildList);}classnsDisplayFieldSetBorderBackground:publicnsDisplayItem{public:nsDisplayFieldSetBorderBackground(nsDisplayListBuilder*aBuilder,nsFieldSetFrame*aFrame):nsDisplayItem(aBuilder,aFrame){MOZ_COUNT_CTOR(nsDisplayFieldSetBorderBackground);}#ifdef NS_BUILD_REFCNT_LOGGINGvirtual~nsDisplayFieldSetBorderBackground(){MOZ_COUNT_DTOR(nsDisplayFieldSetBorderBackground);}#endifvirtualvoidHitTest(nsDisplayListBuilder*aBuilder,constnsRect&aRect,HitTestState*aState,nsTArray<nsIFrame*>*aOutFrames);virtualvoidPaint(nsDisplayListBuilder*aBuilder,nsIRenderingContext*aCtx);NS_DISPLAY_DECL_NAME("FieldSetBorderBackground",TYPE_FIELDSET_BORDER_BACKGROUND)};voidnsDisplayFieldSetBorderBackground::HitTest(nsDisplayListBuilder*aBuilder,constnsRect&aRect,HitTestState*aState,nsTArray<nsIFrame*>*aOutFrames){// aPt is guaranteed to be in this item's bounds. We do the hit test based on the// frame bounds even though our background doesn't cover the whole frame.// It's not clear whether this is correct.aOutFrames->AppendElement(mFrame);}voidnsDisplayFieldSetBorderBackground::Paint(nsDisplayListBuilder*aBuilder,nsIRenderingContext*aCtx){static_cast<nsFieldSetFrame*>(mFrame)->PaintBorderBackground(*aCtx,ToReferenceFrame(),mVisibleRect,aBuilder->GetBackgroundPaintFlags());}NS_IMETHODIMPnsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder*aBuilder,constnsRect&aDirtyRect,constnsDisplayListSet&aLists){// Paint our background and border in a special way.// REVIEW: We don't really need to check frame emptiness here; if it's empty,// the background/border display item won't do anything, and if it isn't empty,// we need to paint the outlineif(IsVisibleForPainting(aBuilder)){if(GetStyleBorder()->mBoxShadow){nsresultrv=aLists.BorderBackground()->AppendNewToTop(new(aBuilder)nsDisplayBoxShadowOuter(aBuilder,this));NS_ENSURE_SUCCESS(rv,rv);}// don't bother checking to see if we really have a border or background.// we usually will have a border.nsresultrv=aLists.BorderBackground()->AppendNewToTop(new(aBuilder)nsDisplayFieldSetBorderBackground(aBuilder,this));NS_ENSURE_SUCCESS(rv,rv);rv=DisplayOutlineUnconditional(aBuilder,aLists);NS_ENSURE_SUCCESS(rv,rv);DO_GLOBAL_REFLOW_COUNT_DSP("nsFieldSetFrame");}nsDisplayListCollectioncontentDisplayItems;if(mContentFrame){// Collect mContentFrame's display items into their own collection. We need// to be calling BuildDisplayList on mContentFrame before mLegendFrame in// case it contains out-of-flow frames whose placeholders are under// mLegendFrame. However, we want mContentFrame's display items to be// after mLegendFrame's display items in z-order, so we need to save them// and append them later.nsresultrv=BuildDisplayListForChild(aBuilder,mContentFrame,aDirtyRect,contentDisplayItems);NS_ENSURE_SUCCESS(rv,rv);}if(mLegendFrame){// The legend's background goes on our BlockBorderBackgrounds list because// it's a block child.nsDisplayListSetset(aLists,aLists.BlockBorderBackgrounds());nsresultrv=BuildDisplayListForChild(aBuilder,mLegendFrame,aDirtyRect,set);NS_ENSURE_SUCCESS(rv,rv);}// Put mContentFrame's display items on the master list. Note that// this moves mContentFrame's border/background display items to our// BorderBackground() list, which isn't really correct, but it's OK because// mContentFrame is anonymous and can't have its own border and background.contentDisplayItems.MoveTo(aLists);returnNS_OK;}voidnsFieldSetFrame::PaintBorderBackground(nsIRenderingContext&aRenderingContext,nsPointaPt,constnsRect&aDirtyRect,PRUint32aBGFlags){PRIntnskipSides=GetSkipSides();constnsStyleBorder*borderStyle=GetStyleBorder();nscoordtopBorder=borderStyle->GetActualBorderWidth(NS_SIDE_TOP);nscoordyoff=0;nsPresContext*presContext=PresContext();// if the border is smaller than the legend. Move the border down// to be centered on the legend. // FIXME: This means border-radius clamping is incorrect; we should// override nsIFrame::GetBorderRadii.if(topBorder<mLegendRect.height)yoff=(mLegendRect.height-topBorder)/2;nsRectrect(aPt.x,aPt.y+yoff,mRect.width,mRect.height-yoff);nsCSSRendering::PaintBackground(presContext,aRenderingContext,this,aDirtyRect,rect,aBGFlags);nsCSSRendering::PaintBoxShadowInner(presContext,aRenderingContext,this,rect,aDirtyRect);if(mLegendFrame){// Use the rect of the legend frame, not mLegendRect, so we draw our// border under the legend's left and right margins.nsRectlegendRect=mLegendFrame->GetRect()+aPt;// we should probably use PaintBorderEdges to do this but for now just use clipping// to achieve the same effect.// draw left sidensRectclipRect(rect);clipRect.width=legendRect.x-rect.x;clipRect.height=topBorder;aRenderingContext.PushState();aRenderingContext.SetClipRect(clipRect,nsClipCombine_kIntersect);nsCSSRendering::PaintBorder(presContext,aRenderingContext,this,aDirtyRect,rect,mStyleContext,skipSides);aRenderingContext.PopState();// draw right sideclipRect=rect;clipRect.x=legendRect.XMost();clipRect.width=rect.XMost()-legendRect.XMost();clipRect.height=topBorder;aRenderingContext.PushState();aRenderingContext.SetClipRect(clipRect,nsClipCombine_kIntersect);nsCSSRendering::PaintBorder(presContext,aRenderingContext,this,aDirtyRect,rect,mStyleContext,skipSides);aRenderingContext.PopState();// draw bottomclipRect=rect;clipRect.y+=topBorder;clipRect.height=mRect.height-(yoff+topBorder);aRenderingContext.PushState();aRenderingContext.SetClipRect(clipRect,nsClipCombine_kIntersect);nsCSSRendering::PaintBorder(presContext,aRenderingContext,this,aDirtyRect,rect,mStyleContext,skipSides);aRenderingContext.PopState();}else{nsCSSRendering::PaintBorder(presContext,aRenderingContext,this,aDirtyRect,nsRect(aPt,mRect.Size()),mStyleContext,skipSides);}}nscoordnsFieldSetFrame::GetIntrinsicWidth(nsIRenderingContext*aRenderingContext,nsLayoutUtils::IntrinsicWidthTypeaType){nscoordlegendWidth=0;nscoordcontentWidth=0;if(mLegendFrame){legendWidth=nsLayoutUtils::IntrinsicForContainer(aRenderingContext,mLegendFrame,aType);}if(mContentFrame){contentWidth=nsLayoutUtils::IntrinsicForContainer(aRenderingContext,mContentFrame,aType);}returnNS_MAX(legendWidth,contentWidth);}nscoordnsFieldSetFrame::GetMinWidth(nsIRenderingContext*aRenderingContext){nscoordresult=0;DISPLAY_MIN_WIDTH(this,result);result=GetIntrinsicWidth(aRenderingContext,nsLayoutUtils::MIN_WIDTH);returnresult;}nscoordnsFieldSetFrame::GetPrefWidth(nsIRenderingContext*aRenderingContext){nscoordresult=0;DISPLAY_PREF_WIDTH(this,result);result=GetIntrinsicWidth(aRenderingContext,nsLayoutUtils::PREF_WIDTH);returnresult;}/* virtual */nsSizensFieldSetFrame::ComputeSize(nsIRenderingContext*aRenderingContext,nsSizeaCBSize,nscoordaAvailableWidth,nsSizeaMargin,nsSizeaBorder,nsSizeaPadding,PRBoolaShrinkWrap){nsSizeresult=nsHTMLContainerFrame::ComputeSize(aRenderingContext,aCBSize,aAvailableWidth,aMargin,aBorder,aPadding,aShrinkWrap);// Fieldsets never shrink below their min width.nscoordminWidth=GetMinWidth(aRenderingContext);if(minWidth>result.width)result.width=minWidth;returnresult;}NS_IMETHODIMPnsFieldSetFrame::Reflow(nsPresContext*aPresContext,nsHTMLReflowMetrics&aDesiredSize,constnsHTMLReflowState&aReflowState,nsReflowStatus&aStatus){DO_GLOBAL_REFLOW_COUNT("nsFieldSetFrame");DISPLAY_REFLOW(aPresContext,this,aReflowState,aDesiredSize,aStatus);NS_PRECONDITION(aReflowState.ComputedWidth()!=NS_INTRINSICSIZE,"Should have a precomputed width!");// Initialize OUT parameteraStatus=NS_FRAME_COMPLETE;//------------ Handle Incremental Reflow -----------------PRBoolreflowContent;PRBoolreflowLegend;if(aReflowState.ShouldReflowAllKids()){reflowContent=mContentFrame!=nsnull;reflowLegend=mLegendFrame!=nsnull;}else{reflowContent=mContentFrame&&NS_SUBTREE_DIRTY(mContentFrame);reflowLegend=mLegendFrame&&NS_SUBTREE_DIRTY(mLegendFrame);}// We don't allow fieldsets to break vertically. If we did, we'd// need logic here to push and pull overflow frames.nsSizeavailSize(aReflowState.ComputedWidth(),NS_UNCONSTRAINEDSIZE);NS_ASSERTION(!mContentFrame||nsLayoutUtils::IntrinsicForContainer(aReflowState.rendContext,mContentFrame,nsLayoutUtils::MIN_WIDTH)<=availSize.width,"Bogus availSize.width; should be bigger");NS_ASSERTION(!mLegendFrame||nsLayoutUtils::IntrinsicForContainer(aReflowState.rendContext,mLegendFrame,nsLayoutUtils::MIN_WIDTH)<=availSize.width,"Bogus availSize.width; should be bigger");// get our border and paddingconstnsMargin&borderPadding=aReflowState.mComputedBorderPadding;nsMarginborder=borderPadding-aReflowState.mComputedPadding;// Figure out how big the legend is if there is one. // get the legend's marginnsMarginlegendMargin(0,0,0,0);// reflow the legend only if neededif(reflowLegend){nsHTMLReflowStatelegendReflowState(aPresContext,aReflowState,mLegendFrame,availSize);nsHTMLReflowMetricslegendDesiredSize;ReflowChild(mLegendFrame,aPresContext,legendDesiredSize,legendReflowState,0,0,NS_FRAME_NO_MOVE_FRAME,aStatus);#ifdef NOISY_REFLOWprintf(" returned (%d, %d)\n",legendDesiredSize.width,legendDesiredSize.height);#endif// figure out the legend's rectanglelegendMargin=mLegendFrame->GetUsedMargin();mLegendRect.width=legendDesiredSize.width+legendMargin.left+legendMargin.right;mLegendRect.height=legendDesiredSize.height+legendMargin.top+legendMargin.bottom;mLegendRect.x=borderPadding.left;mLegendRect.y=0;nscoordoldSpace=mLegendSpace;mLegendSpace=0;if(mLegendRect.height>border.top){// center the border on the legendmLegendSpace=mLegendRect.height-border.top;}else{mLegendRect.y=(border.top-mLegendRect.height)/2;}// if the legend space changes then we need to reflow the // content area as well.if(mLegendSpace!=oldSpace&&mContentFrame){reflowContent=PR_TRUE;}FinishReflowChild(mLegendFrame,aPresContext,&legendReflowState,legendDesiredSize,0,0,NS_FRAME_NO_MOVE_FRAME);}elseif(!mLegendFrame){mLegendRect.Empty();mLegendSpace=0;}else{// mLegendSpace and mLegendRect haven't changed, but we need// the used margin when placing the legend.legendMargin=mLegendFrame->GetUsedMargin();}// reflow the content frame only if neededif(reflowContent){nsHTMLReflowStatekidReflowState(aPresContext,aReflowState,mContentFrame,availSize);// Our child is "height:100%" but we actually want its height to be reduced// by the amount of content-height the legend is eating up, unless our// height is unconstrained (in which case the child's will be too).if(aReflowState.ComputedHeight()!=NS_UNCONSTRAINEDSIZE){kidReflowState.SetComputedHeight(NS_MAX(0,aReflowState.ComputedHeight()-mLegendSpace));}kidReflowState.mComputedMinHeight=NS_MAX(0,aReflowState.mComputedMinHeight-mLegendSpace);if(aReflowState.mComputedMaxHeight!=NS_UNCONSTRAINEDSIZE){kidReflowState.mComputedMaxHeight=NS_MAX(0,aReflowState.mComputedMaxHeight-mLegendSpace);}nsHTMLReflowMetricskidDesiredSize(aDesiredSize.mFlags);// Reflow the frameNS_ASSERTION(kidReflowState.mComputedMargin==nsMargin(0,0,0,0),"Margins on anonymous fieldset child not supported!");nsPointpt(borderPadding.left,borderPadding.top+mLegendSpace);ReflowChild(mContentFrame,aPresContext,kidDesiredSize,kidReflowState,pt.x,pt.y,0,aStatus);FinishReflowChild(mContentFrame,aPresContext,&kidReflowState,kidDesiredSize,pt.x,pt.y,0);NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow",aStatus);}nsRectcontentRect(0,0,0,0);if(mContentFrame){// We don't support margins on mContentFrame, so our "content rect" is just// its rect.contentRect=mContentFrame->GetRect();}// use the computed width if the inner content does not fill itif(aReflowState.ComputedWidth()>contentRect.width){contentRect.width=aReflowState.ComputedWidth();}if(mLegendFrame){// if the content rect is larger then the legend we can align the legendif(contentRect.width>mLegendRect.width){PRInt32align=static_cast<nsLegendFrame*>(mLegendFrame)->GetAlign();switch(align){caseNS_STYLE_TEXT_ALIGN_RIGHT:mLegendRect.x=contentRect.width-mLegendRect.width+borderPadding.left;break;caseNS_STYLE_TEXT_ALIGN_CENTER:// Note: rounding removed; there doesn't seem to be any needmLegendRect.x=contentRect.width/2-mLegendRect.width/2+borderPadding.left;break;}}else{// otherwise make place for the legendcontentRect.width=mLegendRect.width;}// place the legendnsRectactualLegendRect(mLegendRect);actualLegendRect.Deflate(legendMargin);nsPointcurOrigin=mLegendFrame->GetPosition();// only if the origin changedif((curOrigin.x!=mLegendRect.x)||(curOrigin.y!=mLegendRect.y)){mLegendFrame->SetPosition(nsPoint(actualLegendRect.x,actualLegendRect.y));nsContainerFrame::PositionFrameView(mLegendFrame);// We need to recursively process the legend frame's// children since we're moving the frame after Reflow.nsContainerFrame::PositionChildViews(mLegendFrame);}}// Return our size and our resultif(aReflowState.ComputedHeight()==NS_INTRINSICSIZE){aDesiredSize.height=mLegendSpace+borderPadding.TopBottom()+contentRect.height;}else{nscoordmin=borderPadding.TopBottom()+mLegendRect.height;aDesiredSize.height=aReflowState.ComputedHeight()+borderPadding.TopBottom();if(aDesiredSize.height<min)aDesiredSize.height=min;}aDesiredSize.width=contentRect.width+borderPadding.LeftRight();aDesiredSize.mOverflowArea=nsRect(0,0,aDesiredSize.width,aDesiredSize.height);if(mLegendFrame)ConsiderChildOverflow(aDesiredSize.mOverflowArea,mLegendFrame);if(mContentFrame)ConsiderChildOverflow(aDesiredSize.mOverflowArea,mContentFrame);FinishAndStoreOverflow(&aDesiredSize);Invalidate(aDesiredSize.mOverflowArea);NS_FRAME_SET_TRUNCATION(aStatus,aReflowState,aDesiredSize);returnNS_OK;}PRIntnnsFieldSetFrame::GetSkipSides()const{return0;}NS_IMETHODIMPnsFieldSetFrame::AppendFrames(nsIAtom*aListName,nsFrameList&aFrameList){// aFrameList is not allowed to contain "the legend" for this fieldsetReparentFrameList(aFrameList);returnmContentFrame->AppendFrames(aListName,aFrameList);}NS_IMETHODIMPnsFieldSetFrame::InsertFrames(nsIAtom*aListName,nsIFrame*aPrevFrame,nsFrameList&aFrameList){NS_ASSERTION(!aPrevFrame||aPrevFrame->GetParent()==this||aPrevFrame->GetParent()==mContentFrame,"inserting after sibling frame with different parent");// aFrameList is not allowed to contain "the legend" for this fieldsetReparentFrameList(aFrameList);if(NS_UNLIKELY(aPrevFrame==mLegendFrame)){aPrevFrame=nsnull;}returnmContentFrame->InsertFrames(aListName,aPrevFrame,aFrameList);}NS_IMETHODIMPnsFieldSetFrame::RemoveFrame(nsIAtom*aListName,nsIFrame*aOldFrame){// For reference, see bug 70648, bug 276104 and bug 236071.NS_ASSERTION(aOldFrame!=mLegendFrame,"Cannot remove mLegendFrame here");returnmContentFrame->RemoveFrame(aListName,aOldFrame);}#ifdef ACCESSIBILITYalready_AddRefed<nsAccessible>nsFieldSetFrame::CreateAccessible(){nsCOMPtr<nsIAccessibilityService>accService=do_GetService("@mozilla.org/accessibilityService;1");if(accService){returnaccService->CreateHTMLGroupboxAccessible(mContent,PresContext()->PresShell());}returnnsnull;}#endifvoidnsFieldSetFrame::ReparentFrameList(constnsFrameList&aFrameList){nsFrameManager*frameManager=PresContext()->FrameManager();for(nsFrameList::Enumeratore(aFrameList);!e.AtEnd();e.Next()){NS_ASSERTION(mLegendFrame||e.get()->GetType()!=nsGkAtoms::legendFrame,"The fieldset's legend is not allowed in this list");e.get()->SetParent(mContentFrame);frameManager->ReparentStyleContext(e.get());}}nscoordnsFieldSetFrame::GetBaseline()const{// We know mContentFrame is a block, so calling GetBaseline() on it will do// the right thing (that being to return the baseline of the last line).NS_ASSERTION(nsLayoutUtils::GetAsBlock(mContentFrame),"Unexpected mContentFrame");returnmContentFrame->GetPosition().y+mContentFrame->GetBaseline();}