mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/CSS: Dump out media queries in more detail
Instead of just serializing them, dump out the query condition as a tree, taking advantage of the existing dump code for BooleanExpressions.
This commit is contained in:
parent
1db13c52be
commit
5343c9bd2e
Notes:
github-actions[bot]
2025-12-04 16:25:37 +00:00
Author: https://github.com/AtkinsSJ
Commit: 5343c9bd2e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7018
5 changed files with 37 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2025, Sam Atkins <sam@ladybird.org>
|
||||
* Copyright (c) 2022-2023, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
#include <LibWeb/CSS/MediaList.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
|
@ -136,4 +137,12 @@ Optional<JS::Value> MediaList::item_value(size_t index) const
|
|||
return JS::PrimitiveString::create(vm(), m_media[index]->to_string());
|
||||
}
|
||||
|
||||
void MediaList::dump(StringBuilder& builder, int indent_levels) const
|
||||
{
|
||||
dump_indent(builder, indent_levels);
|
||||
builder.appendff("Media list ({}):\n", m_media.size());
|
||||
for (auto const& media : m_media)
|
||||
media->dump(builder, indent_levels + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue