Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add performance test for inlines and inline-blocks without text
https://bugs.webkit.org/show_bug.cgi?id=179955 Reviewed by Darin Adler. Test for https://bugs.webkit.org/show_bug.cgi?id=179950 * Layout/inline-layout-no-text.html: Added. Canonical link: https://commits.webkit.org/195970@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
48 additions
and 0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Test layout performance with inlines and inline-blocks.</title> | ||
<script src="../resources/runner.js"></script> | ||
<style> | ||
.inlineBlock { display:inline-block; width:10px; height:10px; } | ||
</style> | ||
</head> | ||
<body> | ||
<pre id="log"></pre> | ||
<div id="target" style="width: 300px; height: 0px; display: block;"> | ||
</div> | ||
<script> | ||
var style = target.style; | ||
|
||
for (var i = 0; i < 40000; i++) { | ||
const span = document.createElement("span"); | ||
const div = document.createElement("div"); | ||
div.classList.add("inlineBlock"); | ||
span.appendChild(div); | ||
target.appendChild(span); | ||
} | ||
|
||
function test() { | ||
style.width = "280px"; | ||
target.offsetLeft; | ||
style.width = "300px"; | ||
target.offsetLeft; | ||
style.width = "290px"; | ||
target.offsetLeft; | ||
} | ||
|
||
PerfTestRunner.measureRunsPerSecond({ run: test }); | ||
</script> | ||
</body> | ||
</html> |