mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibWeb: Use SourceLocation for DeprecatedCSSParser logging.
This commit is contained in:
parent
7a73f11005
commit
4022d3cb75
Notes:
sideshowbarker
2024-07-18 19:08:29 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/4022d3cb75c Pull-request: https://github.com/SerenityOS/serenity/pull/6623
1 changed files with 11 additions and 10 deletions
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
|
#include <AK/SourceLocation.h>
|
||||||
#include <LibWeb/CSS/CSSImportRule.h>
|
#include <LibWeb/CSS/CSSImportRule.h>
|
||||||
#include <LibWeb/CSS/CSSRule.h>
|
#include <LibWeb/CSS/CSSRule.h>
|
||||||
#include <LibWeb/CSS/CSSStyleRule.h>
|
#include <LibWeb/CSS/CSSStyleRule.h>
|
||||||
|
@ -22,10 +23,10 @@
|
||||||
VERIFY_NOT_REACHED(); \
|
VERIFY_NOT_REACHED(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PARSE_ERROR() \
|
static inline void log_parse_error(const SourceLocation& location = SourceLocation::current())
|
||||||
do { \
|
{
|
||||||
dbgln("CSS parse error"); \
|
dbgln("CSS Parse error! {}", location);
|
||||||
} while (0)
|
}
|
||||||
|
|
||||||
namespace Web {
|
namespace Web {
|
||||||
|
|
||||||
|
@ -325,11 +326,11 @@ public:
|
||||||
dbgln("CSSParser: Peeked '{:c}' wanted specific '{:c}'", peek(), ch);
|
dbgln("CSSParser: Peeked '{:c}' wanted specific '{:c}'", peek(), ch);
|
||||||
}
|
}
|
||||||
if (!peek()) {
|
if (!peek()) {
|
||||||
PARSE_ERROR();
|
log_parse_error();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (peek() != ch) {
|
if (peek() != ch) {
|
||||||
PARSE_ERROR();
|
log_parse_error();
|
||||||
++index;
|
++index;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -795,12 +796,12 @@ public:
|
||||||
{
|
{
|
||||||
parse_selector_list();
|
parse_selector_list();
|
||||||
if (!consume_specific('{')) {
|
if (!consume_specific('{')) {
|
||||||
PARSE_ERROR();
|
log_parse_error();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parse_declaration();
|
parse_declaration();
|
||||||
if (!consume_specific('}')) {
|
if (!consume_specific('}')) {
|
||||||
PARSE_ERROR();
|
log_parse_error();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -810,7 +811,7 @@ public:
|
||||||
Optional<String> parse_string()
|
Optional<String> parse_string()
|
||||||
{
|
{
|
||||||
if (!is_valid_string_quotes_char(peek())) {
|
if (!is_valid_string_quotes_char(peek())) {
|
||||||
PARSE_ERROR();
|
log_parse_error();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -870,7 +871,7 @@ public:
|
||||||
if (!consume_specific(')'))
|
if (!consume_specific(')'))
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
PARSE_ERROR();
|
log_parse_error();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue