mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
LibWeb: Implement fetching classic scripts using Fetch infrastructure
This commit is contained in:
parent
12976b74ca
commit
a84e64ed22
Notes:
sideshowbarker
2024-07-17 11:30:05 +09:00
Author: https://github.com/trflynn89
Commit: a84e64ed22
Pull-request: https://github.com/SerenityOS/serenity/pull/18772
Issue: https://github.com/SerenityOS/serenity/issues/18432
3 changed files with 86 additions and 60 deletions
|
@ -8,15 +8,14 @@
|
|||
|
||||
#include <AK/Function.h>
|
||||
#include <LibWeb/DOM/DocumentLoadEventDelayer.h>
|
||||
#include <LibWeb/HTML/CORSSettingAttribute.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
#include <LibWeb/HTML/Scripting/Script.h>
|
||||
#include <LibWeb/Loader/Resource.h>
|
||||
#include <LibWeb/ReferrerPolicy/ReferrerPolicy.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
class HTMLScriptElement final
|
||||
: public HTMLElement
|
||||
, public ResourceClient {
|
||||
class HTMLScriptElement final : public HTMLElement {
|
||||
WEB_PLATFORM_OBJECT(HTMLScriptElement, HTMLElement);
|
||||
|
||||
public:
|
||||
|
@ -60,12 +59,12 @@ private:
|
|||
|
||||
virtual bool is_html_script_element() const override { return true; }
|
||||
|
||||
virtual void resource_did_load() override;
|
||||
virtual void resource_did_fail() override;
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void did_remove_attribute(DeprecatedFlyString const&) override;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/scripting.html#prepare-the-script-element
|
||||
void prepare_script();
|
||||
|
||||
|
@ -101,6 +100,12 @@ private:
|
|||
// https://html.spec.whatwg.org/multipage/scripting.html#ready-to-be-parser-executed
|
||||
bool m_ready_to_be_parser_executed { false };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/scripting.html#attr-script-crossorigin
|
||||
CORSSettingAttribute m_crossorigin { CORSSettingAttribute::NoCORS };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/scripting.html#attr-script-referrerpolicy
|
||||
Optional<ReferrerPolicy::ReferrerPolicy> m_referrer_policy;
|
||||
|
||||
bool m_failed_to_load { false };
|
||||
|
||||
enum class ScriptType {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue