/** Test for Bug 652486, Bug 1039488 and Bug 1574222 **/
function c() {
return document.defaultView.getComputedStyle($('t')).
getPropertyValue("text-decoration");
}
// The default value of the 'color' property, which in turn establishes the
// default value of 'text-decoration-color' (via the 'currentColor' keyword). var defaultLineColor = "rgb(0, 0, 0)";
var tests = [
// When only text-decoration was specified, text-decoration should look like
// a longhand property. However, as of Bug 1574222, the getComputedStyle()
// serialization for "text-decoration" will always include the color,
// because we can't tell whether the resolved color value came from the
// initial "currentColor" value (and could safely be omitted) vs. whether it
// came from a custom specified value (and cannot be omitted).
{ decoration: "none",
line: null, color: null, style: null,
expectedValue: defaultLineColor },
{ decoration: "underline",
line: null, color: null, style: null,
expectedValue: "underline " + defaultLineColor },
{ decoration: "overline",
line: null, color: null, style: null,
expectedValue: "overline " + defaultLineColor },
{ decoration: "line-through",
line: null, color: null, style: null,
expectedValue: "line-through " + defaultLineColor },
{ decoration: "blink",
line: null, color: null, style: null,
expectedValue: "blink " + defaultLineColor },
{ decoration: "underline overline",
line: null, color: null, style: null,
expectedValue: "underline overline " + defaultLineColor },
{ decoration: "underline line-through",
line: null, color: null, style: null,
expectedValue: "underline line-through " + defaultLineColor },
{ decoration: "blink underline",
line: null, color: null, style: null,
expectedValue: "underline blink " + defaultLineColor },
{ decoration: "underline blink",
line: null, color: null, style: null,
expectedValue: "underline blink " + defaultLineColor },
// When only text-decoration-line or text-blink was specified,
// text-decoration should look like a longhand property.
// However, as of Bug 1574222, the getComputedStyle() serialization for
// "text-decoration" will always include the color, because we can't tell
// whether the resolved color value came from the initial "currentColor"
// value (and could safely be omitted) vs. whether it came from a custom
// specified value (and cannot be omitted).
{ decoration: null,
line: "blink", color: null, style: null,
expectedValue: "blink " + defaultLineColor },
{ decoration: null,
line: "underline", color: null, style: null,
expectedValue: "underline " + defaultLineColor },
{ decoration: null,
line: "overline", color: null, style: null,
expectedValue: "overline " + defaultLineColor },
{ decoration: null,
line: "line-through", color: null, style: null,
expectedValue: "line-through " + defaultLineColor },
{ decoration: null,
line: "blink underline", color: null, style: null,
expectedValue: "underline blink " + defaultLineColor },
function clearStyleObject()
{
$('t').style.textDecoration = null;
}
for (var i = 0; i < tests.length; ++i) { var test = tests[i];
if (test.decoration) {
$('t').style.textDecoration = test.decoration;
}
if (test.color) {
$('t').style.textDecorationColor = test.color;
}
if (test.line) {
$('t').style.textDecorationLine = test.line;
}
if (test.style) {
$('t').style.textDecorationStyle = test.style;
}
var dec = makeDeclaration(test);
is(c(), test.expectedValue, "Test1 (computed value): " + dec);
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.27Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.