mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 04:02:52 +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
|
@ -12,6 +12,7 @@
|
|||
#include <LibHTML/DOM/HTMLImageElement.h>
|
||||
#include <LibHTML/DOM/HTMLStyleElement.h>
|
||||
#include <LibHTML/DOM/HTMLTitleElement.h>
|
||||
#include <LibHTML/DOM/HTMLLinkElement.h>
|
||||
#include <LibHTML/DOM/Text.h>
|
||||
#include <LibHTML/Parser/HTMLParser.h>
|
||||
#include <ctype.h>
|
||||
|
@ -36,6 +37,8 @@ static NonnullRefPtr<Element> create_element(Document& document, const String& t
|
|||
return adopt(*new HTMLStyleElement(document, tag_name));
|
||||
if (lowercase_tag_name == "title")
|
||||
return adopt(*new HTMLTitleElement(document, tag_name));
|
||||
if (lowercase_tag_name == "link")
|
||||
return adopt(*new HTMLLinkElement(document, tag_name));
|
||||
if (lowercase_tag_name == "img")
|
||||
return adopt(*new HTMLImageElement(document, tag_name));
|
||||
if (lowercase_tag_name == "h1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue