mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 15:49:15 +00:00
LibWeb/CSS: Use ErrorReporter for rule-parsing errors
Unfortunately we already have an InvalidRuleError type defined in the CSS Parser, so it has to be qualified here, at least for now.
This commit is contained in:
parent
0bd83dd996
commit
e072ddfebd
Notes:
github-actions[bot]
2025-08-04 09:52:25 +00:00
Author: https://github.com/AtkinsSJ
Commit: e072ddfebd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5576
2 changed files with 192 additions and 66 deletions
|
@ -14,6 +14,7 @@
|
|||
#include <LibWeb/CSS/CalculatedOr.h>
|
||||
#include <LibWeb/CSS/MediaList.h>
|
||||
#include <LibWeb/CSS/MediaQuery.h>
|
||||
#include <LibWeb/CSS/Parser/ErrorReporter.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
|
||||
namespace Web::CSS::Parser {
|
||||
|
@ -566,7 +567,11 @@ GC::Ptr<CSSMediaRule> Parser::convert_to_media_rule(AtRule const& rule, Nested n
|
|||
// <rule-list>
|
||||
// }
|
||||
if (!rule.is_block_rule) {
|
||||
dbgln_if(CSS_PARSER_DEBUG, "Failed to parse @media rule: Expected a block.");
|
||||
ErrorReporter::the().report(CSS::Parser::InvalidRuleError {
|
||||
.rule_name = "@media"_fly_string,
|
||||
.prelude = MUST(String::join(""sv, rule.prelude)),
|
||||
.description = "Expected a block."_string,
|
||||
});
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue