Bug 649114 - Text-anchor middle is not computed correctly for element scaled to 0. r=jwatt

This commit is contained in:
Robert Longson 2012-01-28 13:58:17 +00:00
Родитель 9246e483b6
Коммит 6cd6ed7621
4 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -100,6 +100,7 @@ random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == dynamic-text-04.svg dyna
== dynamic-text-05.svg pass.svg
== dynamic-text-06.svg pass.svg
== dynamic-text-07.svg dynamic-text-07-ref.svg
== dynamic-text-08.svg dynamic-text-08-ref.svg
== dynamic-textPath-01.svg dynamic-textPath-01-ref.svg
== dynamic-use-01.svg pass.svg
== dynamic-use-02.svg pass.svg

Просмотреть файл

@ -138,16 +138,10 @@ nsSVGAFrame::AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType)
{
if (aNameSpaceID != kNameSpaceID_None)
return NS_OK;
if (aNameSpaceID == kNameSpaceID_None &&
aAttribute == nsGkAtoms::transform) {
if (aAttribute == nsGkAtoms::transform) {
// transform has changed
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nsnull;
nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
NotifySVGChanged(TRANSFORM_CHANGED);
}
return NS_OK;

Просмотреть файл

@ -111,10 +111,8 @@ nsSVGGFrame::AttributeChanged(PRInt32 aNameSpaceID,
{
if (aNameSpaceID == kNameSpaceID_None &&
aAttribute == nsGkAtoms::transform) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nsnull;
nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
NotifySVGChanged(TRANSFORM_CHANGED);
}
return NS_OK;

Просмотреть файл

@ -89,12 +89,8 @@ nsSVGTextFrame::AttributeChanged(PRInt32 aNameSpaceID,
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);
NotifySVGChanged(TRANSFORM_CHANGED);
} else if (aAttribute == nsGkAtoms::x ||
aAttribute == nsGkAtoms::y ||
@ -185,14 +181,24 @@ nsSVGTextFrame::GetRotationOfChar(PRUint32 charnum, float *_retval)
void
nsSVGTextFrame::NotifySVGChanged(PRUint32 aFlags)
{
bool updateGlyphMetrics = false;
if (aFlags & COORD_CONTEXT_CHANGED) {
updateGlyphMetrics = true;
}
if (aFlags & TRANSFORM_CHANGED) {
if (mCanvasTM && mCanvasTM->IsSingular()) {
// We won't have calculated the glyph positions correctly
updateGlyphMetrics = true;
}
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nsnull;
}
nsSVGTextFrameBase::NotifySVGChanged(aFlags);
if (aFlags & COORD_CONTEXT_CHANGED) {
if (updateGlyphMetrics) {
// If we are positioned using percentage values we need to update our
// position whenever our viewport's dimensions change.