[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

dglazkov at chromium.org dglazkov at chromium.org
Thu Oct 29 20:44:17 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit dda1af6d21c042a2e8460729acf4c3b1e3df8622
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 14 04:43:16 2009 +0000

    2009-10-13  Dimitri Glazkov  <dglazkov at chromium.org>
    
            No review, rolling out r49554, because it broke Win and Chromium builds.
            http://trac.webkit.org/changeset/49554
    
            * css/CSSPrimitiveValue.cpp:
            (WebCore::CSSPrimitiveValue::cssText):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index fe890e6..5631c6d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-13  Dimitri Glazkov  <dglazkov at chromium.org>
+
+        No review, rolling out r49554, because it broke Win and Chromium builds.
+        http://trac.webkit.org/changeset/49554
+
+        * fast/css/large-number-round-trip-expected.txt:
+        * fast/css/opacity-float-expected.txt:
+        * fast/css/opacity-float.html:
+        * platform/mac/fast/css/opacity-float-expected.txt: Added.
+        * transforms/2d/compound-2d-transforms-expected.txt:
+        * transforms/2d/compound-2d-transforms.html:
+
 2009-10-13  Evan Martin  <evan at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/css/large-number-round-trip-expected.txt b/LayoutTests/fast/css/large-number-round-trip-expected.txt
index 4879544..c9c6dc1 100644
--- a/LayoutTests/fast/css/large-number-round-trip-expected.txt
+++ b/LayoutTests/fast/css/large-number-round-trip-expected.txt
@@ -1 +1 @@
-PASS: read 90010000px back as 90010000px, read again as 90010000px
+FAIL: read 90010000px back as 9.001e+07px, read again as 0px
diff --git a/LayoutTests/fast/css/opacity-float-expected.txt b/LayoutTests/fast/css/opacity-float-expected.txt
index 795a2c5..f65ad1f 100644
--- a/LayoutTests/fast/css/opacity-float-expected.txt
+++ b/LayoutTests/fast/css/opacity-float-expected.txt
@@ -1,17 +1,3 @@
 This test verifies that reading a floating-point opacity from CSS attributes gets back a properly-formatted float. Improperly handling locales that cause decimals to be written as commas might break it.
 
 PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-PASS
-
diff --git a/LayoutTests/fast/css/opacity-float.html b/LayoutTests/fast/css/opacity-float.html
index 8405aeb..0ef0456 100644
--- a/LayoutTests/fast/css/opacity-float.html
+++ b/LayoutTests/fast/css/opacity-float.html
@@ -15,34 +15,9 @@ it.</p>
 <a id='test' style='opacity:.9'></a>
 
 <script>
-var test = document.getElementById('test');
-
-function doTest(expected, input) {
-    test.style.opacity = input;
-    var opacity = test.style.opacity.toString();
-    if (opacity == expected)
-        document.write('PASS');
-    else
-        document.write('FAIL: expected ' + expected + ', got ' + opacity);
-    document.write('<br>');
-}
-
-var tests = [['0.9', '0.9'],
-             ['98765432198', '98765432198'],
-             ['9870000', '9870000'],
-             ['0.000321', '0.000321'],
-             ['50.02', '50.02'],
-             // Check we clip precision to six decimals.
-             ['1234.567891', '1234.567891234']];
-for (var i = 0; i < tests.length; i++)
-    doTest(tests[i][0], tests[i][1]);
-
-// Test a too-small value.
-doTest('0', '0.0000001');
-// Test that a beyond-precision digit will be rounded in.
-doTest('0.000001', '0.0000009');
-
-// Run the test list again with negatives.
-for (var i = 0; i < tests.length; i++)
-    doTest('-' + tests[i][0], '-' + tests[i][1]);
+var opacity = document.getElementById('test').style.opacity.toString();
+if (opacity == '0.9')
+    document.write('PASS');
+else
+    document.write('FAIL: ' + opacity);
 </script>
diff --git a/LayoutTests/platform/mac/fast/css/opacity-float-expected.txt b/LayoutTests/platform/mac/fast/css/opacity-float-expected.txt
new file mode 100644
index 0000000..b81983d
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/opacity-float-expected.txt
@@ -0,0 +1,3 @@
+This test verifies that reading a floating-point opacity from CSS attributes gets back a properly-formatted float. Improperly handling locales that cause decimals to be written as commas might break it.
+
+FAIL: 0,9
diff --git a/LayoutTests/transforms/2d/compound-2d-transforms-expected.txt b/LayoutTests/transforms/2d/compound-2d-transforms-expected.txt
index 0f52716..5583bd0 100644
--- a/LayoutTests/transforms/2d/compound-2d-transforms-expected.txt
+++ b/LayoutTests/transforms/2d/compound-2d-transforms-expected.txt
@@ -6,12 +6,12 @@ transform "scale(1.7)" expected "matrix(1.7, 0, 0, 1.7, 0, 0)" : PASS
 transform "skew(12deg)" expected "matrix(1, 0, 0.212557, 1, 0, 0)" : PASS
 transform "matrix(0.978148, 0.207912, -0.207912, 0.978148, 50, 20)" expected "matrix(0.978148, 0.207912, -0.207912, 0.978148, 50, 20)" : PASS
 transform "translate(50px, 20px) rotate(12deg)" expected "matrix(0.978148, 0.207912, -0.207912, 0.978148, 50, 20)" : PASS
-transform "rotate(12deg) translate(50px, 20px)" expected "matrix(0.978148, 0.207912, -0.207912, 0.978148, 44.749146, 29.958537)" : PASS
-transform "rotate(12deg) translate(50px, 20px) scale(1.4)" expected "matrix(1.369407, 0.291076, -0.291076, 1.369407, 44.749146, 29.958537)" : PASS
-transform "scale(1.4) rotate(12deg) translate(50px, 20px) " expected "matrix(1.369407, 0.291076, -0.291076, 1.369407, 62.648805, 41.941951)" : PASS
-transform "scale(1.4) translate(50px, 20px) rotate(12deg)" expected "matrix(1.369407, 0.291076, -0.291076, 1.369407, 70, 28)" : PASS
-transform "translate(50px, 20px) rotate(12deg) translateY(50px) scale(1.4)" expected "matrix(1.369407, 0.291076, -0.291076, 1.369407, 39.604415, 68.90738)" : PASS
-transform "rotate(12deg) translate(50px, 20px) scale(1.4) translate(-80px, 40px) skew(34deg) translate(10px, 10px) scale(0.7) skewY(-25deg) rotate(21deg) translateX(50px) scale(1.4, 1.8)" expected "matrix(1.205166, 0.148207, 0.258987, 2.040044, -13.384723, 85.309967)" : PASS
+transform "rotate(12deg) translate(50px, 20px)" expected "matrix(0.978148, 0.207912, -0.207912, 0.978148, 44.7491, 29.9585)" : PASS
+transform "rotate(12deg) translate(50px, 20px) scale(1.4)" expected "matrix(1.36941, 0.291076, -0.291076, 1.36941, 44.7491, 29.9585)" : PASS
+transform "scale(1.4) rotate(12deg) translate(50px, 20px) " expected "matrix(1.36941, 0.291076, -0.291076, 1.36941, 62.6488, 41.942)" : PASS
+transform "scale(1.4) translate(50px, 20px) rotate(12deg)" expected "matrix(1.36941, 0.291076, -0.291076, 1.36941, 70, 28)" : PASS
+transform "translate(50px, 20px) rotate(12deg) translateY(50px) scale(1.4)" expected "matrix(1.36941, 0.291076, -0.291076, 1.36941, 39.6044, 68.9074)" : PASS
+transform "rotate(12deg) translate(50px, 20px) scale(1.4) translate(-80px, 40px) skew(34deg) translate(10px, 10px) scale(0.7) skewY(-25deg) rotate(21deg) translateX(50px) scale(1.4, 1.8)" expected "matrix(1.20517, 0.148207, 0.258987, 2.04004, -13.3847, 85.31)" : PASS
 transform ",rotate(12deg) translate(50px, 20px)" expected "none" : PASS
 transform "rotate(12deg), translate(50px, 20px)" expected "none" : PASS
 transform "rotate(12deg) + translate(50px, 20px)" expected "none" : PASS
diff --git a/LayoutTests/transforms/2d/compound-2d-transforms.html b/LayoutTests/transforms/2d/compound-2d-transforms.html
index 7aa6691..16003c3 100644
--- a/LayoutTests/transforms/2d/compound-2d-transforms.html
+++ b/LayoutTests/transforms/2d/compound-2d-transforms.html
@@ -43,17 +43,17 @@
       
       // two functions
       { 'transform' : 'translate(50px, 20px) rotate(12deg)',          'result' : 'matrix(0.978148, 0.207912, -0.207912, 0.978148, 50, 20)' },
-      { 'transform' : 'rotate(12deg) translate(50px, 20px)',          'result' : 'matrix(0.978148, 0.207912, -0.207912, 0.978148, 44.749146, 29.958537)' },
+      { 'transform' : 'rotate(12deg) translate(50px, 20px)',          'result' : 'matrix(0.978148, 0.207912, -0.207912, 0.978148, 44.7491, 29.9585)' },
 
       // three functions
-      { 'transform' : 'rotate(12deg) translate(50px, 20px) scale(1.4)',   'result' : 'matrix(1.369407, 0.291076, -0.291076, 1.369407, 44.749146, 29.958537)' },
-      { 'transform' : 'scale(1.4) rotate(12deg) translate(50px, 20px) ',  'result' : 'matrix(1.369407, 0.291076, -0.291076, 1.369407, 62.648805, 41.941951)' },
-      { 'transform' : 'scale(1.4) translate(50px, 20px) rotate(12deg)',   'result' : 'matrix(1.369407, 0.291076, -0.291076, 1.369407, 70, 28)' },
-      { 'transform' : 'translate(50px, 20px) rotate(12deg) translateY(50px) scale(1.4)',   'result' : 'matrix(1.369407, 0.291076, -0.291076, 1.369407, 39.604415, 68.90738)' },
+      { 'transform' : 'rotate(12deg) translate(50px, 20px) scale(1.4)',   'result' : 'matrix(1.36941, 0.291076, -0.291076, 1.36941, 44.7491, 29.9585)' },
+      { 'transform' : 'scale(1.4) rotate(12deg) translate(50px, 20px) ',  'result' : 'matrix(1.36941, 0.291076, -0.291076, 1.36941, 62.6488, 41.942)' },
+      { 'transform' : 'scale(1.4) translate(50px, 20px) rotate(12deg)',   'result' : 'matrix(1.36941, 0.291076, -0.291076, 1.36941, 70, 28)' },
+      { 'transform' : 'translate(50px, 20px) rotate(12deg) translateY(50px) scale(1.4)',   'result' : 'matrix(1.36941, 0.291076, -0.291076, 1.36941, 39.6044, 68.9074)' },
 
       // lots of functions
       { 'transform' : 'rotate(12deg) translate(50px, 20px) scale(1.4) translate(-80px, 40px) skew(34deg) translate(10px, 10px) scale(0.7) skewY(-25deg) rotate(21deg) translateX(50px) scale(1.4, 1.8)', 
-        'result' : 'matrix(1.205166, 0.148207, 0.258987, 2.040044, -13.384723, 85.309967)' },
+        'result' : 'matrix(1.20517, 0.148207, 0.258987, 2.04004, -13.3847, 85.31)' },
         
       // invalid compound functions
       { 'transform' : ',rotate(12deg) translate(50px, 20px)', 'result' : 'none' }, // has comma
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5ff9f71..244c69c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-13  Dimitri Glazkov  <dglazkov at chromium.org>
+
+        No review, rolling out r49554, because it broke Win and Chromium builds.
+        http://trac.webkit.org/changeset/49554
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::cssText):
+
 2009-10-13  Evan Martin  <evan at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/css/CSSPrimitiveValue.cpp b/WebCore/css/CSSPrimitiveValue.cpp
