summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Dump.cpp
diff options
context:
space:
mode:
authorSviatoslav Peleshko <speles@mail.ua>2021-02-21 18:36:34 +0200
committerAndreas Kling <kling@serenityos.org>2021-02-28 10:27:32 +0100
commit54617e1a9109b28b00599a247de2f9607152c129 (patch)
tree8fb5856a0e667fd83354af750f9a9b80c99c020e /Userland/Libraries/LibWeb/Dump.cpp
parent04d67d023945ebfc8375a67212b690619916ef2a (diff)
downloadserenity-54617e1a9109b28b00599a247de2f9607152c129.zip
LibWeb: Added simple parsing for (at)import rules
For now, the parsing is very crude, and parses only the document url. The meta queries for the import are ignored.
Diffstat (limited to 'Userland/Libraries/LibWeb/Dump.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Dump.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp
index 2ce412a23a..0a2d2f8d36 100644
--- a/Userland/Libraries/LibWeb/Dump.cpp
+++ b/Userland/Libraries/LibWeb/Dump.cpp
@@ -28,6 +28,7 @@
#include <AK/QuickSort.h>
#include <AK/StringBuilder.h>
#include <AK/Utf8View.h>
+#include <LibWeb/CSS/CSSImportRule.h>
#include <LibWeb/CSS/CSSRule.h>
#include <LibWeb/CSS/PropertyID.h>
#include <LibWeb/CSS/StyleRule.h>
@@ -406,11 +407,19 @@ void dump_rule(StringBuilder& builder, const CSS::CSSRule& rule)
case CSS::CSSRule::Type::Style:
dump_style_rule(builder, downcast<const CSS::StyleRule>(rule));
break;
+ case CSS::CSSRule::Type::Import:
+ dump_import_rule(builder, downcast<const CSS::CSSImportRule>(rule));
+ break;
default:
VERIFY_NOT_REACHED();
}
}
+void dump_import_rule(StringBuilder& builder, const CSS::CSSImportRule& rule)
+{
+ builder.appendff(" Document URL: {}\n", rule.url());
+}
+
void dump_style_rule(StringBuilder& builder, const CSS::StyleRule& rule)
{
for (auto& selector : rule.selectors()) {