From 435c2c24d15bee8714750e89ba0de893fa7edc87 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 25 Feb 2024 10:54:37 -0500 Subject: [PATCH] LibWeb: Create a shadow tree for elements This creates a button to prompt users to select a file, and a label to show information about the selected file(s). Clicking either shadow element will activate the input element. --- Tests/LibWeb/Layout/expected/input-file.txt | 54 ++++++++++++++++++ Tests/LibWeb/Layout/input/input-file.html | 2 + Tests/LibWeb/Text/expected/input-value.txt | 2 +- Userland/Libraries/LibWeb/CSS/Default.css | 2 +- .../LibWeb/HTML/HTMLInputElement.cpp | 57 ++++++++++++++++++- .../Libraries/LibWeb/HTML/HTMLInputElement.h | 5 ++ 6 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 Tests/LibWeb/Layout/expected/input-file.txt create mode 100644 Tests/LibWeb/Layout/input/input-file.html diff --git a/Tests/LibWeb/Layout/expected/input-file.txt b/Tests/LibWeb/Layout/expected/input-file.txt new file mode 100644 index 0000000000..97611b25ea --- /dev/null +++ b/Tests/LibWeb/Layout/expected/input-file.txt @@ -0,0 +1,54 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline + BlockContainer at (8,8) content-size 784x21 children: inline + frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 236.65625x21] baseline: 13.296875 + frag 1 from TextNode start: 0, length: 1, rect: [245,8 8x17] baseline: 13.296875 + " " + frag 2 from BlockContainer start: 0, length: 0, rect: [253,8 255.34375x21] baseline: 13.296875 + BlockContainer at (8,8) content-size 236.65625x21 inline-block [BFC] children: inline + frag 0 from BlockContainer start: 0, length: 0, rect: [13,10 94.375x17] baseline: 13.296875 + frag 1 from Label start: 0, length: 0, rect: [116,8 128.28125x17] baseline: 13.296875 + BlockContainer