<!DOCTYPEhtml>
<html lang=en>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<body>
<iframe></iframe> <!-- Note that the following style and div elements are duplicates of the ones written into the iframe; they are here for convienience in resolving the "standard" computed value for a given specification
-->
<style></style>
<div id=a class='a b c'title='zxcv weeqweqeweasd
a
'></div>
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.requestLongerTimeout(2);
window.onload=function(){
varbase;
// A short note about escaping: all of the strings in this test go through
// Javascript unescaping before getting passed to CSS. This means that
// sequences like "\n" refer to a newline, a single backslash is written "\\",
// a CSS escape sequence is something like "\\A", and some quotes must be
// escaped.
var testset = [
// Color tests
// Generic property for testing
{ base : base = "div {color:green}",
tests : [
// My misc tests "#a{color:green}", base + "--#a {color:red}", base + "--aasdf, #a {color:green}", base + "-0aasdf, #a {color:red}", "-asdf, #a {color:green}", base + "#a {color: rgb\n(255, 0, 0)}", "#a {font: \"Arial\n;color:green}", "#a {color: @charset{}\"\\\n'\"url(\na\na); color:green}", "#a\r{color:green}", "#a\n{color:green}", "#a\t{color:green}", "@threedee maroon url('asdf\n) ra('asdf\n); " + base, "@threedee {maroon url('asdf\n) ra('asdf\n);} " + base, "div[title='zxcv weeqweqeweasd\\D\\A a']{color:green}", "div[title~='weeqweqeweasd']{color:green}", base + "#a\\\n{color:red}", base + "#a\v{color:red}",
// Border tests
// For testing lengths
{ base : base = "#a {border-style:solid}",
tests : [
// CSS1 section 7.1 base + "#a {border-width: funny}", base + "#a {border-width: 50zu}", base + "#a {border-width: px}",
// Number/unit parsing base + "#a {border-width: 0.px}", base + "#a {border-width: ..0px}", base + "#a {border-width: 0..0px}", base + "#a {border-width: 0.}", base + "#a {border-width: ..0}", base + "#a {border-width: 0..0}", base + "#a {border-width: 0; border-width: .0px medium}", base + "#a {border-width: 0; border-width: .0 medium}", base + "#a {border-width: 0; border-width: 0.0px medium}",
], prop: "borderRightWidth", pseudo: ""},
// Content tests
// Tests for strings and pseudos
{base : base = ".a::before {content: 'This is \\a'}",
tests : [
// CSS 2.1 section 4.1.3 "#a::before {content: 'This is \\a '}", "#a::before {content: 'This is \\A '}", "#a::before {content: 'This is \\0000a '}", "#a::before {content: 'This is \\00000a '}", "#a::before {content: 'This is \\\n\\00000a '}", "#a::before {content: 'This is \\\015\012\\00000a '}", "#a::before {content: 'This is \\\015\\00000a '}", "#a::before {content: 'This is \\\f\\00000a '}", "#a::before {content: 'This is\\20\f\\a'}", "#a::before {content: 'This is\\20\r\\a'}", "#a::before {content: 'This is\\20\n\\a'}", "#a::before {content: 'This is\\20\r\n\\a'}", base + "#a::before {content: 'FAIL \f\\a'}", base + "#a::before {content: 'FAIL \\\n\r\\a'}", "#a:before {content: 'This is \\a'}",
base + "#a:: before {content: 'FAIL'}", base + "#a ::before {content: 'FAIL'}", "#a::before {content: 'This is \\a",
], prop: "content", pseudo: "::before"
},
// Background color tests
// For basic URL parsing sanity checks
{ base : base = "div {background: blue}",
tests : [ "#a {background: url() blue}", "#a {background: url(怀) blue}",
], prop: "backgroundColor", pseudo: ""
},
// A one-off test I couldn't come up with a better way to do
{ base : base = "div {border-style: dotted}",
tests : [
// Sanity-check to make sure this test will work
// This test requires a color name that starts with a "-" base + "#a {border: dotted 0 -moz-menuhover}",
// The actual test: check that 0-moz-menuhover get parsed as an unknown dimension
// rather than a separate identifier base + "#a {border: solid 0-moz-menuhover}",
], prop: "borderLeftStyle", pseudo: ""
},
];
var curTest = -1; var curSubTest = 0;
var styleElement = document.getElementsByTagName("style")[0]; var divElement = document.getElementById("a"); varframe = document.getElementsByTagName("iframe")[0];
var canonical;
var doTests = function() {
if (curTest >= 0) { var curElement = frame.contentDocument.getElementsByTagName("div")[0]; var curStyle = frame.contentDocument.defaultView.getComputedStyle(curElement, testset[curTest].pseudo);
if (testset[curTest].todo && testset[curTest].todo[testset[curTest].tests[curSubTest]]) {
todo_is(curStyle[testset[curTest].prop], canonical, testset[curTest].tests[curSubTest]);
} else {
is(curStyle[testset[curTest].prop], canonical, testset[curTest].tests[curSubTest]);
}
curSubTest++;
}
if (curTest == -1 || curSubTest >= testset[curTest].tests.length) {
curTest++;
curSubTest = 0;
}
if (!(curTest < testset.length)) {
SimpleTest.finish();
return;
}
if (curSubTest == 0) {
styleElement.textContent = "";
let computedBase = document.defaultView.getComputedStyle(divElement, testset[curTest].pseudo)[testset[curTest].prop];
styleElement.textContent = testset[curTest].base;
canonical = document.defaultView.getComputedStyle(divElement, testset[curTest].pseudo)[testset[curTest].prop];
styleElement.textContent = "";
isnot(computedBase, canonical, "Sanity check for rule: " + testset[curTest].base);
} frame.contentDocument.open(); frame.contentDocument.write(""); frame.contentWindow.onload = function(){setTimeout(doTests, 0);}; frame.contentDocument.close();
};
// Running a debug build on the Android emulator is slooow and collecting
// all the session history this test amasses through repeated navigations
// adds considerably to the running time. Therefore, we restrict the
// amount of session history we keep around during this test.
SpecialPowers.pushPrefEnv({"set": [['browser.sessionhistory.max_entries', 4]]}, doTests);
};
</script>
Messung V0.5
¤ Dauer der Verarbeitung: 0.58 Sekunden
(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.