mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
LibWeb: Split CSS::StyleSheet into StyleSheet and CSSStyleSheet
This is a little convoluted but matches the CSSOM specification.
This commit is contained in:
parent
0af4762662
commit
fefb05f6f3
17 changed files with 162 additions and 82 deletions
|
@ -43,14 +43,14 @@ void CSSLoader::load_from_text(const String& text)
|
|||
{
|
||||
m_style_sheet = parse_css(CSS::ParsingContext(*m_document), text);
|
||||
if (!m_style_sheet)
|
||||
m_style_sheet = CSS::StyleSheet::create({});
|
||||
m_style_sheet = CSS::CSSStyleSheet::create({});
|
||||
|
||||
load_next_import_if_needed();
|
||||
}
|
||||
|
||||
void CSSLoader::load_from_url(const URL& url)
|
||||
{
|
||||
m_style_sheet = CSS::StyleSheet::create({});
|
||||
m_style_sheet = CSS::CSSStyleSheet::create({});
|
||||
|
||||
LoadRequest request;
|
||||
request.set_url(url);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Function.h>
|
||||
#include <LibWeb/CSS/StyleSheet.h>
|
||||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
#include <LibWeb/Loader/Resource.h>
|
||||
|
||||
namespace Web {
|
||||
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
void load_next_import_if_needed();
|
||||
|
||||
RefPtr<CSS::StyleSheet> style_sheet() const { return m_style_sheet; };
|
||||
RefPtr<CSS::CSSStyleSheet> style_sheet() const { return m_style_sheet; };
|
||||
|
||||
Function<void()> on_load;
|
||||
Function<void()> on_fail;
|
||||
|
@ -51,7 +51,7 @@ private:
|
|||
virtual void resource_did_load() override;
|
||||
virtual void resource_did_fail() override;
|
||||
|
||||
RefPtr<CSS::StyleSheet> m_style_sheet;
|
||||
RefPtr<CSS::CSSStyleSheet> m_style_sheet;
|
||||
const DOM::Document* m_document;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue