mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +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
|
@ -33,14 +33,9 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
extern const char default_stylesheet_source[];
|
||||
String css = default_stylesheet_source;
|
||||
auto sheet = parse_css(css);
|
||||
|
||||
String html = String::copy(f->read_all());
|
||||
auto document = parse_html(html);
|
||||
document->normalize();
|
||||
document->add_sheet(*sheet);
|
||||
|
||||
auto window = GWindow::construct();
|
||||
auto widget = HtmlView::construct();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue