From 1369fc5069598644842defabbfbf3d30d2f3e647 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Thu, 8 Aug 2024 10:35:57 +0100 Subject: [PATCH] LibWeb: Change attribute type to USVString where applicable Also mark USVString attributes as containing a URL, where applicable. --- Tests/LibWeb/Text/expected/input-image.txt | 2 +- .../expected/usvstring-url-reflection.txt | 14 ++++++++++ .../Text/expected/video-canceled-load.txt | 2 +- .../Text/expected/video-failed-load.txt | 2 +- Tests/LibWeb/Text/input/input-image.html | 3 +- .../Text/input/usvstring-url-reflection.html | 28 +++++++++++++++++++ .../Text/input/video-canceled-load.html | 2 +- .../LibWeb/HTML/HTMLAnchorElement.idl | 2 +- .../LibWeb/HTML/HTMLEmbedElement.idl | 2 +- .../LibWeb/HTML/HTMLFrameElement.idl | 4 +-- .../LibWeb/HTML/HTMLIFrameElement.idl | 4 +-- .../LibWeb/HTML/HTMLImageElement.idl | 4 +-- .../LibWeb/HTML/HTMLInputElement.idl | 2 +- .../Libraries/LibWeb/HTML/HTMLLinkElement.idl | 4 +-- .../LibWeb/HTML/HTMLMediaElement.idl | 2 +- .../LibWeb/HTML/HTMLObjectElement.idl | 4 +-- .../LibWeb/HTML/HTMLScriptElement.idl | 2 +- .../LibWeb/HTML/HTMLSourceElement.idl | 4 +-- .../LibWeb/HTML/HTMLTrackElement.idl | 2 +- 19 files changed, 66 insertions(+), 23 deletions(-) create mode 100644 Tests/LibWeb/Text/expected/usvstring-url-reflection.txt create mode 100644 Tests/LibWeb/Text/input/usvstring-url-reflection.html diff --git a/Tests/LibWeb/Text/expected/input-image.txt b/Tests/LibWeb/Text/expected/input-image.txt index e99c0ff6f4e..a10a8420ea3 100644 --- a/Tests/LibWeb/Text/expected/input-image.txt +++ b/Tests/LibWeb/Text/expected/input-image.txt @@ -1,2 +1,2 @@ -../../Layout/input/120.png loaded +120.png loaded file:///i-do-no-exist-i-swear.png failed diff --git a/Tests/LibWeb/Text/expected/usvstring-url-reflection.txt b/Tests/LibWeb/Text/expected/usvstring-url-reflection.txt new file mode 100644 index 00000000000..f45cf42f7a1 --- /dev/null +++ b/Tests/LibWeb/Text/expected/usvstring-url-reflection.txt @@ -0,0 +1,14 @@ +audio.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +embed.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +frame.longDesc final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +frame.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +iframe.longDesc final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +iframe.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +img.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +link.href final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +object.codeBase final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +object.data final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +script.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +source.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +track.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD +video.src final URL path segment: %EF%BF%BDa%EF%BF%BDb%EF%BF%BD diff --git a/Tests/LibWeb/Text/expected/video-canceled-load.txt b/Tests/LibWeb/Text/expected/video-canceled-load.txt index 6d15bb54988..7adfb9174bd 100644 --- a/Tests/LibWeb/Text/expected/video-canceled-load.txt +++ b/Tests/LibWeb/Text/expected/video-canceled-load.txt @@ -1 +1 @@ - wfh + file:///example/file/location/wfh diff --git a/Tests/LibWeb/Text/expected/video-failed-load.txt b/Tests/LibWeb/Text/expected/video-failed-load.txt index 18af3d39d27..943960f61ce 100644 --- a/Tests/LibWeb/Text/expected/video-failed-load.txt +++ b/Tests/LibWeb/Text/expected/video-failed-load.txt @@ -1,3 +1,3 @@ failed to load: "data:" failed to load: "file:///i-do-no-exist-i-swear" -failed to load: "https://i-do-no-exist-i-swear.net.uk" +failed to load: "https://i-do-no-exist-i-swear.net.uk/" diff --git a/Tests/LibWeb/Text/input/input-image.html b/Tests/LibWeb/Text/input/input-image.html index 96b8ed1bb3b..b7d0e405846 100644 --- a/Tests/LibWeb/Text/input/input-image.html +++ b/Tests/LibWeb/Text/input/input-image.html @@ -9,7 +9,8 @@ return new Promise((resolve, reject) => { input.addEventListener("load", () => { - resolve(`${input.src} loaded`); + const filename = input.src.split('/').pop(); + resolve(`${filename} loaded`); }); input.addEventListener("error", () => { resolve(`${input.src} failed`); diff --git a/Tests/LibWeb/Text/input/usvstring-url-reflection.html b/Tests/LibWeb/Text/input/usvstring-url-reflection.html new file mode 100644 index 00000000000..5c56481ded0 --- /dev/null +++ b/Tests/LibWeb/Text/input/usvstring-url-reflection.html @@ -0,0 +1,28 @@ + + + diff --git a/Tests/LibWeb/Text/input/video-canceled-load.html b/Tests/LibWeb/Text/input/video-canceled-load.html index 2c1d94ee495..fd5aaa647d0 100644 --- a/Tests/LibWeb/Text/input/video-canceled-load.html +++ b/Tests/LibWeb/Text/input/video-canceled-load.html @@ -1,7 +1,7 @@