Commit graph

63822 commits

Author SHA1 Message Date
Andreas Kling
fcc40ca35f LibWeb: Stub out SVGGraphicsElement.getScreenCTM()
This allows us to run Speedometer 3.0 to completion. :^)

(cherry picked from commit 72320be1240039822693aa1659c4adbb24cde87f)
2024-11-11 09:17:08 -05:00
Shannon Booth
7816e173fa LibJS: Update comments for WrappedFunction [[Call]] implementation
(cherry picked from commit 01c2ecf355868f7c8d3d757488e7d20b039fcc61)
2024-11-11 09:14:29 -05:00
Shannon Booth
4696edae82 LibJS: Return void from SetDefaultGlobalBindings
Aligning with spec change:

https://github.com/tc39/ecma262/commit/052def
(cherry picked from commit b5536db915623908f2f7488ab32793ba8f4e2b31)
2024-11-11 09:14:29 -05:00
Shannon Booth
70bc70acb0 LibJS: Inline somes AO's into InitializeHostDefinedRealm
Aligning with the editorial change in the spec of:

https://github.com/tc39/ecma262/commit/977a6c
(cherry picked from commit 0a1c9e4038dddbe0078e7c0ef82d8374b928bde1)
2024-11-11 09:14:29 -05:00
Shannon Booth
e1e4b50a9c LibWeb: Put setting object's promise's in WindowOrWorkerGlobalScope
This aligns with an update to the HTML specification which instead
stores these promises on the global object instead of the settings
object.

It also makes progress towards implementing the ShadowRealm proposal
as these promises are not present in the 'synthetic' realm for that
proposal.

(cherry picked from commit 1096b6493668724ff9776929339e40b33213f410)
2024-11-11 09:14:29 -05:00
Shannon Booth
ab6418f5a0 LibJS: Allow host to create ShadowRealm global object
This implements the proposed update to the ShadowRealm proposal for
integrating the ShadowRealm specification into the web platform.

(cherry picked from commit d1fc76bffdafe5a057c0da5855d9d643608bd726)
2024-11-11 09:14:29 -05:00
Shannon Booth
108ffa8eee LibJS: Initialize ShadowRealm internal slots through setters
This allows us to align our implementation in the same order as the
specification.

No functional change with the current implementation of this AO.

However, this change is required in order to correctly implement a
proposed update of the shadow realm proposal for integration with
the HTML spec host bindings in order to give the ShadowRealm
object the correct 'intrinsic' realm.

This is due to that proposed change adding a step which manipulates the
currently executing Javascript execution context, making the ordering
important.

(cherry picked from commit 0ec8af5b70702e9ee2edc7269c103fa49e6987c1)
2024-11-11 09:14:29 -05:00
Sönke Holz
03a59014b9 Meta: Add the PrekernelPEImageGenerator tool
This tool will be used to convert the Prekernel into an EFI PE32+ image.
2024-11-11 09:06:40 -05:00
Sönke Holz
eaa729c58a Meta: Make LibELF available to Lagom tools
This will be required for the PrekernelPEImageGenerator lagom tool.
2024-11-11 09:06:40 -05:00
Sönke Holz
56881cf37c LibELF: Add accessors for some header fields to ELF::Image 2024-11-11 09:06:40 -05:00
Sönke Holz
03c74dcb11 LibELF: Remove the unused Image::Section::relocations function
This function assumes that all sections have a relocation section
associated with them. This is not the case in most executables.
It also assumes that the section is called ".rel<section name>". This is
also not something we should rely on. And RELA sections usually start
with ".rela", not ".rel".
2024-11-11 09:06:40 -05:00
Sönke Holz
82e902526c LibELF: Add RELA support to ELF::Image
Only DynamicObject supported RELA previously.
2024-11-11 09:06:40 -05:00
samu698
a37e4092bc LibWeb/HTML: Implement inner text set according to spec
Replaced the ad-hoc implementation with a spec compliant one.
This change fixes 36 WPT tests.

