From 1c2b6b074e9814fd2e7418e47dac4c664630f00e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 Jun 2020 17:14:41 +0200 Subject: [PATCH] LibWeb: Fix misunderstood implementation of "table" and "select" scopes These "stack of open elements" scopes are not supposed to include the base list of element types. --- Libraries/LibWeb/Parser/StackOfOpenElements.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Libraries/LibWeb/Parser/StackOfOpenElements.cpp b/Libraries/LibWeb/Parser/StackOfOpenElements.cpp index d27c0f95c9..6114d12d59 100644 --- a/Libraries/LibWeb/Parser/StackOfOpenElements.cpp +++ b/Libraries/LibWeb/Parser/StackOfOpenElements.cpp @@ -79,11 +79,7 @@ bool StackOfOpenElements::has_in_button_scope(const FlyString& tag_name) const bool StackOfOpenElements::has_in_table_scope(const FlyString& tag_name) const { - auto list = s_base_list; - list.append("html"); - list.append("table"); - list.append("template"); - return has_in_scope_impl(tag_name, list); + return has_in_scope_impl(tag_name, { "html", "table", "template" }); } bool StackOfOpenElements::has_in_list_item_scope(const FlyString& tag_name) const @@ -96,10 +92,7 @@ bool StackOfOpenElements::has_in_list_item_scope(const FlyString& tag_name) cons bool StackOfOpenElements::has_in_select_scope(const FlyString& tag_name) const { - auto list = s_base_list; - list.append("option"); - list.append("optgroup"); - return has_in_scope_impl(tag_name, list); + return has_in_scope_impl(tag_name, { "option", "optgroup" }); } bool StackOfOpenElements::contains(const Element& element) const