forked from AuroraMiddleware/gtk
csstokenizer: Consume the \ when encountering an error
Otherwise we infinitely end up with the error again. Testcases added.
This commit is contained in:
parent
15b8ee4564
commit
562e492056
@ -1376,6 +1376,7 @@ gtk_css_tokenizer_read_token (GtkCssTokenizer *tokenizer,
|
||||
else
|
||||
{
|
||||
gtk_css_token_init (token, GTK_CSS_TOKEN_DELIM, '\\');
|
||||
gtk_css_tokenizer_consume_ascii (tokenizer);
|
||||
gtk_css_tokenizer_parse_error (error, "Newline may not follow '\' escape character");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -347,6 +347,12 @@ test_data = [
|
||||
'min-height.ref.css',
|
||||
'min-width.css',
|
||||
'min-width.ref.css',
|
||||
'newline-after-backslash.css',
|
||||
'newline-after-backslash.errors',
|
||||
'newline-after-backslash.ref.css',
|
||||
'newline-after-backslash-original.css',
|
||||
'newline-after-backslash-original.errors',
|
||||
'newline-after-backslash-original.ref.css',
|
||||
'no-semicolon.css',
|
||||
'no-semicolon.errors',
|
||||
'no-semicolon.ref.css',
|
||||
|
24
testsuite/css/parser/newline-after-backslash-original.css
Normal file
24
testsuite/css/parser/newline-after-backslash-original.css
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
You can type here any CSS rule recognized by GTK.
|
||||
You can temporarily disable this custom CSS by clicking on the “Pause” button above.
|
||||
|
||||
Changes are applied instantly and globally, for the whole application.
|
||||
*/
|
||||
|
||||
|
||||
modelbutton.flat:hover {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
popover arrow {
|
||||
background-color: lime;
|
||||
border-width: 2px;
|
||||
border-color: green;
|
||||
}
|
||||
|
||||
popover {
|
||||
}
|
||||
\
|
||||
popover contents {
|
||||
background-color: magenta;
|
||||
}
|
@ -0,0 +1 @@
|
||||
newline-after-backslash-original.css:21:1-2: error: GTK_CSS_PARSER_ERROR_SYNTAX
|
@ -0,0 +1,18 @@
|
||||
popover {
|
||||
}
|
||||
|
||||
popover arrow {
|
||||
background-color: rgb(0,255,0);
|
||||
border-bottom-color: rgb(0,128,0);
|
||||
border-bottom-width: 2px;
|
||||
border-left-color: rgb(0,128,0);
|
||||
border-left-width: 2px;
|
||||
border-right-color: rgb(0,128,0);
|
||||
border-right-width: 2px;
|
||||
border-top-color: rgb(0,128,0);
|
||||
border-top-width: 2px;
|
||||
}
|
||||
|
||||
modelbutton:hover.flat {
|
||||
background-color: rgb(255,0,0);
|
||||
}
|
1
testsuite/css/parser/newline-after-backslash.css
Normal file
1
testsuite/css/parser/newline-after-backslash.css
Normal file
@ -0,0 +1 @@
|
||||
\
|
1
testsuite/css/parser/newline-after-backslash.errors
Normal file
1
testsuite/css/parser/newline-after-backslash.errors
Normal file
@ -0,0 +1 @@
|
||||
newline-after-backslash.css:1:1-2: error: GTK_CSS_PARSER_ERROR_SYNTAX
|
Loading…
Reference in New Issue
Block a user