LibHTML: Start adding support for <link rel="stylesheet">

This patch adds basic support for external stylesheets. It currently
only works with file:// URLs.

We do a synchronous full relayout after loading a stylesheet, which is
definitely on the aggressive side, but it gives us something to work
on improving. :^)
This commit is contained in:
Andreas Kling 2019-10-07 19:06:47 +02:00
parent c136fd3fe2
commit 71e8ddcd1c
Notes: sideshowbarker 2024-07-19 11:45:40 +09:00
8 changed files with 89 additions and 1 deletions

View file

@ -36,7 +36,11 @@ void HtmlView::set_document(Document* document)
m_document->on_invalidate_layout = nullptr;
m_document = document;
m_document->on_invalidate_layout = [this]() { layout_and_sync_size(); };
m_document->on_invalidate_layout = [this]() {
m_layout_root = m_document->create_layout_tree(m_document->style_resolver(), nullptr);
layout_and_sync_size();
update();
};
main_frame().set_document(document);