(cherry picked from commit 50f642613de54c73473c216fdc4d7e607e712679)
2024-11-10 21:48:40 -05:00
Bastian Müller
da3b916ba3 LibWeb/XHR: Pass API URL character encoding
(cherry picked from commit 748e3c2e6c680fa78b24d7a2643fe79b234943d6)
2024-11-10 21:48:40 -05:00
Bastian Müller
62894c9d3f LibWeb/XHR: Parse URL to resolve blob
(cherry picked from commit 3be93ac49fc93b905b5466896605c3375835c97c)
2024-11-10 21:48:40 -05:00
Shannon Booth
b901a8753d LibWeb: Allow splitting surrogate pairs in CharacterData.substringData()
(cherry picked from commit b999f925dcfb0417c534e1a21aa74626a06b466b)
2024-11-10 21:48:40 -05:00
rmg-x
f30aed2e08 LibWeb/HTML: Check if evaluationStatus has a value before dereferencing
Previously, we would crash if scripting was disabled and a javascript
URL was evaluated.

(cherry picked from commit 57f82c029c1f66c516650d96c176ba0f47da0f78)
2024-11-10 21:48:40 -05:00
Andreas Kling
880b6b1375 LibWeb: Stop traversal early when marking nodes for child style update
These flags always propagate to the root, so once we encounter an
ancestor with the flag set, we can stop traversal since everything above
it will already be set as well.

(cherry picked from commit f106aa9e8a8f3a98b498e0f9324123963fad6ca2)
2024-11-10 21:48:40 -05:00
Andreas Kling
72227066c6 LibWeb: Avoid a weird reparse of style attributes for pseudo elements
For pseudo elements that represent a browser-generated shadow tree
element, such as ::placeholder, we were reparsing their style attribute
in StyleComputer for some reason.

Instead of doing this, just access the already-parsed version via
Element::inline_style().

(cherry picked from commit d21c5631aa5d3bebcf828e893f0d7da031481894)
2024-11-10 21:48:40 -05:00
sideshowbarker
7e9c2bd36f Meta: Add script for checking WebIDL files
This adds a new script for linting WebIDL files, and adds it to the set
of scripts Meta/lint-ci.sh runs. Initially, this script does just one
thing: normalizes IDL definition lines so they start with four spaces.

(cherry picked from commit a7578164d4ea2aa6e7831d83e9a55b1ff39e37f7;
minorly amended to resolve conflict in lint-ci.sh due to serenity still
having check-emoji.py and check-markdown.sh)
2024-11-10 21:19:33 -05:00
sideshowbarker
8c9acd4a76 LibWeb: Normalize all WebIDL definition lines to four leading spaces
This change takes all existing WebIDL files in the repo that had
definition lines without four leading spaces, and fixes them so they
have four leading spaces.

(cherry picked from commit 51528ec6779202747cc3b99d3b77772a124a0b47)
2024-11-10 21:19:33 -05:00
Andreas Kling
c2d89a02c7 LibWeb: Check for active document in descendant_navigables()
This is not in the spec, but I did see a null pointer dereference here
while browsing the web, and it seems completely harmless for this
function to skip over navigables without an active document.

(cherry picked from commit 56e1c0e7eec813c311c41696063a3a31b4b14f0d)
2024-11-10 20:06:23 -05:00
Andreas Kling
0897967771 LibWeb: Recompute targetStep during "apply the history step"
This is an ad-hoc change to account for the fact that we may run
arbitrary code while waiting for the tasks in this function to complete.

I don't have a way to reproduce it, but I've seen trouble caused by
navigables disappearing, which causes the history step numbers to be
disturbed.

(cherry picked from commit ac48222ed7b497b13343ec79a234ba432ffd29e2)
2024-11-10 20:06:23 -05:00
Timothy Flynn
999f7c5eb5 LibCore: Ensure shared memory file names on macOS are unique
At least on my mac, clock_gettime only provides millisecond resolution.
So if many WebContent processes are opened at once, it is not unlikely
that they will all create their backing stores within the same ms. When
that happens, all but the first will fail (and crash).

To prevent this, generate the shared memory file name based on the PID
and a static counter.

(cherry picked from commit 5056bda043984953685bb4284fc698ab42418045)
2024-11-10 20:06:23 -05:00
Andreas Kling
e715c973cc LibWebView: Update User-Agent spoofing strings with new versions
Also use an OrderedHashMap so they show up in the same order in UI.

