зеркало из https://github.com/mozilla/gecko-dev.git
Bug 540726 - User units for angles should be degrees. r=jwatt
This commit is contained in:
Родитель
3a13782de3
Коммит
1669296386
|
@ -223,11 +223,11 @@ nsSVGAngle::GetUnitScaleFactor() const
|
|||
switch (mSpecifiedUnitType) {
|
||||
case nsIDOMSVGAngle::SVG_ANGLETYPE_UNSPECIFIED:
|
||||
case nsIDOMSVGAngle::SVG_ANGLETYPE_DEG:
|
||||
return static_cast<float>(180.0 / M_PI);
|
||||
case nsIDOMSVGAngle::SVG_ANGLETYPE_RAD:
|
||||
return 1;
|
||||
case nsIDOMSVGAngle::SVG_ANGLETYPE_RAD:
|
||||
return static_cast<float>(M_PI / 180.0);
|
||||
case nsIDOMSVGAngle::SVG_ANGLETYPE_GRAD:
|
||||
return static_cast<float>(100.0 / M_PI);
|
||||
return 100.0f / 180.0f;
|
||||
default:
|
||||
NS_NOTREACHED("Unknown unit type");
|
||||
return 0;
|
||||
|
|
|
@ -78,19 +78,19 @@ function runTests()
|
|||
|
||||
// angle attribute
|
||||
|
||||
marker.setAttribute("orient", "0.5rad");
|
||||
is(marker.orientAngle.baseVal.value, 0.5, "angle baseVal");
|
||||
is(marker.orientAngle.animVal.value, 0.5, "angle animVal");
|
||||
marker.setAttribute("orient", "90deg");
|
||||
is(marker.orientAngle.baseVal.value, 90, "angle baseVal");
|
||||
is(marker.orientAngle.animVal.value, 90, "angle animVal");
|
||||
|
||||
var baseAngle = marker.orientAngle.baseVal;
|
||||
var animAngle = marker.orientAngle.animVal;
|
||||
marker.setAttribute("orient", "0.75rad");
|
||||
is(baseAngle.value, 0.75, "angle baseVal");
|
||||
is(animAngle.value, 0.75, "angle animVal");
|
||||
marker.setAttribute("orient", "45deg");
|
||||
is(baseAngle.value, 45, "angle baseVal");
|
||||
is(animAngle.value, 45, "angle animVal");
|
||||
|
||||
marker.orientAngle.baseVal.value = 0.25;
|
||||
is(marker.orientAngle.animVal.value, 0.25, "angle animVal");
|
||||
is(marker.getAttribute("orient"), "0.25rad", "angle attribute");
|
||||
marker.orientAngle.baseVal.value = 30;
|
||||
is(marker.orientAngle.animVal.value, 30, "angle animVal");
|
||||
is(marker.getAttribute("orient"), "30deg", "angle attribute");
|
||||
|
||||
// boolean attribute
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче