mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
css: Don't import CSS too early
First, finish parsing the import rule including the semicolon. Then try to actually import. test: css/parser/at-invalid-01.css
This commit is contained in:
parent
4653c7017f
commit
1b0231b743
@ -1790,7 +1790,12 @@ parse_import (GtkCssScanner *scanner)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gtk_css_scanner_would_recurse (scanner, file))
|
||||
if (!_gtk_css_parser_try (scanner->parser, ";", TRUE))
|
||||
{
|
||||
gtk_css_provider_invalid_token (scanner->provider, scanner, "semicolon");
|
||||
_gtk_css_parser_resync (scanner->parser, TRUE, 0);
|
||||
}
|
||||
else if (gtk_css_scanner_would_recurse (scanner, file))
|
||||
{
|
||||
char *path = g_file_get_path (file);
|
||||
gtk_css_provider_error (scanner->provider,
|
||||
@ -1810,12 +1815,6 @@ parse_import (GtkCssScanner *scanner)
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (!_gtk_css_parser_try (scanner->parser, ";", TRUE))
|
||||
{
|
||||
gtk_css_provider_invalid_token (scanner->provider, scanner, "semicolon");
|
||||
_gtk_css_parser_resync (scanner->parser, TRUE, 0);
|
||||
}
|
||||
|
||||
g_object_unref (file);
|
||||
|
||||
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_IMPORT);
|
||||
|
Loading…
Reference in New Issue
Block a user