(cherry picked from commit a2a9a11466aba1ab357922e8bd0338222e3f4179)
2024-11-10 20:06:23 -05:00
Andreas Kling
63f1877f4a LibTLS: Put debug spam about loaded certificates behind TLS_DEBUG
(cherry picked from commit fce4739d3eab2c88e432c74590a3cc200664a392)
2024-11-10 20:06:23 -05:00
Andreas Kling
3590a94fc4 LibJS: Don't leak class field initializers
We were storing these in Handle (strong GC roots) hanging off of
ECMAScriptFunctionObject which effectively turned into world leaks.

(cherry picked from commit 5aa1d7837fe37dd203763178df3325ff8b24abbd)
2024-11-10 19:39:05 -05:00
Andreas Kling
1b6c784b77 LibCore: Don't reserve 2 KiB of stack memory when processing event queue
The inline capacity on ThreadEventQueue::Private::queued_events caused
us to reserve (and importantly, not initialize!) 2 KiB of stack memory
when entering ThreadEventQueue::process().

This was causing any leftover pointers to GC-allocated objects within
that memory range to keep those objects alive, even when all other
references were gone.

(cherry picked from commit 8c809fa5ee52903921191db91dce432b8a62dd01)
2024-11-10 19:39:05 -05:00
Andreas Kling
f670b2ca32 AK: Use getrlimit() to find the correct main thread stack size on macOS
This is what JavaScriptCore does as well.

(cherry picked from commit 11458f0d91654feed9b4e225c4e6ac8528057355)
2024-11-10 19:39:05 -05:00
Andreas Kling
c00dda5a3a WebContent: Try to run manual GC with less stuff on the stack
This makes it more likely to succeed in collecting stuff that's actually
dead, by reducing the memory range scanned for possible pointers.

(cherry picked from commit 1510c1876c023de977bf5b028672e61336761176)
2024-11-10 19:39:05 -05:00
Andreas Kling
ad4abc1818 UI/AppKit: Make "Dump GC Graph" menu action actually work again
This was originally implemented as a debug request, but later changed.
The Qt UI already did the right thing, so just copy the logic over.

(cherry picked from commit 08ae305dc5a621233b2d329581969899efbb1195)
2024-11-10 19:39:05 -05:00
Shannon Booth
23ff912009 LibJS: Allow unpaired surrogates in String.prototype.replace
This was resulting in a crash for the WPT test case:

https://wpt.live/xhr/send-data-string-invalid-unicode.any.html
(cherry picked from commit e02ca0480f7d39ff79fde59df024df9b53fe945e)
2024-11-10 19:39:05 -05:00
Shannon Booth
fdeeac157c LibJS: Implement Error.isError
Implementing the stage 2.7 proposal:

https://github.com/tc39/proposal-is-error
(cherry picked from commit e4891af9709c7f604a5118c341f99bc9f19d72a9)
2024-11-10 19:39:05 -05:00
Jelle Raaijmakers
b471972353 UI/Qt: Enable basic IME keyboard input for WebContentView
This makes dead keys work (e.g. typing ' and e results in é).

(cherry picked from commit 7e57cc7b090455e93261c847064f12a61d686ff3)
2024-11-10 18:24:10 -05:00
Jamie Mansfield
603f66017a Ladybird/Qt: Don't change to new tab with 'Open in New Tab'
It now just opens a new tab, without changing the current tab.

(cherry picked from commit df34ee058b1285d31386ee973f056d56f13d7bf6)
2024-11-10 18:24:10 -05:00
Jamie Mansfield
088c42ab6e Ladybird/Qt: Display ampersands in tab titles
Qt reads ampersands as shortcut keys, so this escapes them (with &&) so
they display correctly :^)

(cherry picked from commit 6133707df88d0b6e2e9eb62797658c1a88380a07)
2024-11-10 18:24:10 -05:00
Gasim Gasimzada
696021e252 LibJS: Set configurable toStringTag property for console
(cherry picked from commit c5b8e75204cb1603e2470e6cfeee3f2161a49b91)
2024-11-10 18:24:10 -05:00
Diego Frias
ffddf008d9 LibWasm: Ensure correct section ordering when parsing binary modules
There are (currently) no spec-tests ensuring that section ordering is
enforced, but it _is_ a part of the spec. A pull request to add this to
the specification testsuite has been opened at WebAssembly/spec#1775.

