[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

yuzo at google.com yuzo at google.com
Wed Dec 22 13:16:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4bcf0ad99435b0fc538a62ced8cdcc7ba62c45bc
Author: yuzo at google.com <yuzo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 10 03:33:00 2010 +0000

    2010-09-09  Yuzo Fujishima  <yuzo at google.com>
    
            Reviewed by Darin Adler.
    
            Fix for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation to be followed by the next token without separation
            https://bugs.webkit.org/show_bug.cgi?id=24742
    
            * fast/css/invalid-hex-color-expected.txt: Added.
            * fast/css/invalid-hex-color.html: Added.
            * svg/custom/invalid-fill-hex.svg: Changed to avoid a questionable behavior that this bug fix revealed.
    2010-09-09  Yuzo Fujishima  <yuzo at google.com>
    
            Reviewed by Darin Adler.
    
            Fix for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation to be followed by the next token without separation
            Stop checking in the flex definition the number of hexadecimal digits for a hex color.
            Instead, rely on the checking in Color::parseHexColor().
            The resultant grammar is actually more close to the one in http://www.w3.org/TR/CSS21/grammar.html .
    
            https://bugs.webkit.org/show_bug.cgi?id=24742
    
            Test: fast/css/invalid-hex-color.html
    
            * css/tokenizer.flex:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1d1e926..3747171 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-09  Yuzo Fujishima  <yuzo at google.com>
+
+        Reviewed by Darin Adler.
+
+        Fix for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation to be followed by the next token without separation
+        https://bugs.webkit.org/show_bug.cgi?id=24742
+
+        * fast/css/invalid-hex-color-expected.txt: Added.
+        * fast/css/invalid-hex-color.html: Added.
+        * svg/custom/invalid-fill-hex.svg: Changed to avoid a questionable behavior that this bug fix revealed.
+
 2010-09-09  Dirk Pranke  <dpranke at chromium.org>
 
         Unreviewed, rolling out r67145.
diff --git a/LayoutTests/fast/css/invalid-hex-color-expected.txt b/LayoutTests/fast/css/invalid-hex-color-expected.txt
new file mode 100644
index 0000000..10388f6
--- /dev/null
+++ b/LayoutTests/fast/css/invalid-hex-color-expected.txt
@@ -0,0 +1,16 @@
+Test 0 (Invalid: 0 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 1 (Invalid: 1 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 2 (Invalid: 2 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 3 (Valid: 3 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 4 (Invalid: 4 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 5 (Invalid: 5 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 6 (Valid: 6 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 7 (Invalid: 7 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 8 (Invalid: 0 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 9 (Invalid: 1 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 10 (Invalid: 2 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 11 (Invalid: 3 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 12 (Invalid: 4 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 13 (Invalid: 5 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 14 (Invalid: 6 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 15 (Invalid: 7 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
diff --git a/LayoutTests/fast/css/invalid-hex-color.html b/LayoutTests/fast/css/invalid-hex-color.html
new file mode 100644
index 0000000..bdca29a
--- /dev/null
+++ b/LayoutTests/fast/css/invalid-hex-color.html
@@ -0,0 +1,68 @@
+<!doctype html>
+<html>
+<head>
+<title>Test for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation to be followed by the next token without separation</title>
+<style>
+div {
+    margin-bottom:11px;
+}
+</style>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function test()
+{
+    var test_defs = [
+        /* description, expected style, test style */
+        ["Invalid: 0 hexadecimal digits", "", "border-bottom: solid #"],
+        ["Invalid: 1 hexadecimal digits", "", "border-bottom: solid #1"],
+        ["Invalid: 2 hexadecimal digits", "", "border-bottom: solid #11"],
+        ["Valid: 3 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "border-bottom: solid #111"],
+        ["Invalid: 4 hexadecimal digits", "", "border-bottom: solid #1111"],
+        ["Invalid: 5 hexadecimal digits", "", "border-bottom: solid #11111"],
+        ["Valid: 6 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "border-bottom: solid #111111"],
+        ["Invalid: 7 hexadecimal digits", "", "border-bottom: solid #1111111"],
+        ["Invalid: 0 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #px"],
+        ["Invalid: 1 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1px"],
+        ["Invalid: 2 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #11px"],
+        ["Invalid: 3 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #111px"],
+        ["Invalid: 4 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1111px"],
+        ["Invalid: 5 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #11111px"],
+        ["Invalid: 6 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #111111px"],
+        ["Invalid: 7 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1111111px"],
+    ];
+
+    var testHtml = "";
+    for (var i = 0; i < test_defs.length; i++) {
+        var test_def = test_defs[i];
+        testHtml += "<div>Test " + i + " (" + test_def[0] + ")" +
+                    "<span id='expected_" + i + "' style='" + test_def[1] + "'> [EXPECTED] </span>" +
+                    "<span id='actual_" + i + "' style='" + test_def[2] + "'> [ACTUAL] </span>" +
+                    "<span id='result_" + i + "'></span></div>";
+    }
+    document.getElementById('tests').innerHTML = testHtml;
+
+    for (var i = 0; i < test_defs.length; i++) {
+        var expected = document.getElementById("expected_" + i).style.borderBottomColor;
+        var actual = document.getElementById("actual_" + i).style.borderBottomColor;
+        var message;
+        var color;
+        if (actual == expected) {
+            message = "PASS";
+            color = "green";
+        } else {
+            message = "FAIL: expected:'" + expected + "' actual:'" + actual + "'";
+            color = "red";
+        }
+        var result = document.getElementById("result_" + i);
+        result.innerHTML = message;
+        result.style.color = color;
+    }
+}
+</script>
+</head>
+<body onload="test()">
+<div id='tests'>Test didn't run</div>
+</html>
+
diff --git a/LayoutTests/svg/custom/invalid-fill-hex.svg b/LayoutTests/svg/custom/invalid-fill-hex.svg
index 5e1b947..2b8dab1 100644
--- a/LayoutTests/svg/custom/invalid-fill-hex.svg
+++ b/LayoutTests/svg/custom/invalid-fill-hex.svg
@@ -2,7 +2,7 @@
 <svg xmlns="http://www.w3.org/2000/svg">
   <g fill="orange">
     <rect width="100" height="100" fill="red"/>
-    <rect width="100" height="100" fill="#ff" stroke="#0"/>
+    <rect width="100" height="100" fill="#ff"/>
     <g fill="black">
       <text x="10" y="130">The above rect should be BLACK.</text>
       <text x="10" y="150">SVG 1.1 FULL says there should be a "highly perceivable error" message when an invalid fill is used.</text>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e4aaa08..63dec74 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-09  Yuzo Fujishima  <yuzo at google.com>
+
+        Reviewed by Darin Adler.
+
+        Fix for Bug 24742 - CSS tokenizer allows color in 6 hex digit notation to be followed by the next token without separation
+        Stop checking in the flex definition the number of hexadecimal digits for a hex color.
+        Instead, rely on the checking in Color::parseHexColor().
+        The resultant grammar is actually more close to the one in http://www.w3.org/TR/CSS21/grammar.html .
+
+        https://bugs.webkit.org/show_bug.cgi?id=24742
+
+        Test: fast/css/invalid-hex-color.html
+
+        * css/tokenizer.flex:
+
 2010-09-09  Chris Rogers  <crogers at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/css/tokenizer.flex b/WebCore/css/tokenizer.flex
index 290c590..4d226d9 100644
--- a/WebCore/css/tokenizer.flex
+++ b/WebCore/css/tokenizer.flex
@@ -13,7 +13,6 @@ nmstart         [_a-zA-Z]|{nonascii}|{escape}
 nmchar          [_a-zA-Z0-9-]|{nonascii}|{escape}
 string1         \"([\t !#$%&(-~]|\\{nl}|\'|{nonascii}|{escape})*\"
 string2         \'([\t !#$%&(-~]|\\{nl}|\"|{nonascii}|{escape})*\'
-hexcolor        {h}{3}|{h}{6}
 
 ident           -?{nmstart}{nmchar}*
 name            {nmchar}+
@@ -48,8 +47,8 @@ nth             [\+-]?{intnum}*n([\+-]{intnum})?
 {ident}                 {yyTok = IDENT; return yyTok;}
 {nth}                   {yyTok = NTH; return yyTok;}
 
-"#"{hexcolor}           {yyTok = HEX; return yyTok;}
 "#"{ident}              {yyTok = IDSEL; return yyTok;}
+"#"{name}               {yyTok = HEX; return yyTok;}
 
 "@import"               {BEGIN(mediaquery); yyTok = IMPORT_SYM; return yyTok;}
 "@page"                 {yyTok = PAGE_SYM; return yyTok;}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list