mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 07:18:13 +00:00
LibWeb: Add actual document loading for the CSS (at)import rule
This commit is contained in:
parent
54617e1a91
commit
183ebaee91
11 changed files with 229 additions and 56 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -27,13 +28,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
#include <LibWeb/Loader/Resource.h>
|
||||
#include <LibWeb/Loader/CSSLoader.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
class HTMLLinkElement final
|
||||
: public HTMLElement
|
||||
, public ResourceClient {
|
||||
class HTMLLinkElement final : public HTMLElement {
|
||||
public:
|
||||
using WrapperType = Bindings::HTMLLinkElementWrapper;
|
||||
|
||||
|
@ -47,14 +46,8 @@ public:
|
|||
String href() const { return attribute(HTML::AttributeNames::href); }
|
||||
|
||||
private:
|
||||
// ^ResourceClient
|
||||
virtual void resource_did_fail() override;
|
||||
virtual void resource_did_load() override;
|
||||
|
||||
void parse_attribute(const FlyString&, const String&) override;
|
||||
|
||||
void load_stylesheet(const URL&);
|
||||
|
||||
struct Relationship {
|
||||
enum {
|
||||
Alternate = 1 << 0,
|
||||
|
@ -63,7 +56,7 @@ private:
|
|||
};
|
||||
|
||||
unsigned m_relationship { 0 };
|
||||
RefPtr<CSS::StyleSheet> m_style_sheet;
|
||||
CSSLoader m_css_loader;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue