NS_IMETHODIMP nsSVGTextFrame::AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { if (aNameSpaceID != kNameSpaceID_None) return NS_OK; if (aAttribute == nsGkAtoms::transform) { // transform has changed // make sure our cached transform matrix gets (lazily) updated mCanvasTM = nsnull; nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED); } else if (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y || aAttribute == nsGkAtoms::dx || aAttribute == nsGkAtoms::dy) { NotifyGlyphMetricsChange(); } return NS_OK; }
NS_IMETHODIMP nsSVGTextContainerFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsFrameList& aFrameList) { nsresult rv = nsSVGDisplayContainerFrame::InsertFrames(aListName, aPrevFrame, aFrameList); NotifyGlyphMetricsChange(); return rv; }
NS_IMETHODIMP nsSVGTSpanFrame::AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { if (aNameSpaceID == kNameSpaceID_None && (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y || aAttribute == nsGkAtoms::dx || aAttribute == nsGkAtoms::dy)) { NotifyGlyphMetricsChange(); } return NS_OK; }
NS_IMETHODIMP nsSVGTSpanFrame::AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { if (aNameSpaceID == kNameSpaceID_None && (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y || aAttribute == nsGkAtoms::dx || aAttribute == nsGkAtoms::dy || aAttribute == nsGkAtoms::rotate)) { nsSVGUtils::InvalidateAndScheduleReflowSVG(this); NotifyGlyphMetricsChange(); } return NS_OK; }
NS_IMETHODIMP nsSVGTSpanFrame::AttributeChanged(int32_t aNameSpaceID, nsIAtom* aAttribute, int32_t aModType) { if (aNameSpaceID == kNameSpaceID_None && (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y || aAttribute == nsGkAtoms::dx || aAttribute == nsGkAtoms::dy || aAttribute == nsGkAtoms::rotate)) { nsSVGEffects::InvalidateRenderingObservers(this); nsSVGUtils::ScheduleReflowSVG(this); NotifyGlyphMetricsChange(); } return NS_OK; }
void nsSVGTextFrame::NotifySVGChanged(PRUint32 aFlags) { if (aFlags & TRANSFORM_CHANGED) { // make sure our cached transform matrix gets (lazily) updated mCanvasTM = nsnull; } if (aFlags & COORD_CONTEXT_CHANGED) { // If we are positioned using percentage values we need to update our // position whenever our viewport's dimensions change. // XXX We could check here whether the text frame or any of its children // have any percentage co-ordinates and only update if they don't. This // may not be worth it as we might need to check each glyph NotifyGlyphMetricsChange(); } nsSVGTextFrameBase::NotifySVGChanged(aFlags); }