From 4b3e7fb47af47dfba5869e9b20d064d3b95480f5 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 30 Oct 2013 13:39:52 +0000 Subject: [PATCH 1/4] Add "Projects using this" to the README. --- README.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.rst b/README.rst index 7342d91b..60c62bc6 100644 --- a/README.rst +++ b/README.rst @@ -10,6 +10,17 @@ The upstream repository for these tests is at https://github.com/SimonSapin/css-parsing-tests +Projects using this +=================== + +CSS parsers using these tests: + +* [tinycss2](https://github.com/SimonSapin/tinycss2) (Python) +* [rust-cssparser](https://github.com/mozilla-servo/rust-cssparser) + (Rust, used in [Servo](https://github.com/mozilla/servo/)) +* [Crass](https://github.com/rgrove/crass/) (Ruby) + + Importing ========= From daf20eda4ca0077d34ec9bbe3174427c66a16970 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 30 Oct 2013 13:41:22 +0000 Subject: [PATCH 2/4] RINM. ReStructuredText Is Not Markdown. Again. --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 60c62bc6..9f4f5675 100644 --- a/README.rst +++ b/README.rst @@ -15,10 +15,10 @@ Projects using this CSS parsers using these tests: -* [tinycss2](https://github.com/SimonSapin/tinycss2) (Python) -* [rust-cssparser](https://github.com/mozilla-servo/rust-cssparser) - (Rust, used in [Servo](https://github.com/mozilla/servo/)) -* [Crass](https://github.com/rgrove/crass/) (Ruby) +* `tinycss2 `_ (Python) +* `rust-cssparser `_ + (Rust, used in `Servo `_) +* `Crass `_ (Ruby) Importing From f5baaa6051b947edaad403eb4450824fc9cc926e Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 6 Nov 2013 17:11:38 +0000 Subject: [PATCH 3/4] Add some tests with newlines inside url() --- component_value_list.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component_value_list.json b/component_value_list.json index 2ed07808..01c9cbb1 100644 --- a/component_value_list.json +++ b/component_value_list.json @@ -162,7 +162,7 @@ "url('a\nb') url('c\n", [["error", "bad-url"], " ", ["error", "bad-url"]], -"url() url( \t) url( Foô\\030\n!\n) url(a b) url(a\\ b) url(a(b) url(a\\(b) url(a'b) url(a\\'b) url(a\"b) url(a\\\"b) url(a\nb) url(a\\\nb) url(a\\a b) url(a\\", [ +"url() url( \t) url(\n Foô\\030\n!\n) url(\na\nb\n) url(a\\ b) url(a(b) url(a\\(b) url(a'b) url(a\\'b) url(a\"b) url(a\\\"b) url(a\nb) url(a\\\nb) url(a\\a b) url(a\\", [ ["url", ""], " ", ["url", ""], " ", ["url", "Foô0!"], " ", From 832c9005e3aa7a5b666ed45726a8be4252680845 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 6 Nov 2013 17:12:50 +0000 Subject: [PATCH 4/4] Fix #27: line number tracking inside url() --- tokenizer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tokenizer.rs b/tokenizer.rs index e44c2aa6..53112302 100644 --- a/tokenizer.rs +++ b/tokenizer.rs @@ -461,7 +461,11 @@ fn consume_url(tokenizer: &mut Tokenizer) -> ComponentValue { tokenizer.position += 1; // Skip the ( of url( while !tokenizer.is_eof() { match tokenizer.current_char() { - '\t' | '\n' | ' ' => tokenizer.position += 1, + ' ' | '\t' => tokenizer.position += 1, + '\n' => { + tokenizer.position += 1; + tokenizer.new_line(); + }, '"' => return consume_quoted_url(tokenizer, false), '\'' => return consume_quoted_url(tokenizer, true), ')' => { tokenizer.position += 1; break },