Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick 29 ladybird PRs, and update GN build #25570

Merged
merged 36 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5b7e1f5
Meta: Update GN files after #25537
nico Dec 21, 2024
ee4f897
LibWeb/Storage: Return undefined for non-existent key/index access
BroadbentJim Oct 20, 2024
8c9b739
LibWeb: Fix infinite loop in `Storage::internal_own_property_keys`
yyny Oct 23, 2024
8046e6a
LibWeb: Remove LegacyOverrideBuiltIns flag from Storage
Lubrsi Nov 12, 2024
e878639
LibWeb: Remove a misleading duplicate comment in HTMLParser
jcs Nov 30, 2024
6d061f3
LibWeb: Stop allocating `Token`s and `ComponentValue`s unnecessarily
yyny Nov 30, 2024
84f4e2d
LibJS: Cache source code positions more often
yyny Dec 1, 2024
8aa9b85
LibWeb/CSS: Do not ignore self-start/self-end alignment in flex layout
milotier Dec 1, 2024
f062040
LibWeb: Do not normalize border radii containing their initial values
yyny Nov 30, 2024
18d00ed
UI/Qt: Fix hover_label hiding URLs
Sidicer Aug 24, 2024
058d3ed
Tests: Make test less flaky
Psychpsyo Nov 29, 2024
4b5f628
LibWeb: Remove :closed pseudo class
lukewarlow Dec 5, 2024
8efc228
LibWeb: Handle abort signal in CloseWatcher
FMMazur Dec 6, 2024
9f44f9e
LibCore: Do not include math.h in ArgsParser
shlyakpavel Dec 8, 2024
cdf5cac
LibCrypto: Use size_t integer literal
R-Goc Nov 21, 2024
5fead97
LibCrypto: DER.cpp use uz literals
R-Goc Nov 21, 2024
7a5635e
LibWasm: Respect instance.types() bounds
shlyakpavel Dec 8, 2024
1e0b3ad
LibWeb: Align mfrac Padding with Updated MathML Core Spec
shlyakpavel Dec 9, 2024
fe61a7b
LibWeb: Respect subarrays in Crypto#getRandomBytes
Lubrsi Dec 9, 2024
013f8b9
LibWeb/ARIA: Add missing `menuitemradio` widget role
Simek Dec 8, 2024
e0a4bb6
LibWeb: Update spec steps in Selection
gmta Dec 11, 2024
7198c3c
LibWeb: Layout standalone SVG document with specified dimensions
manuel-za Dec 5, 2024
e33ec07
LibWeb: Test layout of standalone SVG document: main use case
manuel-za Dec 6, 2024
d8654c3
LibWeb: Test layout of standalone SVG document: edge cases
manuel-za Dec 6, 2024
5e1de55
LibJS: Avoid internal assertion accessing detached TA internal slots
trflynn89 Dec 13, 2024
01f6e18
LibGC: Preallocate space before dumping GC graph
shlyakpavel Dec 13, 2024
383fb23
LibJS: Return the allocated dst register from deleting super properties
trflynn89 Dec 13, 2024
121da9a
LibWeb/CSS: Refactor phase() method to reduce redundancy
Areshkew Sep 11, 2024
f887303
LibWeb: Remove unused (Tree)Node::index_of_child()
gmta Dec 18, 2024
dfa1ae5
LibWeb: Resolve performance FIXME in Node::is_equal_node()
gmta Dec 18, 2024
bd983a2
LibWeb: Handle special cases of PseudoElement::Type correctly
Totto16 Dec 19, 2024
64ac2dc
LibWeb: Add test for getComputedStyle with a PseudoElement argument
Totto16 Dec 19, 2024
364bffd
LibCrypto: Protect the SignedBigInteger ctor against integer overflow
trflynn89 Dec 19, 2024
3144c4b
LibWeb: Update Location initialization according to spec
shlyakpavel Nov 30, 2024
67bad2d
LibWeb: Refer a spec issue in Location::internal_get_own_property
shlyakpavel Dec 9, 2024
fca07a6
LibWeb/CSS: Don't overwrite active font load when requesting a pt size
AtkinsSJ Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Ladybird/Qt/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ Tab::Tab(BrowserWindow* window, WebContentOptions const& web_content_options, St
m_toolbar = new QToolBar(this);
m_location_edit = new LocationEdit(this);

m_hover_label = new QLabel(this);
m_hover_label = new HyperlinkLabel(this);
m_hover_label->hide();
m_hover_label->setFrameShape(QFrame::Shape::Box);
m_hover_label->setAutoFillBackground(true);

QObject::connect(m_hover_label, &HyperlinkLabel::mouse_entered, [this] {
update_hover_label();
});

auto* focus_location_editor_action = new QAction("Edit Location", this);
focus_location_editor_action->setShortcut(QKeySequence("Ctrl+L"));
addAction(focus_location_editor_action);
Expand Down Expand Up @@ -862,12 +866,18 @@ void Tab::resizeEvent(QResizeEvent* event)

void Tab::update_hover_label()
{
m_hover_label->setText(QFontMetrics(m_hover_label->font()).elidedText(m_hover_label->text(), Qt::ElideRight, width() / 2 - 10));
m_hover_label->resize(QFontMetrics(m_hover_label->font()).boundingRect(m_hover_label->text()).adjusted(-4, -2, 4, 2).size());
auto hover_label_height = height() - m_hover_label->height() - 8;

auto hover_label_height = height() - m_hover_label->height();
if (m_find_in_page->isVisible())
hover_label_height -= m_find_in_page->height() - 4;
hover_label_height -= m_find_in_page->height();

if (m_hover_label->underMouse() && m_hover_label->x() == 0)
m_hover_label->move(width() / 2 + (width() / 2 - m_hover_label->width()), hover_label_height);
else
m_hover_label->move(0, hover_label_height);

m_hover_label->move(6, hover_label_height);
m_hover_label->raise();
}

Expand Down
21 changes: 20 additions & 1 deletion Ladybird/Qt/Tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ namespace Ladybird {
class BrowserWindow;
class InspectorWidget;

class HyperlinkLabel final : public QLabel {
Q_OBJECT

public:
explicit HyperlinkLabel(QWidget* parent = nullptr)
: QLabel(parent)
{
setMouseTracking(true);
}

virtual void enterEvent(QEnterEvent* event) override
{
emit mouse_entered(event);
}

signals:
void mouse_entered(QEnterEvent*);
};

class Tab final : public QWidget {
Q_OBJECT

Expand Down Expand Up @@ -114,7 +133,7 @@ public slots:
FindInPageWidget* m_find_in_page { nullptr };
BrowserWindow* m_window { nullptr };
QString m_title;
QLabel* m_hover_label { nullptr };
HyperlinkLabel* m_hover_label { nullptr };
QIcon m_favicon;

QMenu* m_context_menu { nullptr };
Expand Down
1 change: 1 addition & 0 deletions Ladybird/Qt/WebContentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ void WebContentView::mouseMoveEvent(QMouseEvent* event)
}

enqueue_native_event(Web::MouseEvent::Type::MouseMove, *event);
QWidget::mouseMoveEvent(event);
}

void WebContentView::mousePressEvent(QMouseEvent* event)
Expand Down
3 changes: 2 additions & 1 deletion Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ shared_library("LibGfx") {
"Font/WOFF/Font.cpp",
"Font/WOFF2/Font.cpp",
"FontCascadeList.cpp",
"GlassWindowTheme.cpp",
"GradientPainting.cpp",
"ICC/BinaryWriter.cpp",
"ICC/Enums.cpp",
Expand Down Expand Up @@ -108,6 +109,7 @@ shared_library("LibGfx") {
"Palette.cpp",
"Path.cpp",
"PathClipper.cpp",
"PlasticWindowTheme.cpp",
"Point.cpp",
"Rect.cpp",
"ShareableBitmap.cpp",
Expand All @@ -118,7 +120,6 @@ shared_library("LibGfx") {
"TextLayout.cpp",
"Triangle.cpp",
"VectorGraphic.cpp",
"WindowTheme.cpp",
]

sources += get_target_outputs(":generate_tiff_sources")
Expand Down
11 changes: 11 additions & 0 deletions Tests/LibCrypto/TestBigInteger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,17 @@ TEST_CASE(test_negative_zero_is_not_allowed)
EXPECT(!zero.is_negative());
}

TEST_CASE(test_i32_limits)
{
Crypto::SignedBigInteger min { AK::NumericLimits<i32>::min() };
EXPECT(min.is_negative());
EXPECT(min.unsigned_value().to_u64() == static_cast<u32>(AK::NumericLimits<i32>::max()) + 1);

Crypto::SignedBigInteger max { AK::NumericLimits<i32>::max() };
EXPECT(!max.is_negative());
EXPECT(max.unsigned_value().to_u64() == AK::NumericLimits<i32>::max());
}

TEST_CASE(double_comparisons)
{
#define EXPECT_LESS_THAN(bigint, double_value) EXPECT_EQ(bigint.compare_to_double(double_value), Crypto::UnsignedBigInteger::CompareResult::DoubleGreaterThanBigInt)
Expand Down
18 changes: 18 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone-h.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 128x600 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (0,172) content-size 128x256 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,172) content-size 128x256 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,172) content-size 128x256 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 128x600]
SVGPathPaintable (SVGGeometryBox<rect>) [0,172 128x256]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,172 128x256]
SVGPathPaintable (SVGGeometryBox<path>) [0,172 128x256]

