Commit 51cc7d35 authored by eric@webkit.org's avatar eric@webkit.org

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d345fc33
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.
2009-10-07 Evan Martin <evan@chromium.org>
Reviewed by Darin Adler.
......
FAIL: read 90010000px back as 9.001e+07px, read again as 0px
<!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>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment