mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-03 12:04:45 +00:00
LibHTML: Start fleshing out a StyleResolver class.
This will be responsible for matching selectors and creating LayoutStyle objects for the document and its elements.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <LibHTML/Dump.h>
|
||||
#include <LibHTML/Frame.h>
|
||||
#include <LibHTML/Parser/CSSParser.h>
|
||||
#include <LibHTML/CSS/StyleResolver.h>
|
||||
#include <LibHTML/Parser/HTMLParser.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -23,6 +24,11 @@ int main(int argc, char** argv)
|
||||
auto doc = parse_html(html);
|
||||
dump_tree(doc);
|
||||
|
||||
StyleResolver resolver(*doc);
|
||||
resolver.add_sheet(*sheet);
|
||||
|
||||
auto doc_style = resolver.resolve_document_style(*doc);
|
||||
|
||||
doc->build_layout_tree();
|
||||
ASSERT(doc->layout_node());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user