mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb: Handle JavaScript source code with non-UTF-8 encoding
When fetching scripts in HTMLScriptElement's "prepare a script" algorithm, we now re-encode the script sources to UTF-8.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 06:54:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/83c69fa62e
@@ -13,7 +13,9 @@
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
class HTMLScriptElement final : public HTMLElement {
|
||||
class HTMLScriptElement final
|
||||
: public HTMLElement
|
||||
, public ResourceClient {
|
||||
WEB_PLATFORM_OBJECT(HTMLScriptElement, HTMLElement);
|
||||
|
||||
public:
|
||||
@@ -49,9 +51,12 @@ public:
|
||||
|
||||
void set_source_line_number(Badge<HTMLParser>, size_t source_line_number) { m_source_line_number = source_line_number; }
|
||||
|
||||
private:
|
||||
public:
|
||||
HTMLScriptElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void resource_did_load() override;
|
||||
virtual void resource_did_fail() override;
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
void prepare_script();
|
||||
|
||||
Reference in New Issue
Block a user