mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:45:07 +00:00
LibHTML: Make StyleResolver responsible for loading the default style
Instead of HtmlView clients having to worry about parsing and loading the default CSS, just take care of it inside StyleResolver. The default style is automatically inserted into the stylesheet list, at the very start, so everyone else gets a chance to override it.
This commit is contained in:
parent
77218b1c2a
commit
ee64d99a96
4 changed files with 26 additions and 12 deletions
|
@ -46,10 +46,6 @@ int main(int argc, char* argv[])
|
|||
|
||||
auto html_view = HtmlView::construct(splitter);
|
||||
|
||||
extern const char default_stylesheet_source[];
|
||||
String css = default_stylesheet_source;
|
||||
auto sheet = parse_css(css);
|
||||
|
||||
History history;
|
||||
|
||||
RefPtr<GAction> go_back_action;
|
||||
|
@ -86,7 +82,6 @@ int main(int argc, char* argv[])
|
|||
String html = md_document.render_to_html();
|
||||
auto html_document = parse_html(html);
|
||||
html_document->normalize();
|
||||
html_document->add_sheet(sheet);
|
||||
html_view->set_document(html_document);
|
||||
|
||||
String page_and_section = model->page_and_section(tree_view->selection().first());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue