[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
ap at apple.com
ap at apple.com
Wed Dec 22 12:50:33 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 5ce429c013c284122e0127536095439ce7ae0167
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 31 15:49:18 2010 +0000
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=36515
CSS style definitions are ignored if they just follow a "@charset" which appears in lines
other than the first line in stylesheet.
Test: fast/css/misplaced-charset.html
* css/CSSGrammar.y: Ignore a misplaced charset rule without consuming extra characters and
thus breaking subsequent rules.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5e196d3..a56e6ca 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-31 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36515
+ CSS style definitions are ignored if they just follow a "@charset" which appears in lines
+ other than the first line in stylesheet.
+
+ * fast/css/misplaced-charset-expected.txt: Added.
+ * fast/css/misplaced-charset.html: Added.
+
2010-08-31 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/css/misplaced-charset-expected.txt b/LayoutTests/fast/css/misplaced-charset-expected.txt
new file mode 100644
index 0000000..4448c84
--- /dev/null
+++ b/LayoutTests/fast/css/misplaced-charset-expected.txt
@@ -0,0 +1,6 @@
+Test for bug 36515: CSS style definitions are ignored if they just follow a "@charset" which appears in lines other than the first line in stylesheet.
+
+There should be two green squares below:
+
+
+PASS
diff --git a/LayoutTests/fast/css/misplaced-charset.html b/LayoutTests/fast/css/misplaced-charset.html
new file mode 100644
index 0000000..0a148c4
--- /dev/null
+++ b/LayoutTests/fast/css/misplaced-charset.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+div.a {background-color: red;}
+ at charset "XXX";
+div.a {background-color: green !important;}
+ at charset "XXX";
+div.b {background-color: green !important;}
+</style>
+</head>
+<body>
+ <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=36515">bug 36515</a>:
+ CSS style definitions are ignored if they just follow a "@charset" which appears in lines other than the first line in stylesheet.</p>
+ <p>There should be two green squares below:</p>
+ <div class="a" style="height:100px; width:100px;"></div><br>
+ <div class="b" style="height:100px; width:100px; background-color:red;"></div>
+ <div style="height:5px; width:5px; background-color:green; visibility: hidden"></div>
+ <div id="result">Testing...</div>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ var expected = document.defaultView.getComputedStyle(document.getElementsByTagName("div")[2], null).backgroundColor;
+ var result = document.defaultView.getComputedStyle(document.getElementsByTagName("div")[0], null).backgroundColor == expected
+ && document.defaultView.getComputedStyle(document.getElementsByTagName("div")[1], null).backgroundColor == expected;
+ document.getElementById("result").innerHTML = result ? "PASS" : "FAIL";
+ </script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9faf21c..196596f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-31 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36515
+ CSS style definitions are ignored if they just follow a "@charset" which appears in lines
+ other than the first line in stylesheet.
+
+ Test: fast/css/misplaced-charset.html
+
+ * css/CSSGrammar.y: Ignore a misplaced charset rule without consuming extra characters and
+ thus breaking subsequent rules.
+
2010-08-31 Patrick Gansterer <paroga at paroga.com>
Reviewed by Antonio Gomes.
diff --git a/WebCore/css/CSSGrammar.y b/WebCore/css/CSSGrammar.y
index 16b2cc8..ec507be 100644
--- a/WebCore/css/CSSGrammar.y
+++ b/WebCore/css/CSSGrammar.y
@@ -99,7 +99,7 @@ static int cssyylex(YYSTYPE* yylval, void* parser)
%}
-%expect 55
+%expect 56
%nonassoc LOWEST_PREC
@@ -202,6 +202,7 @@ static int cssyylex(YYSTYPE* yylval, void* parser)
%type <relation> combinator
%type <rule> charset
+%type <rule> ignored_charset
%type <rule> ruleset
%type <rule> media
%type <rule> import
@@ -390,6 +391,13 @@ charset:
}
;
+ignored_charset:
+ CHARSET_SYM maybe_space STRING maybe_space ';' {
+ // Ignore any @charset rule not at the beginning of the style sheet.
+ $$ = 0;
+ }
+;
+
rule_list:
/* empty */
| rule_list rule maybe_sgml {
@@ -414,6 +422,7 @@ rule:
valid_rule {
static_cast<CSSParser*>(parser)->m_hadSyntacticallyValidCSSRule = true;
}
+ | ignored_charset
| invalid_rule
| invalid_at
;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list