Add tests to check case (2) for shorthands in nsCSSDeclaration::GetValue.

This commit is contained in:
L. David Baron 2009-03-09 16:14:34 -07:00
Родитель d345c6173e
Коммит 9daedec977
1 изменённых файлов: 12 добавлений и 0 удалений

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

@ -56,6 +56,18 @@ is(style.getPropertyPriority("border-right-style"), "important");
isnot(style.getPropertyValue("border-style"), "");
is(style.getPropertyPriority("border-style"), "important");
// Also test that we check consistency of inherit and -moz-initial.
element.setAttribute("style", "border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted");
isnot(style.getPropertyValue("border-style"), "", "serialize shorthand when all values not inherit/initial");
element.setAttribute("style", "border-top-style: inherit; border-right-style: inherit; border-bottom-style: inherit; border-left-style: inherit");
is(style.getPropertyValue("border-style"), "inherit", "serialize shorthand as inherit");
element.setAttribute("style", "border-top-style: -moz-initial; border-right-style: -moz-initial; border-bottom-style: -moz-initial; border-left-style: -moz-initial");
is(style.getPropertyValue("border-style"), "-moz-initial", "serialize shorthand as initial");
element.setAttribute("style", "border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: inherit");
is(style.getPropertyValue("border-style"), "", "don't serialize shorthand when partly inherit");
element.setAttribute("style", "border-top-style: -moz-initial; border-right-style: dotted; border-bottom-style: -moz-initial; border-left-style: -moz-initial");
is(style.getPropertyValue("border-style"), "", "don't serialize shorthand when partly initial");
</script>
</pre>
</body>