mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 23:29:52 +00:00
LibWeb/CSS: Use ErrorReporter for selector parsing errors
Also removed the error reporting from parse_a_n_plus_b_pattern() as its caller already reports that error.
This commit is contained in:
parent
2a2a1986cc
commit
d6cfd56ae6
Notes:
github-actions[bot]
2025-08-04 09:52:38 +00:00
Author: https://github.com/AtkinsSJ
Commit: d6cfd56ae6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5576
2 changed files with 186 additions and 56 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "Selector.h"
|
||||
#include <AK/GenericShorthands.h>
|
||||
#include <LibWeb/CSS/Parser/ErrorReporter.h>
|
||||
#include <LibWeb/CSS/Serialize.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -728,7 +729,10 @@ Optional<Selector::SimpleSelector> Selector::SimpleSelector::absolutized(Selecto
|
|||
if (pseudo_class.type == PseudoClass::Has) {
|
||||
for (auto const& selector : pseudo_class.argument_selector_list) {
|
||||
if (contains_invalid_contents_for_has(selector)) {
|
||||
dbgln_if(CSS_PARSER_DEBUG, "After absolutizing, :has() would contain invalid contents; rejecting");
|
||||
Parser::ErrorReporter::the().report(Parser::InvalidSelectorError {
|
||||
.value_string = selector->serialize(),
|
||||
.description = "After absolutizing, :has() would contain invalid contents."_string,
|
||||
});
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue