1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibWeb: Don't create a layout node for <noscript> when scripting enabled

This makes stuff inside <noscript> correctly not show up since we run
with scripting enabled.

In the future, we can add a way to disable scripting, but for now,
Document::is_scripting_enabled() just returns true.
This commit is contained in:
Andreas Kling 2020-06-05 13:24:35 +02:00
parent d8208fd37c
commit 762617a028
2 changed files with 6 additions and 0 deletions

View file

@ -57,6 +57,8 @@ public:
Origin origin() const;
bool is_scripting_enabled() const { return true; }
URL complete_url(const String&) const;
void fixup();

View file

@ -114,6 +114,10 @@ RefPtr<LayoutNode> Element::create_layout_node(const StyleProperties* parent_sty
if (display == "none")
return nullptr;
if (tag_name() == "noscript" && document().is_scripting_enabled())
return nullptr;
if (display == "block")
return adopt(*new LayoutBlock(this, move(style)));
if (display == "inline")