|
8 | 8 | #include <LibWeb/CSS/Serialize.h> |
9 | 9 | #include <LibWeb/CSS/StyleComputer.h> |
10 | 10 | #include <LibWeb/DOM/Document.h> |
| 11 | +#include <LibWeb/Dump.h> |
11 | 12 | #include <LibWeb/HTML/Window.h> |
12 | 13 | #include <LibWeb/Page/Page.h> |
13 | 14 |
|
@@ -261,7 +262,7 @@ MatchResult MediaFeature::compare(DOM::Document const& document, MediaFeatureVal |
261 | 262 | void MediaFeature::dump(StringBuilder& builder, int indent_levels) const |
262 | 263 | { |
263 | 264 | indent(builder, indent_levels); |
264 | | - builder.appendff("MediaFeature: {}", to_string()); |
| 265 | + builder.appendff("MediaFeature: {}\n", to_string()); |
265 | 266 | } |
266 | 267 |
|
267 | 268 | String MediaQuery::to_string() const |
@@ -318,6 +319,24 @@ bool MediaQuery::evaluate(DOM::Document const& document) |
318 | 319 | return m_matches; |
319 | 320 | } |
320 | 321 |
|
| 322 | +void MediaQuery::dump(StringBuilder& builder, int indent_levels) const |
| 323 | +{ |
| 324 | + dump_indent(builder, indent_levels); |
| 325 | + builder.appendff("Media condition: (matches = {})\n", m_matches); |
| 326 | + |
| 327 | + dump_indent(builder, indent_levels + 1); |
| 328 | + builder.appendff("Negated: {}\n", m_negated); |
| 329 | + |
| 330 | + dump_indent(builder, indent_levels + 1); |
| 331 | + builder.appendff("Type: {}\n", m_media_type.name); |
| 332 | + |
| 333 | + if (m_media_condition) { |
| 334 | + dump_indent(builder, indent_levels + 1); |
| 335 | + builder.append("Condition:\n"sv); |
| 336 | + m_media_condition->dump(builder, indent_levels + 2); |
| 337 | + } |
| 338 | +} |
| 339 | + |
321 | 340 | // https://www.w3.org/TR/cssom-1/#serialize-a-media-query-list |
322 | 341 | String serialize_a_media_query_list(Vector<NonnullRefPtr<MediaQuery>> const& media_queries) |
323 | 342 | { |
|
0 commit comments