20
20
#include < LibWeb/CSS/CSSStyleSheet.h>
21
21
#include < LibWeb/CSS/FontFace.h>
22
22
#include < LibWeb/CSS/MediaList.h>
23
+ #include < LibWeb/CSS/Parser/ErrorReporter.h>
23
24
#include < LibWeb/CSS/Parser/Parser.h>
24
25
#include < LibWeb/CSS/PropertyName.h>
25
26
#include < LibWeb/CSS/Sizing.h>
@@ -1750,7 +1751,11 @@ LengthOrCalculated Parser::parse_as_sizes_attribute(DOM::Element const& element,
1750
1751
remove_all_consecutive_whitespace_tokens_from_the_end_of (unparsed_size);
1751
1752
if (unparsed_size.is_empty ()) {
1752
1753
log_parse_error ();
1753
- dbgln_if (CSS_PARSER_DEBUG, " -> Failed in step 3.1; all whitespace" );
1754
+ ErrorReporter::the ().report (InvalidValueError {
1755
+ .value_type = " sizes attribute" _fly_string,
1756
+ .value_string = m_token_stream.dump_string (),
1757
+ .description = " Failed in step 3.1; all whitespace" _string,
1758
+ });
1754
1759
continue ;
1755
1760
}
1756
1761
@@ -1764,7 +1769,11 @@ LengthOrCalculated Parser::parse_as_sizes_attribute(DOM::Element const& element,
1764
1769
unparsed_size.take_last ();
1765
1770
} else {
1766
1771
log_parse_error ();
1767
- dbgln_if (CSS_PARSER_DEBUG, " -> Failed in step 3.2; couldn't parse {} as a <source-size-value>" , unparsed_size.last ().to_debug_string ());
1772
+ ErrorReporter::the ().report (InvalidValueError {
1773
+ .value_type = " sizes attribute" _fly_string,
1774
+ .value_string = m_token_stream.dump_string (),
1775
+ .description = " Failed in step 3.2; couldn't parse {} as a <source-size-value>" _string,
1776
+ });
1768
1777
continue ;
1769
1778
}
1770
1779
@@ -1789,7 +1798,11 @@ LengthOrCalculated Parser::parse_as_sizes_attribute(DOM::Element const& element,
1789
1798
// 1. If this was not the last item in unparsed sizes list, that is a parse error.
1790
1799
if (i != unparsed_sizes_list.size () - 1 ) {
1791
1800
log_parse_error ();
1792
- dbgln_if (CSS_PARSER_DEBUG, " -> Failed in step 3.4.1; is unparsed size #{}, count {}" , i, unparsed_sizes_list.size ());
1801
+ ErrorReporter::the ().report (InvalidValueError {
1802
+ .value_type = " sizes attribute" _fly_string,
1803
+ .value_string = m_token_stream.dump_string (),
1804
+ .description = MUST (String::formatted (" Failed in step 3.4.1; is unparsed size #{}, count {}" , i, unparsed_sizes_list.size ())),
1805
+ });
1793
1806
}
1794
1807
1795
1808
// 2. If size is not auto, then return size. Otherwise, continue.
0 commit comments