mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user