18 changes: 18 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone-vb-h.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 128x600 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,0) content-size 32x64 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 128x600]
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 32x64]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,0 32x64]
SVGPathPaintable (SVGGeometryBox<path>) [0,0 32x64]

18 changes: 18 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone-vb-w.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 800x256 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,0) content-size 32x64 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 800x256]
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 32x64]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,0 32x64]
SVGPathPaintable (SVGGeometryBox<path>) [0,0 32x64]

18 changes: 18 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone-vb-wh.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 800x600 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,0) content-size 32x64 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 800x600]
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 32x64]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,0 32x64]
SVGPathPaintable (SVGGeometryBox<path>) [0,0 32x64]

18 changes: 18 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone-vb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 128x256 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,0) content-size 32x64 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 128x256]
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 32x64]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,0 32x64]
SVGPathPaintable (SVGGeometryBox<path>) [0,0 32x64]

18 changes: 18 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone-w.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 800x256 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (336,0) content-size 128x256 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (336,0) content-size 128x256 children: inline
TextNode <#text>
SVGGeometryBox <path> at (336,0) content-size 128x256 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 800x256]
SVGPathPaintable (SVGGeometryBox<rect>) [336,0 128x256]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [336,0 128x256]
SVGPathPaintable (SVGGeometryBox<path>) [336,0 128x256]

