mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 04:32:51 +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:
parent
c136fd3fe2
commit
71e8ddcd1c
Notes:
sideshowbarker
2024-07-19 11:45:40 +09:00
Author: https://github.com/awesomekling
Commit: 71e8ddcd1c
8 changed files with 89 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue