mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:08:11 +00:00
LibWeb: Reimplement the <style> element following the spec
We now follow the "update a style block" algorithm from the HTML spec instead of using the ad-hoc CSSLoader mechanism. This necessitated improving our StyleSheet and CSSStyleSheet classes as well, so that's baked into this commit.
This commit is contained in:
parent
6cda24097b
commit
d462a6720a
7 changed files with 163 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
@ -8,7 +8,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
#include <LibWeb/Loader/CSSLoader.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
@ -22,8 +21,11 @@ public:
|
|||
virtual void children_changed() override;
|
||||
virtual void removed_from(Node*) override;
|
||||
|
||||
void update_a_style_block();
|
||||
|
||||
private:
|
||||
CSSLoader m_css_loader;
|
||||
// https://drafts.csswg.org/cssom/#associated-css-style-sheet
|
||||
RefPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue