Skip to content
Permalink
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
eseidel committed Oct 7, 2009
1 parent 49ebbbf commit 33e3d9c58d3a8f2717710e7b1d54d2a00a40d80c
Showing with 65 additions and 0 deletions.
  1. +21 −0 LayoutTests/ChangeLog
  2. +1 −0 LayoutTests/fast/css/large-number-round-trip-expected.txt
  3. +43 −0 LayoutTests/fast/css/large-number-round-trip.html
@@ -1,3 +1,24 @@
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.
@@ -0,0 +1 @@
FAIL: read 90010000px back as 9.001e+07px, read again as 0px
@@ -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>

0 comments on commit 33e3d9c

Please sign in to comment.