index bf377e5..1f2c9ca 100644
--- a/WebCore/css/CSSPrimitiveValue.cpp
+++ b/WebCore/css/CSSPrimitiveValue.cpp
@@ -684,71 +684,6 @@ int CSSPrimitiveValue::getIdent()
     return m_value.ident;
 }
 
-static void appendCSSDouble(Vector<UChar>& vector, double value)
-{
-    // From the CSS specification section titled "Integers and real numbers",
-    // real numbers are only formatted as [sign] [digits] "." [digits].
-    // This differs from printf-style formatting in that exponents (e.g. 1.3e06)
-    // are not allowed.  Since NaN/inf are also not valid CSS values this
-    // function doesn't handle them.
-
-    // For compatibility with what was returned by older versions of
-    // WebKit, we target 6 digits of precision.
-    const int digitsAfterDecimalPoint = 6;
-    long long rounded = llround(fabs(value) * 1000000.0);
-    if (rounded == 0) {
-        vector.append('0');
-        return;
-    }
-
-    char buf[24];
-    int length = snprintf(buf, sizeof(buf), "%lld", rounded);
-    int decimalPoint = length - digitsAfterDecimalPoint;
-
-    // We are matching printf("%g")'s behavior and must trim trailing zeros,
-    // regardless of whether they're significant.
-    while (length > 0 && length > decimalPoint && buf[length - 1] == '0')
-        length--;
-
-    // Reserve an estimate of space for the number of digits we anticipate
-    // along with a minus sign/initial zero/decimal point.
-    vector.reserveCapacity(vector.size() + 3 + length);
-
-    if (value < 0)
-        vector.append('-');
-
-    if (decimalPoint <= 0) {
-        // Only digits after the decimal point.
-        vector.append('0');
-        vector.append('.');
-        for (int i = decimalPoint; i < 0; i++)
-            vector.append('0');
-        for (int i = 0; i < length; i++)
-            vector.append(buf[i]);
-    } else if (length <= decimalPoint) {
-        // Only digits before the decimal point.
-        for (int i = 0; i < length; i++)
-            vector.append(buf[i]);
-    } else {
-        // Digits before and after the decimal point.
-        for (int i = 0; i < decimalPoint; i++)
-            vector.append(buf[i]);
-        vector.append('.');
-        for (int i = decimalPoint; i < length; i++)
-            vector.append(buf[i]);
-    }
-}
-
-static String formatWithUnits(double value, const char* units)
-{
-    Vector<UChar> result;
-    appendCSSDouble(result, value);
-    result.reserveCapacity(result.size() + strlen(units));
-    for (int i = 0; units[i]; i++)
-        result.append(units[i]);
-    return String::adopt(result);
-}
-
 String CSSPrimitiveValue::cssText() const
 {
     // FIXME: return the original value instead of a generated one (e.g. color
@@ -760,61 +695,61 @@ String CSSPrimitiveValue::cssText() const
             break;
         case CSS_NUMBER:
         case CSS_PARSER_INTEGER:
-            text = formatWithUnits(m_value.num, "");
+            text = String::number(m_value.num);
             break;
         case CSS_PERCENTAGE:
-            text = formatWithUnits(m_value.num, "%");
+            text = String::format("%.6lg%%", m_value.num);
             break;
         case CSS_EMS:
-            text = formatWithUnits(m_value.num, "em");
+            text = String::format("%.6lgem", m_value.num);
             break;
         case CSS_EXS:
-            text = formatWithUnits(m_value.num, "ex");
+            text = String::format("%.6lgex", m_value.num);
             break;
         case CSS_REMS:
-            text = formatWithUnits(m_value.num, "rem");
+            text = String::format("%.6lgrem", m_value.num);
             break;
         case CSS_PX:
-            text = formatWithUnits(m_value.num, "px");
+            text = String::format("%.6lgpx", m_value.num);
             break;
         case CSS_CM:
-            text = formatWithUnits(m_value.num, "cm");
+            text = String::format("%.6lgcm", m_value.num);
             break;
         case CSS_MM:
-            text = formatWithUnits(m_value.num, "mm");
+            text = String::format("%.6lgmm", m_value.num);
             break;
         case CSS_IN:
-            text = formatWithUnits(m_value.num, "in");
+            text = String::format("%.6lgin", m_value.num);
             break;
         case CSS_PT:
-            text = formatWithUnits(m_value.num, "pt");
+            text = String::format("%.6lgpt", m_value.num);
             break;
         case CSS_PC:
-            text = formatWithUnits(m_value.num, "pc");
+            text = String::format("%.6lgpc", m_value.num);
             break;
         case CSS_DEG:
-            text = formatWithUnits(m_value.num, "deg");
+            text = String::format("%.6lgdeg", m_value.num);
             break;
         case CSS_RAD:
-            text = formatWithUnits(m_value.num, "rad");
+            text = String::format("%.6lgrad", m_value.num);
             break;
         case CSS_GRAD:
-            text = formatWithUnits(m_value.num, "grad");
+            text = String::format("%.6lggrad", m_value.num);
             break;
         case CSS_MS:
-            text = formatWithUnits(m_value.num, "ms");
+            text = String::format("%.6lgms", m_value.num);
             break;
         case CSS_S:
-            text = formatWithUnits(m_value.num, "s");
+            text = String::format("%.6lgs", m_value.num);
             break;
         case CSS_HZ:
-            text = formatWithUnits(m_value.num, "hz");
+            text = String::format("%.6lghz", m_value.num);
             break;
         case CSS_KHZ:
-            text = formatWithUnits(m_value.num, "khz");
+            text = String::format("%.6lgkhz", m_value.num);
             break;
         case CSS_TURN:
-            text = formatWithUnits(m_value.num, "turn");
+            text = String::format("%.6lgturn", m_value.num);
             break;
         case CSS_DIMENSION:
             // FIXME

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list