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

abarth at webkit.org abarth at webkit.org
Thu Oct 29 20:46:39 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit a0b7fd5bad757f1662e495be68267c155160bab7
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 17 03:10:59 2009 +0000

    2009-10-16  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Alexey Proskuryakov.
    
            @charset rule after the first byte causes the rest of css to be ignored
            https://bugs.webkit.org/show_bug.cgi?id=18265
    
            Apparently we're supposed to tolerate whitespace before the charset
            rule so folks can write code like this:
    
            <style>
            @charset "utf-8"
            ...
            </style>
    
            I'm told this is one of the top compatability problems in China.
            Tests: fast/css/comment-before-charset-external.html
                   fast/css/comment-before-charset.html
                   fast/css/many-spaces-before-charset.html
                   fast/css/space-before-charset-external.html
                   fast/css/space-before-charset.html
    
            * css/CSSGrammar.y:
    2009-10-16  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Alexey Proskuryakov.
    
            @charset rule after the first byte causes the rest of css to be ignored
            https://bugs.webkit.org/show_bug.cgi?id=18265
    
            Test that we allow whitespace and comments before the charset rule.
            These test results all match Firefox.
    
            * fast/css/comment-before-charset-expected.txt: Added.
            * fast/css/comment-before-charset-external-expected.txt: Added.
            * fast/css/comment-before-charset-external.html: Added.
            * fast/css/comment-before-charset.html: Added.
            * fast/css/many-spaces-before-charset-expected.txt: Added.
            * fast/css/many-spaces-before-charset.html: Added.
            * fast/css/resources/comment-before-charset.css: Added.
            * fast/css/resources/space-before-charset.css: Added.
            * fast/css/space-before-charset-expected.txt: Added.
            * fast/css/space-before-charset-external-expected.txt: Added.
            * fast/css/space-before-charset-external.html: Added.
            * fast/css/space-before-charset.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49727 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7354c59..fbc9b86 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,26 @@
+2009-10-16  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        @charset rule after the first byte causes the rest of css to be ignored
+        https://bugs.webkit.org/show_bug.cgi?id=18265
+
+        Test that we allow whitespace and comments before the charset rule.
+        These test results all match Firefox.
+
+        * fast/css/comment-before-charset-expected.txt: Added.
+        * fast/css/comment-before-charset-external-expected.txt: Added.
+        * fast/css/comment-before-charset-external.html: Added.
+        * fast/css/comment-before-charset.html: Added.
+        * fast/css/many-spaces-before-charset-expected.txt: Added.
+        * fast/css/many-spaces-before-charset.html: Added.
+        * fast/css/resources/comment-before-charset.css: Added.
+        * fast/css/resources/space-before-charset.css: Added.
+        * fast/css/space-before-charset-expected.txt: Added.
+        * fast/css/space-before-charset-external-expected.txt: Added.
+        * fast/css/space-before-charset-external.html: Added.
+        * fast/css/space-before-charset.html: Added.
+
 2009-10-16  Brian Weinstein  <bweinstein at apple.com>
 
         Rubber-stamped by Adam Roben.
