Bug 841812 - Avoid crashing when changing attributes on an invalidly parented <textPath>. r=roc

This commit is contained in:
Cameron McCormack 2013-02-16 20:16:11 +11:00
parent 8765553d79
commit a5d156f4b3
3 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<text>
<circle>
<textPath id="t" xlink:href="data:text/html,1" />
</circle>
</text>
<script>
window.addEventListener("load", function() { document.getElementById("t").removeAttribute('xlink:href'); }, false);
</script>
</svg>

After

Width:  |  Height:  |  Size: 363 B

View File

@ -152,3 +152,4 @@ load 789390-1.html
load 808318-1.svg
load 813420-1.svg
load 841163-1.svg
load 841812-1.svg

View File

@ -2956,9 +2956,11 @@ nsSVGTextFrame2::MutationObserver::AttributeChanged(
aAttribute == nsGkAtoms::href) {
// Blow away our reference, if any
nsIFrame* childElementFrame = aElement->GetPrimaryFrame();
if (childElementFrame) {
childElementFrame->Properties().Delete(nsSVGEffects::HrefProperty());
mFrame->NotifyGlyphMetricsChange();
}
}
} else {
if (aNameSpaceID == kNameSpaceID_None &&
IsGlyphPositioningAttribute(aAttribute)) {