(cherry picked from commit c58665332ed588926e029d97f79b78da9a28514a)
2024-11-10 18:24:10 -05:00
Tim Ledbetter
736255ae87 LibWeb: Avoid division by zero in SourceSet width descriptor calculation
(cherry picked from commit 087d4004721193c290b18515e90b047192880a70)
2024-11-10 18:24:10 -05:00
Andrew Kaster
b58fb57a2c LibGfx: Use more Span methods in BitmapSequence instead of memcpy
And a few assorted cleanups to use more moves() to avoid copying Vectors
and NonnullRefPtrs.

(cherry picked from commit 1322a7e91794893755ae5a3510241e74d45720c5)
2024-11-10 17:42:37 -05:00
Tim Ledbetter
362d3a4b3a WebContent: Return errors from unimplemented WebDriver endpoints
Previously, some otherwise unimplemented WebDriver endpoints were
indicating that they had executed successful, this was causing a large
number of Web Platform Tests to time out when they should have failed.

(cherry picked from commit 8939ae8522419c3b7214884dad0b14839d5fa3b3)
2024-11-10 17:42:37 -05:00
Timothy Flynn
26551f6700 LibWeb: Always call document.close after document.write
This ensures the HTML parser completes running if it previously stopped
at an insertion point during a call to `document.write`.

(cherry picked from commit 230314238655204b89dd0736da4537b475eb252a)
2024-11-10 17:42:37 -05:00
sideshowbarker
c11cf1f5aa LibWeb: Replace tabs with 4 spaces in ARIAMixin.idl
Also, remove blank lines. (https://w3c.github.io/aria/#ARIAMixin source
doesn’t have any blank lines, and it’s not clear that the blank lines in
ours follow any intended structure/logic.)

(cherry picked from commit 0601216ac450402435c0e49276cb9ee5b5a96b27)
2024-11-10 17:42:37 -05:00
rmg-x
743a0ed2e1 LibWeb: Add log_filtered_request() method in ResourceLoader
This will reduce log noise when visiting sites
that have a lot of filtered content.

Previously, red error text would be displayed in
the logs for each filtered URL.

(cherry picked from commit ae983a2ef7cfc28dce0c954b308c79ceb25deece)
2024-11-10 17:42:37 -05:00
Nathan E. Egge
12ce47ec71 LibTimeZone: Remove AK_OS_SERENITY ifdef
Remove special case for SerenityOS as fallback will still work.

(cherry picked from commit b040e5c12bd5f7b6596f8b4765ee662a5add3611)
2024-11-10 16:04:55 -05:00
Nathan E. Egge
8a2d4103f3 LibTimeZone: Read /etc/timezone for current TZ
Fallback to reading /etc/timezone by calling system_time_zone() when
unable determine time zone from /etc/localtime.
This works on systems where /etc/localtime is a file and not a symlink.

Fixes #65

(cherry picked from commit d83ab035ee0179ee3af308fff2f36ad6d6f6d3ba)
2024-11-10 16:04:55 -05:00
Ali Mohammad Pur
9d11d82e2c Meta+Toolchain: Move the jakt runtime files into the Toolchain build dir
These files are all static libs and source code, and aren't needed to be
present at runtime inside the image.
2024-11-10 19:22:14 +01:00
Ali Mohammad Pur
352f879993 Shell: Add the 'command' builtin 2024-11-10 19:22:14 +01:00
Nico Weber
c4bbc08c2c Meta: Add TextTrackCue{,List}, VTT{Cue,Region} to GN build 2024-11-10 10:46:01 -05:00
Kemal Zebari
9714e98dc9 LibWeb/MimeSniff: Update the MIME type sniffing algo to meet specs
The spec moved/added the xml and html checks to the beginning and
removed sniffing resource feeds.

(cherry picked from commit b8a5e18a016dc32ba065417a4d6d32bbc03f101d)
2024-11-10 10:46:01 -05:00