diff --git a/LayoutTests/fast/css/comment-before-charset-expected.txt b/LayoutTests/fast/css/comment-before-charset-expected.txt
new file mode 100644
index 0000000..fd0d30e
--- /dev/null
+++ b/LayoutTests/fast/css/comment-before-charset-expected.txt
@@ -0,0 +1,2 @@
+I should have a green background.
+rgb(0, 128, 0)
diff --git a/LayoutTests/fast/css/comment-before-charset-external-expected.txt b/LayoutTests/fast/css/comment-before-charset-external-expected.txt
new file mode 100644
index 0000000..fd0d30e
--- /dev/null
+++ b/LayoutTests/fast/css/comment-before-charset-external-expected.txt
@@ -0,0 +1,2 @@
+I should have a green background.
+rgb(0, 128, 0)
diff --git a/LayoutTests/fast/css/comment-before-charset-external.html b/LayoutTests/fast/css/comment-before-charset-external.html
new file mode 100644
index 0000000..c55c921
--- /dev/null
+++ b/LayoutTests/fast/css/comment-before-charset-external.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+window.onload = function() {
+    var elmt = document.getElementById("probe");  
+    var color = window.getComputedStyle(elmt, null).getPropertyValue("background-color");  
+    document.getElementById("results").innerHTML= color;
+}
+</script>
+<link rel="stylesheet" href="resources/comment-before-charset.css" />
+</head>
+<body>
+<div id="probe" class="green">
+I should have a green background.
+</div>
+<div id="results"></div>
+</html>
diff --git a/LayoutTests/fast/css/comment-before-charset.html b/LayoutTests/fast/css/comment-before-charset.html
new file mode 100644
index 0000000..a0c6730
--- /dev/null
+++ b/LayoutTests/fast/css/comment-before-charset.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+window.onload = function() {
+    var elmt = document.getElementById("probe");  
+    var color = window.getComputedStyle(elmt, null).getPropertyValue("background-color");  
+    document.getElementById("results").innerHTML= color;
+}
+</script>
+<style>
+/* This is a comment before the charset! */
+ at charset "utf-8";
+.green {
+  background-color: green;
+}
+</style>
+</head>
+<body>
+<div id="probe" class="green">
+I should have a green background.
+</div>
+<div id="results"></div>
+</html>
diff --git a/LayoutTests/fast/css/many-spaces-before-charset-expected.txt b/LayoutTests/fast/css/many-spaces-before-charset-expected.txt
new file mode 100644
index 0000000..fd0d30e
--- /dev/null
+++ b/LayoutTests/fast/css/many-spaces-before-charset-expected.txt
@@ -0,0 +1,2 @@
+I should have a green background.
+rgb(0, 128, 0)
diff --git a/LayoutTests/fast/css/many-spaces-before-charset.html b/LayoutTests/fast/css/many-spaces-before-charset.html
new file mode 100644
index 0000000..d4cbb53
--- /dev/null
+++ b/LayoutTests/fast/css/many-spaces-before-charset.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+window.onload = function() {
+    var elmt = document.getElementById("probe");  
+    var color = window.getComputedStyle(elmt, null).getPropertyValue("background-color");  
+    document.getElementById("results").innerHTML= color;
+}
+</script>
+<style>
+    @charset "utf-8";
+.green {
+  background-color: green;
+}
+</style>
+</head>
+<body>
+<div id="probe" class="green">
+I should have a green background.
+</div>
+<div id="results"></div>
+</html>
diff --git a/LayoutTests/fast/css/resources/comment-before-charset.css b/LayoutTests/fast/css/resources/comment-before-charset.css
new file mode 100644
index 0000000..c29e17f
--- /dev/null
+++ b/LayoutTests/fast/css/resources/comment-before-charset.css
@@ -0,0 +1,5 @@
+/* Oh noes!  A comment... */
+ at charset "utf-8";
+.green {
+  background-color: green;
+}
diff --git a/LayoutTests/fast/css/resources/space-before-charset.css b/LayoutTests/fast/css/resources/space-before-charset.css
new file mode 100644
index 0000000..ce70637
--- /dev/null
+++ b/LayoutTests/fast/css/resources/space-before-charset.css
@@ -0,0 +1,4 @@
+     @charset "utf-8";
+.green {
+  background-color: green;
+}
diff --git a/LayoutTests/fast/css/space-before-charset-expected.txt b/LayoutTests/fast/css/space-before-charset-expected.txt
new file mode 100644
index 0000000..fd0d30e
--- /dev/null
+++ b/LayoutTests/fast/css/space-before-charset-expected.txt
@@ -0,0 +1,2 @@
+I should have a green background.
+rgb(0, 128, 0)
diff --git a/LayoutTests/fast/css/space-before-charset-external-expected.txt b/LayoutTests/fast/css/space-before-charset-external-expected.txt
new file mode 100644
index 0000000..fd0d30e
--- /dev/null
+++ b/LayoutTests/fast/css/space-before-charset-external-expected.txt
@@ -0,0 +1,2 @@
+I should have a green background.
+rgb(0, 128, 0)
diff --git a/LayoutTests/fast/css/space-before-charset-external.html b/LayoutTests/fast/css/space-before-charset-external.html
new file mode 100644
index 0000000..c4d2627
--- /dev/null
+++ b/LayoutTests/fast/css/space-before-charset-external.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+window.onload = function() {
+    var elmt = document.getElementById("probe");  
+    var color = window.getComputedStyle(elmt, null).getPropertyValue("background-color");  
+    document.getElementById("results").innerHTML= color;
+}
+</script>
+<link rel="stylesheet" href="resources/space-before-charset.css" />
+</head>
+<body>
+<div id="probe" class="green">
+I should have a green background.
+</div>
+<div id="results"></div>
+</html>
diff --git a/LayoutTests/fast/css/space-before-charset.html b/LayoutTests/fast/css/space-before-charset.html
new file mode 100644
index 0000000..c845948
--- /dev/null
+++ b/LayoutTests/fast/css/space-before-charset.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+window.onload = function() {
+    var elmt = document.getElementById("probe");  
+    var color = window.getComputedStyle(elmt, null).getPropertyValue("background-color");  
+    document.getElementById("results").innerHTML= color;
+}
+</script>
+<style>
+ at charset "utf-8";
+.green {
+  background-color: green;
+}
+</style>
+</head>
+<body>
+<div id="probe" class="green">
+I should have a green background.
+</div>
+<div id="results"></div>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b3430bb..6ade168 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2009-10-16  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        @charset rule after the first byte causes the rest of css to be ignored
+        https://bugs.webkit.org/show_bug.cgi?id=18265
+
+        Apparently we're supposed to tolerate whitespace before the charset
+        rule so folks can write code like this:
+
+        <style>
+        @charset "utf-8"
+        ...
+        </style>
+
+        I'm told this is one of the top compatability problems in China.
+        Tests: fast/css/comment-before-charset-external.html
+               fast/css/comment-before-charset.html
+               fast/css/many-spaces-before-charset.html
+               fast/css/space-before-charset-external.html
+               fast/css/space-before-charset.html
+
+        * css/CSSGrammar.y:
+
 2009-10-16  Brian Weinstein  <bweinstein at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/css/CSSGrammar.y b/WebCore/css/CSSGrammar.y
index 1c1f7b4..0530e91 100644
--- a/WebCore/css/CSSGrammar.y
+++ b/WebCore/css/CSSGrammar.y
@@ -97,7 +97,7 @@ static int cssyylex(YYSTYPE* yylval, void* parser)
 
 %}
 
-%expect 50
+%expect 51
 
 %nonassoc LOWEST_PREC
 
@@ -268,7 +268,7 @@ static int cssyylex(YYSTYPE* yylval, void* parser)
 %%
 
 stylesheet:
-    maybe_charset maybe_sgml import_list variables_list namespace_list rule_list
+    maybe_space maybe_charset maybe_sgml import_list variables_list namespace_list rule_list
   | webkit_rule maybe_space
   | webkit_decls maybe_space
   | webkit_value maybe_space

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list