Bug 1288761 part 2 - Add perf reftest for bidi resolution. r=jfkthame,rwood

MozReview-Commit-ID: 12GXuPuvDHa

--HG--
extra : rebase_source : cf06beaeb4f2bfedb0088871fce68e7b289d55a4
This commit is contained in:
Xidorn Quan 2017-10-05 21:14:43 +11:00
Родитель 1eff6830a6
Коммит c0f60ed5b9
7 изменённых файлов: 98 добавлений и 0 удалений

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html style="overflow-y: scroll">
<head>
<meta charset="UTF-8">
<script src="util.js"></script>
<script>
window.onload = function() {
const TEST_WORD = "iqwdzx zzaعظأkvcg rvde";
let div = document.getElementById("test");
div.textContent = TEST_WORD;
flush_layout();
perf_start();
div.textContent = build_text(TEST_WORD, 30, 800);
flush_layout(div);
perf_finish();
}
</script>
</head>
<body>
<div id="test" style="white-space: normal"></div>
</body>
</html>

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

@ -13,3 +13,5 @@
% http://localhost/tests/perf-reftest-singletons/tiny-traversal-singleton.html
% http://localhost/tests/perf-reftest-singletons/nth-index-1.html
% http://localhost/tests/perf-reftest-singletons/nth-index-2.html
% http://localhost/tests/perf-reftest-singletons/bidi-resolution-1.html

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

@ -34,10 +34,21 @@ function build_rule(selector, selectorRepeat, declaration, ruleRepeat) {
return s;
}
function build_text(word, wordRepeat, paraRepeat) {
wordRepeat = wordRepeat || 1;
paraRepeat = paraRepeat || 1;
let para = Array(wordRepeat).fill(word).join(" ");
return Array(paraRepeat).fill(para).join("\n");
}
function flush_style(element) {
getComputedStyle(element || document.documentElement).color;
}
function flush_layout(element) {
(element || document.documentElement).offsetHeight;
}
function perf_start() {
if (perf_data.start !== null) {
throw "already started timing!";

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html style="overflow-y: scroll">
<head>
<meta charset="UTF-8">
<script src="util.js"></script>
<script>
window.onload = function() {
const TEST_WORD = "iqwdzx zzaعظأkvcg rvde";
let div = document.getElementById("test");
div.textContent = TEST_WORD;
flush_layout();
perf_start();
div.textContent = build_text(TEST_WORD, 30, 800);
flush_layout(div);
perf_finish();
}
</script>
</head>
<body>
<div id="test" style="white-space: pre-line"></div>
</body>
</html>

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html style="overflow-y: scroll">
<head>
<meta charset="UTF-8">
<script src="util.js"></script>
<script>
window.onload = function() {
const TEST_WORD = "iqwdzx zzaعظأkvcg rvde";
let div = document.getElementById("test");
div.textContent = TEST_WORD;
flush_layout();
perf_start();
div.textContent = build_text(TEST_WORD, 30, 800);
flush_layout(div);
perf_finish();
}
</script>
</head>
<body>
<div id="test" style="white-space: normal"></div>
</body>
</html>

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

@ -18,3 +18,5 @@
& http://localhost/tests/perf-reftest/style-attr-1.html, http://localhost/tests/perf-reftest/style-attr-1-ref.html
& http://localhost/tests/perf-reftest/stop-cascade-1.html, http://localhost/tests/perf-reftest/stop-cascade-ref.html
& http://localhost/tests/perf-reftest/stop-cascade-2.html, http://localhost/tests/perf-reftest/stop-cascade-ref.html
& http://localhost/tests/perf-reftest/bidi-resolution-1.html, http://localhost/tests/perf-reftest/bidi-resolution-1-ref.html

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

@ -34,10 +34,21 @@ function build_rule(selector, selectorRepeat, declaration, ruleRepeat) {
return s;
}
function build_text(word, wordRepeat, paraRepeat) {
wordRepeat = wordRepeat || 1;
paraRepeat = paraRepeat || 1;
let para = Array(wordRepeat).fill(word).join(" ");
return Array(paraRepeat).fill(para).join("\n");
}
function flush_style(element) {
getComputedStyle(element || document.documentElement).color;
}
function flush_layout(element) {
(element || document.documentElement).offsetHeight;
}
function perf_start() {
if (perf_data.start !== null) {
throw "already started timing!";