18 changes: 18 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone-wh.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 800x600 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (250,0) content-size 300x600 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (250,0) content-size 300x600 children: inline
TextNode <#text>
SVGGeometryBox <path> at (250,0) content-size 300x600 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 800x600]
SVGPathPaintable (SVGGeometryBox<rect>) [250,0 300x600]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [250,0 300x600]
SVGPathPaintable (SVGGeometryBox<path>) [250,0 300x600]

17 changes: 17 additions & 0 deletions Tests/LibWeb/Layout/expected/svg/standalone.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 128x256 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (0,0) content-size 128x256 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,0) content-size 128x256 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,0) content-size 128x256 children: not-inline
TextNode <#text>
TextNode <#text>

ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 128x256]
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 128x256]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,0 128x256]
SVGPathPaintable (SVGGeometryBox<path>) [0,0 128x256]
7 changes: 7 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone-h.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone-vb-h.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone-vb-w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone-vb-wh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone-vb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone-w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone-wh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Tests/LibWeb/Layout/input/svg/standalone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
width: 100px;
height: 100px;
background-color: blue;
animation: anim 1s;
animation: anim 100s;
}
@keyframes anim {
from {
Expand All @@ -18,5 +18,5 @@
</style>
<div id="foo"></div>
<script>
document.getElementById("foo").getAnimations()[0].currentTime = 500;
document.getElementById("foo").getAnimations()[0].currentTime = 50_000; // 50 seconds
</script>
3 changes: 0 additions & 3 deletions Tests/LibWeb/Ref/css-open-closed-selectors.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
:open {
color: green;
}
:closed {
color: red;
}
</style>
<details open>
<summary>Hi</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
.open {
color: green;
}
.closed {
color: red;
}
</style>
<details open class="open">
<summary>Hi</summary>
Well hello friends!
</details>
<details class="closed">
<details>
<summary>Hi</summary>
Well hello friends!
</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
false
false
2 changes: 2 additions & 0 deletions Tests/LibWeb/Text/expected/CloseWatcher-already-aborted.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
false
false
2 changes: 2 additions & 0 deletions Tests/LibWeb/Text/expected/CloseWatcher-fire-once.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Is first 2 bytes still 0x41? true
Is last 6 bytes still 0x41? true
Loading