Commit Graph

57197 Commits

Author SHA1 Message Date
Andreas Kling
a2c3db8367 LibJS: Add basic support for module code with top-level await
For now, we handle this by creating a synthetic async function to wrap
the top-level module code. This allows us to piggyback on the async
function driver wrapper mechanism.
2023-12-06 12:58:04 +01:00
Andreas Kling
26c21fba8e LibJS: Use LoadRequestedModules in the ad-hoc module loading path
This ensures that modules go through the expected state transitions,
fixing hundreds of test262 tests.
2023-12-06 12:58:04 +01:00
Andreas Kling
d7005be768 LibJS: Update CyclicModule to match current spec
Just some minor comment tweaks and an updated assertion.
2023-12-06 12:58:04 +01:00
Timothy Flynn
7970f45953 Ladybird/AppKit: Implement "Copy Email/Phone" menu item for links 2023-12-05 14:20:03 -05:00
Timothy Flynn
fff65046a3 WebWorker: Do not prefix WebWorker include with "Services/"
We don't do this elsewhere and this breaks the GN build.
2023-12-05 14:20:03 -05:00
Karol Kosek
00e422fe1e LibAudio: Fix use-after-free in write_vorbis_comment 2023-12-05 13:57:18 -05:00
Nico Weber
4cb0593daf LibPDF: Convert LAB values to bytes differently
Gfx::ICC::Profile's current API takes bytes, so we need to do some
contortions for LAB values to go through.

This will probably become nicer once we implement all the backward
transforms in Gfx::ICC::Profile, but for now let's hack it in
on the LibPDF side.

Makes colors in 0000651.pdf looks good, especially on pages 1 and 7-12.
2023-12-05 11:36:44 -05:00
Sam Atkins
715d0bacdb Ladybird/Qt: Implement "Copy Email/Phone" menu item for links 2023-12-05 11:36:22 -05:00
Sam Atkins
53f9be4ea8 Browser: Implement "Copy Email/Phone" menu item for links 2023-12-05 11:36:22 -05:00
Sam Atkins
8d987aa9d6 Browser: Make "Copy URL" action's shortcut more consistent
"Copy &URL" matches what we do in LadybirdQt, and "Copy Image &URL".
2023-12-05 11:36:22 -05:00
Sam Atkins
c8247e5737 LibWebView: Add some helpers for "Copy email/telephone" functionality
Other browsers have a nice little feature where right-clicking on a
`mailto` or `tel` link will let you copy the email address or telephone
number, instead of the full URL. So let's do that!
2023-12-05 11:36:22 -05:00
Sam Atkins
db9a507f7f TextEditor: Give the --preview-mode argument a short version 2023-12-05 09:20:32 -05:00
Aliaksandr Kalenik
a88807e5b3 LibAccelGfx: Update scissor test after switching between painters
Since scissor clip rect is a part of OpenGL global state we need to
update it after switching between painters.
2023-12-05 10:29:55 +01:00
Nico Weber
72f5461af4 LibGfx/ICC: Implement forward transform for mft1 and mft2 tags
mft1 and mft2 tags are very similar. The only difference is that
mft1 uses an u8 lookup table, while mft2 uses a u16 lookup table.
This means their PCS lookup encodings are different, and mft2 uses a
PCSLAB encoding that's different from other places in the v4 spec.
2023-12-05 09:56:50 +01:00
Nico Weber
b138bc0004 LibGfx/ICC: Simplify lerp_1d() a bit
No behavior change.
2023-12-05 09:56:50 +01:00
Nico Weber
9372f6d726 LibGfx/ICC: Extract a lerp_1d() function
Pure code move, no behavior change.
2023-12-05 09:56:50 +01:00
Sam Atkins
4c4daf4a62 LibWeb: Add tests for background-position
The css-backgrounds.html ref test file only tests the most basic usage
of this, which failed to catch some regressions, so let's add a more
extensive test. :^)
2023-12-05 09:55:16 +01:00
Sam Atkins
ef48d967d4 LibWeb: Correct parsing of background-position 3-value syntax
There were two bugs here, one of which hid the other:
- Only one offset would have a value, but we dereferenced both.
- We consumed a token whether it was a valid offset or not.
2023-12-05 09:55:16 +01:00
Andreas Kling
20da5b6153 LibWeb: Remove an unnecessary (and unsafe) cast from Node to Element
Fixes #22170
2023-12-05 09:41:22 +01:00
Shannon Booth
0cb0d60ac5 LibWeb: Make BrowsingContextGroup & TraversableNavigable return a Page&
Removing another batch of uneeded null checks :^)
2023-12-05 09:38:32 +01:00
Shannon Booth
88f8ea7c60 LibWeb: Make BrowsingContex::page() return a Page&
This exposed a whole slew of now-unnecessary null checks. :^)

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-12-05 09:38:32 +01:00
Shannon Booth
af2bcc3b56 LibWeb: Remove Weakable from Web::Page
Nothing requires this any more.
2023-12-05 09:38:32 +01:00
Shannon Booth
fd7be22653 LibWeb: Make TraversableNavigable store Page member as NonnullGCPtr 2023-12-05 09:38:32 +01:00
Andreas Kling
bf4c8f4a09 LibWeb: Make BrowsingContext store Page member as NonnullGCPtr
No need to use WeakPtr anymore.

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-12-05 09:38:32 +01:00
Andreas Kling
7c926d04b7 LibWeb: Make BrowsingContextGroup store Page member as NonnullGCPtr
No need to use WeakPtr anymore.
2023-12-05 09:38:32 +01:00
Shannon Booth
289ea2db9c LibWeb: Make ImageRequest store Page member as NonnullGCPtr
Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-12-05 09:38:32 +01:00
Shannon Booth
d277ac72e6 LibWeb: Make SharedImageRequest store Page member as NonnullGCPtr
This allows us to remove one raw Web::Page& member. Or rather, it
becomes a JS::NonnullGCPtr that we trace like anything else. :^)

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-12-05 09:38:32 +01:00
Shannon Booth
0ae5c070c7 LibWeb: Make Web::Page GC-allocated
This is a first step towards removing the various Page& and Page*
we have littering the engine with "trust me bro" safety guarantees.

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-12-05 09:38:32 +01:00
Shannon Booth
6e6f3a9a8f LibWeb: Make Web::PageClient GC-allocated
This is a first step towards simplifying the ownership model of
Web::Page. Soon Web::Page will store its WebClient as a
NonnullGCPtr to help solve lifetime issues of the client being
destroyed before the page.
2023-12-05 09:38:32 +01:00
Aliaksandr Kalenik
5c0cd0f484 LibAccelGfx+LibWeb: Add text shadow support in GPU painter 2023-12-05 09:09:56 +01:00
Aliaksandr Kalenik
b5f9c1d003 LibWeb: Use glyph run to represent text in PaintTextShadow command
Given that we have a glyph run where the position of each glyph is
calculated for text fragments during layout, we can reuse it to avoid
this work during painting.
2023-12-05 09:09:56 +01:00
Andrew Kaster
9f01e0f826 WebWorker: Log URL and reason for Worker script load failure 2023-12-04 19:59:10 -05:00
Timothy Flynn
d81c531322 Meta: Explicitly list the Ladybird-related HTML files to bundle
As noted in the comment added here, we cannot just list the directory
containing these files.
2023-12-04 19:46:35 -05:00
Timothy Flynn
05c8d5ba57 Base+Ladybird: Move Ladybird-related HTML files to their own folder
Pages like the new tab page, error page, etc. all belong solely to
Ladybird, but are scattered across a couple of subfolders in Base. This
moves them all to Base/res/ladybird.
2023-12-04 19:46:35 -05:00
Bastiaan van der Plaat
980e32b4fe Ladybird/AppKit: Remove theme color changing background color 2023-12-04 14:56:03 -05:00
Bastiaan van der Plaat
2107ab823d LibWeb: Add basic HTML meter element support 2023-12-04 19:54:43 +00:00
Bastiaan van der Plaat
761d824b72 LibWeb: Add basic parse floating point number function 2023-12-04 19:54:43 +00:00
Bastiaan van der Plaat
3175557cb8 LibWeb: Update progressbar colors to be more pleasant 2023-12-04 19:54:43 +00:00
Bastiaan van der Plaat
4a7d3115c9 AK: Add String to number floating point support 2023-12-04 19:54:43 +00:00
Aliaksandr Kalenik
2361ce25a0 LibAccelGfx: Set blending for alpha separately to be sum of src and dst
With this change we match blending in LibGfx and it fixes rendering on
all websites that use opacity < 1.
2023-12-04 20:51:00 +01:00
Timothy Flynn
c55d8a9971 Ladybird/Qt: Make the Inspector widget owned by its parent tab
This ensures the Inspector is closed when the BrowserWindow which owns
the tab is closed.
2023-12-04 12:03:48 -07:00
Timothy Flynn
4653733a0d Ladybird/Qt: Do not "share" ownership of Qt objects
When a QObject subclass (widgets, etc.) are provided a parent, then
ownership of that object is passed to the parent. Similarly, objects
added to a QLayout are owned by the layout.

