Bug 387422 - text clip paths don't work. r=tor,sr=roc,a=dbaron

This commit is contained in:
longsonr@gmail.com 2007-08-03 01:39:12 -07:00
parent 908f41f6dc
commit e681945699
6 changed files with 40 additions and 30 deletions

View File

@ -78,12 +78,6 @@ NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* pa
return new (aPresShell) nsSVGGlyphFrame(aContext);
}
nsSVGGlyphFrame::nsSVGGlyphFrame(nsStyleContext* aContext)
: nsSVGGlyphFrameBase(aContext),
mWhitespaceHandling(COMPRESS_WHITESPACE)
{
}
//----------------------------------------------------------------------
// nsISupports methods
@ -107,9 +101,6 @@ nsSVGGlyphFrame::CharacterDataChanged(nsPresContext* aPresContext,
nsresult
nsSVGGlyphFrame::UpdateGraphic(PRBool suppressInvalidation)
{
if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)
return NS_OK;
nsSVGTextContainerFrame *containerFrame =
static_cast<nsSVGTextContainerFrame *>(mParent);
if (containerFrame)
@ -470,8 +461,6 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
NS_IMETHODIMP
nsSVGGlyphFrame::InitialUpdate()
{
nsresult rv = UpdateGraphic();
NS_ASSERTION(!(mState & NS_FRAME_IN_REFLOW),
"We don't actually participate in reflow");
@ -479,7 +468,7 @@ nsSVGGlyphFrame::InitialUpdate()
mState &= ~(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
NS_FRAME_HAS_DIRTY_CHILDREN);
return rv;
return NS_OK;
}
NS_IMETHODIMP

View File

@ -56,11 +56,13 @@ class nsSVGGlyphFrame : public nsSVGGlyphFrameBase,
public nsISVGGlyphFragmentLeaf, // : nsISVGGlyphFragmentNode
public nsISVGChildFrame
{
protected:
friend nsIFrame*
NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent,
nsIFrame* parentFrame, nsStyleContext* aContext);
nsSVGGlyphFrame(nsStyleContext* aContext);
protected:
nsSVGGlyphFrame(nsStyleContext* aContext)
: nsSVGGlyphFrameBase(aContext),
mWhitespaceHandling(COMPRESS_WHITESPACE) {}
public:
// nsISupports interface:

View File

@ -132,6 +132,19 @@ nsSVGTextContainerFrame::GetDy()
//----------------------------------------------------------------------
// nsIFrame methods
NS_IMETHODIMP
nsSVGTextContainerFrame::InsertFrames(nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsIFrame* aFrameList)
{
nsresult rv = nsSVGDisplayContainerFrame::InsertFrames(aListName,
aPrevFrame,
aFrameList);
UpdateGraphic();
return rv;
}
NS_IMETHODIMP
nsSVGTextContainerFrame::RemoveFrame(nsIAtom *aListName, nsIFrame *aOldFrame)
{

View File

@ -67,6 +67,9 @@ private:
public:
// nsIFrame
NS_IMETHOD InsertFrames(nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsIFrame* aFrameList);
NS_IMETHOD RemoveFrame(nsIAtom *aListName, nsIFrame *aOldFrame);
// nsISVGTextContentMetrics

View File

@ -61,29 +61,27 @@
nsIFrame*
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext)
{
nsCOMPtr<nsIDOMSVGTextElement> text_elem = do_QueryInterface(aContent);
if (!text_elem) {
#ifdef DEBUG
printf("warning: trying to construct an SVGTextFrame for a "
"content element that doesn't support the right interfaces\n");
#endif
nsCOMPtr<nsIDOMSVGTextElement> text = do_QueryInterface(aContent);
if (!text) {
NS_ERROR("Can't create frame! Content is not an SVG text");
return nsnull;
}
return new (aPresShell) nsSVGTextFrame(aContext);
}
nsSVGTextFrame::nsSVGTextFrame(nsStyleContext* aContext)
: nsSVGTextFrameBase(aContext),
mMetricsState(unsuspended),
mPropagateTransform(PR_TRUE),
mPositioningDirty(PR_FALSE)
{
}
//----------------------------------------------------------------------
// nsIFrame methods
NS_IMETHODIMP
nsSVGTextFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsSVGTextFrameBase::SetInitialChildList(aListName, aChildList);
NotifyGlyphMetricsChange();
return rv;
}
NS_IMETHODIMP
nsSVGTextFrame::AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,

View File

@ -48,14 +48,19 @@ class nsSVGTextFrame : public nsSVGTextFrameBase
friend nsIFrame*
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
protected:
nsSVGTextFrame(nsStyleContext* aContext);
nsSVGTextFrame(nsStyleContext* aContext)
: nsSVGTextFrameBase(aContext),
mMetricsState(unsuspended),
mPropagateTransform(PR_TRUE),
mPositioningDirty(PR_FALSE) {}
public:
// nsIFrame:
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
NS_IMETHOD DidSetStyleContext();
/**