Bug 393910 - Serialize "0" as "0px" for lengths instead of "0pt"; r=dbaron

This commit is contained in:
Aryeh Gregor 2012-02-14 10:54:08 -05:00
Родитель d22ac23025
Коммит 79aabffdf5
4 изменённых файлов: 10 добавлений и 5 удалений

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

@ -49,7 +49,7 @@ function attr_modified(ev) {
e_prev = e_new;
if (!recursive) {
recursive = true;
e_new = "width: 0pt;";
e_new = "width: 0px;";
testDiv.style.width = "0";
} else {
recursive = false;

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

@ -4331,7 +4331,7 @@ CSSParserImpl::TranslateDimension(nsCSSValue& aValue,
// Must be a zero number...
NS_ASSERTION(0 == aNumber, "numbers without units must be 0");
if ((VARIANT_LENGTH & aVariantMask) != 0) {
units = eCSSUnit_Point;
units = eCSSUnit_Pixel;
type = VARIANT_LENGTH;
}
else if ((VARIANT_ANGLE & aVariantMask) != 0) {

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

@ -71,12 +71,12 @@ is(bounce.cssRules[0].keyText, "0%", "keyframe rule keyText");
is(bounce.cssRules[1].keyText, "25%", "keyframe rule keyText");
is(bounce.cssRules[2].keyText, "75%, 85%", "keyframe rule keyText");
is(bounce.cssRules[3].keyText, "100%", "keyframe rule keyText");
is(bounce.cssRules[0].style.marginLeft, "0pt", "keyframe rule style");
is(bounce.cssRules[0].style.marginLeft, "0px", "keyframe rule style");
is(bounce.cssRules[1].style.marginLeft, "25px", "keyframe rule style");
is(bounce.cssRules[0].cssText, "0% { margin-left: 0pt; }");
is(bounce.cssRules[0].cssText, "0% { margin-left: 0px; }");
is(bounce.cssText, "@-moz-keyframes bouncier {\n" +
"0% { margin-left: 0pt; }\n" +
"0% { margin-left: 0px; }\n" +
"25% { margin-left: 25px; }\n" +
"75%, 85% { margin-left: 90px; }\n" +
"100% { margin-left: 100px; }\n" +

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

@ -48,6 +48,11 @@ for (var test in tests) {
}
}
// Bug 393910
p.setAttribute("style", "margin-left: 0");
is(p.style.getPropertyValue("margin-left"), "0px",
"0 serializes to 0px");
</script>
</pre>
</body>