Thus, do not store these objects in an OwnPtr.
2023-12-04 12:03:48 -07:00
Timothy Flynn
a21998003c Ladybird/Qt: Make String allocation infallible 2023-12-04 12:03:48 -07:00
Timothy Flynn
82c827fc56 Ladybird/Qt: Support non-ASCII when converting a QString to a String
QString is UTF-16, thus QString::size returns the number of UTF-16 code
units. Thus, we would fail to perform, for example:

    ak_string_from_qstring(QString("😀"));

Which is 2 UTF-16 code units, but 4 UTF-8 code units.
2023-12-04 12:03:48 -07:00
Timothy Flynn
1aedb0ae5a Ladybird/Qt: Replace the QString-from-AK helpers with a single method
There's no need for 2 overloads for String and DeprecatedString, we can
just use a StringView. This also avoids some cases of needlessly
allocating a DeprecatedString from a StringView when calling this
method.
2023-12-04 12:03:48 -07:00
Timothy Flynn
4d5d282e6a Meta: Port recent changes to the GN build
64ffae9c55
2023-12-04 12:03:48 -07:00
Andrew Kaster
08cacea7d5 Documentation: Begin document on execution and navigation in LibWeb 2023-12-04 12:01:25 -07:00
Timothy Flynn
965bd00cf3 LibWebView: Avoid trying to break a schemeless URL into renderable parts 2023-12-04 14:47:09 +00:00
Timothy Flynn
65a9eae142 LibWebView: Draw some knurling on the draggable Inspector separator 2023-12-04 13:58:20 +01:00
dependabot[bot]
f1837eded9 CI: Bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 07:13:30 -05:00