mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 895285 - Handle viewBox="" setting optimization correctly. r=jwatt
This commit is contained in:
parent
c4ee1ccec7
commit
fdb36cc83d
@ -163,7 +163,8 @@ nsSVGViewBox::SetBaseValueString(const nsAString& aValue,
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
if (viewBox == mBaseVal) {
|
||||
// Comparison against mBaseVal is only valid if we currently have a base val.
|
||||
if (mHasBaseVal && viewBox == mBaseVal) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -300,6 +300,18 @@ function runTests()
|
||||
is(marker.hasAttribute("viewBox"), true, "viewBox hasAttribute");
|
||||
ok(marker.getAttribute("viewBox") === "", "empty viewBox attribute");
|
||||
|
||||
marker.setAttribute("viewBox", "9 10 11 12");
|
||||
marker.removeAttribute("viewBox");
|
||||
marker.setAttribute("viewBox", "9 10 11 12");
|
||||
is(marker.viewBox.baseVal.x, 9, "viewBox.x baseVal after re-setting attribute to same rect value");
|
||||
is(marker.viewBox.baseVal.y, 10, "viewBox.y baseVal after re-setting attribute to same rect value");
|
||||
is(marker.viewBox.baseVal.width, 11, "viewBox.width baseVal after re-setting attribute to same rect value");
|
||||
is(marker.viewBox.baseVal.height, 12, "viewBox.height baseVal after re-setting attribute to same rect value");
|
||||
is(marker.viewBox.animVal.x, 9, "viewBox.x animVal after re-setting attribute to same rect value");
|
||||
is(marker.viewBox.animVal.y, 10, "viewBox.y animVal after re-setting attribute to same rect value");
|
||||
is(marker.viewBox.animVal.width, 11, "viewBox.width animVal after re-setting attribute to same rect value");
|
||||
is(marker.viewBox.animVal.height, 12, "viewBox.height animVal after re-setting attribute to same rect value");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user