From 43e55668ebeed51996dcf69def2cc2ecab546827 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 29 Mar 2024 07:20:16 -0400 Subject: [PATCH] LibWeb: Implement Document's supported property names closer to the spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our implementation was errantly matching HTML tags other than the list specified by the spec. For example, a tag would be a match for document.title. For example, bandcamp will dynamically update its title when audio is played as follows: document.title = "▶︎ " + document.title; And bandcamp also has a tag. The result was that the title would become "▶︎ [object HTMLMetaElement]". --- .../DOM/Document-named-properties.txt | 3 +- .../Text/expected/title-with-meta-title.txt | 1 + .../input/DOM/Document-named-properties.html | 3 + .../Text/input/title-with-meta-title.html | 10 ++ Userland/Libraries/LibWeb/DOM/Document.cpp | 118 +++++++++--------- 5 files changed, 76 insertions(+), 59 deletions(-) create mode 100644 Tests/LibWeb/Text/expected/title-with-meta-title.txt create mode 100644 Tests/LibWeb/Text/input/title-with-meta-title.html diff --git a/Tests/LibWeb/Text/expected/DOM/Document-named-properties.txt b/Tests/LibWeb/Text/expected/DOM/Document-named-properties.txt index a60439f5495..0e2f8ffdde7 100644 --- a/Tests/LibWeb/Text/expected/DOM/Document-named-properties.txt +++ b/Tests/LibWeb/Text/expected/DOM/Document-named-properties.txt @@ -1,4 +1,4 @@ - Submit
+ Submit document.bob === document.forms[0]: true