Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2009-10-07 Evan Martin <evan@chromium.org>
Reviewed by Simon Fraser. Add a currently-failing test exhibiting the problem in https://bugs.webkit.org/show_bug.cgi?id=20674: When converting very large or small numbers back to strings, exponential notation is used, so a value like 90010000px is returned from getComputedStyle() as 9.001e+07px. 9.001e+07px does not parse, so such a value cannot be round-tripped. This is a particular problem with tranformation matrices, which can often contain very large or small numbers. (Test written by Simon Fraser; I've just made it a committable patch.) * fast/css/large-number-round-trip-expected.txt: Added. * fast/css/large-number-round-trip.html: Added. Canonical link: https://commits.webkit.org/40813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@49254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
65 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 @@ | ||
FAIL: read 90010000px back as 9.001e+07px, read again as 0px |
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,43 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||
"http://www.w3.org/TR/html4/loose.dtd"> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title>Round-trip large values</title> | ||
<style type="text/css" media="screen"> | ||
#box { | ||
position: absolute; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="box"> | ||
</div> | ||
<div id="results"> | ||
</div> | ||
<script type="text/javascript" charset="utf-8"> | ||
if (window.layoutTestController) | ||
layoutTestController.dumpAsText(); | ||
|
||
var box = document.getElementById('box'); | ||
|
||
var testValue = "90010000px"; | ||
box.style.left = testValue; | ||
|
||
var leftValue = window.getComputedStyle(box).left; | ||
|
||
box.style.left = "0px"; | ||
box.style.left = leftValue; | ||
var newLeftValue = window.getComputedStyle(box).left; | ||
|
||
var results = document.getElementById('results'); | ||
var result; | ||
if (leftValue == newLeftValue) | ||
result = "PASS: read " + testValue + " back as " + leftValue + ", read again as " + newLeftValue; | ||
else | ||
result = "FAIL: read " + testValue + " back as " + leftValue + ", read again as " + newLeftValue; | ||
results.innerHTML = result; | ||
</script> | ||
</body> | ||
</html> |