Commit graph

56937 commits

Author SHA1 Message Date
Stephan Vedder
2732dd3633 LibVideo: Fix string reading in Matroska
A string should never be longer than it's strlen according to
the specification
2023-11-30 08:53:05 +00:00
Stephan Vedder
1f55cc942d LibVideo: Add the concept of codec identifiers
This is required for detecting which decoder should be used.
Only a small subset of codecs identifiers is added for now
2023-11-30 08:53:05 +00:00
Timothy Flynn
ff48b7333c LibWeb: Remove shadow roots from elements that are removed from the DOM
We currently create a shadow tree once for each DOM element that renders
with a shadow tree (e.g. <input>, <details>). If such an element is
removed from the DOM, we must remove its shadow tree. Otherwise, the
shadow tree will refer to the old document in perpetuity.

If the node is added back to a DOM, then recreate the shadow tree.
2023-11-30 08:49:15 +00:00
Timothy Flynn
3cde479416 LibWeb: Add missing visitations to DOM::Document 2023-11-30 08:49:15 +00:00
Timothy Flynn
5913efbb45 LibWeb: Add a visit_edges() override to AbstractBrowsingContext
AbstractBrowsingContext has a subclass RemoteBrowsingContext without a
visit_edges() override (and it doesn't really need one). But currently,
we rely on subclasses visiting AbstractBrowsingContext's opener BC.

This adds a visit_edges() to AbstractBrowsingContext to explicitly visit
the opener BC itself.
2023-11-30 08:49:15 +00:00
Timothy Flynn
b54786ee95 LibJSGCVerifier: Use more general shebang line and clarify instructions
My system's python3 is not in /bin/.

The README did not indicate that a clang-toolchain build of Serenity is
required, so this patch adds that explicit instruction.
2023-11-30 08:49:15 +00:00
Andrew Kaster
0104c8d052 LibWeb: Handle window.open() when passed a navigable name 2023-11-29 23:07:37 +01:00
Kenneth Myhra
e3f5bbcbbe Tests/LibWeb: Move existing XHR Text tests in under the XHR folder 2023-11-29 21:51:35 +01:00
Kenneth Myhra
3d86e16407 Tests/LibWeb: Verify instantiation behavior of Blob w/empty constructor
This verifies that a Blob instantiated with an empty constructor creates
a Blob with Blob.size equal to 0 and Blob.type equal to "".
2023-11-29 21:51:35 +01:00
Kenneth Myhra
36fddab68e Tests/LibWeb: Verify XHR.response is an instance of Blob
This verifies that XHR.response is an instance of Blob when
XHR.responseType is set to 'blob'.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
09487679eb Tests/LibWeb: Verify XHR.response is an instance of Document
This verifies that XHR.response is an instance of Document when
XHR.responseType is set to 'document' and the response contains HTML.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
990f73708d Tests/LibWeb: Verify XHR.response is an instance of ArrayBuffer
This verifies that XHR.response is an instance of ArrayBuffer when
XHR.responseType is set to 'arraybuffer'.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
68fa8f52b4 Tests/LibWeb: Verify XHR.open() throws on forbidden method
This verifies that XHR.open() throws a Security Error when 'CONNECT',
'TRACE', or 'TRACK' is passed as the method argument.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
eb6a7ccc59 Tests/LibWeb: Verify XHR.open() throws on illegal token in method arg
This verifies that XHR.open() throws a Syntax Error if an illegal token
is passed to the method argument.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
ff05f19c84 Tests/LibWeb: Verify XHR.send() throws when called twice
This verifies that XHR.send() throws an Invalid State Error when called
twice.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
ac82585ae7 Tests/LibWeb: Verify XHR.send() throws when XHR.readyState is UNSENT
This verifies that an Invalid State Error is being thrown when
XHR.open() has not been called before calling XHR::send().
2023-11-29 21:51:35 +01:00
Aliaksandr Kalenik
7a0191cbe9 LibWeb: Clear texture allocated for stacking context painting
In OpenGL newly allocated texture has undefined initial state so we
need to clear it before stacking context painting.
2023-11-29 21:49:23 +01:00
Aliaksandr Kalenik
24da32c884 LibAccelGfx+LibWeb: Store state of all stacking contexts in GPU painter
This change ensures that the GPU painting executor follows the pattern
of the CPU executor, where the state is stored for each stacking
context, but a painter is created only for those with opacity.

Fixes crashing on apple.com because now save() and restore() are called
on correct painters.
2023-11-29 21:48:47 +01:00
Aliaksandr Kalenik
9a66f31b64 LibAccelGfx: Deallocate VAO and VBOs in fill_rect_with_linear_gradient
Fixes memory leak in fill_rect_with_linear_gradient()
2023-11-29 21:47:43 +01:00
Michiel Visser
495b0f2bcc LibTLS: Improve message when root certificate is invalid
Currently there is one root certificate which has expired, but it does
not have a common name, so we are simply printing "Certificate for  by
is invalid, ...", which is less than useful. Instead we just print the
complete subject now, and remove printing the issuer, as root
certificates are always self-signed.
2023-11-29 18:17:14 +03:30
Michiel Visser
000f0274e2 LibCrypto: Fix SECP384r1 verification when hash is SHA256
Some websites actually provide a SECP384 certificate which is signed
using a SHA256 hash. We assumed that SECP384 always used a SHA384 hash,
but this is not the case.
2023-11-29 18:17:14 +03:30
Timothy Flynn
6eadf4a778 LibWebView: Remove now-unused PropertyTableModel 2023-11-29 13:56:35 +01:00
Timothy Flynn
5fcb3dfb2c LibWebView: Remove now-unused callback to override property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
cd0f5087a7 Ladybird/AppKit: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
b5d5e48ffc Ladybird/Qt: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
0037fdaf11 Browser: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
ad9dfffda7 LibWebView: Support generating property tables in the Inspector
Since all chromes currently show their own tables, this is opt-out until
they are updated to use the WebView tables.
2023-11-29 13:56:35 +01:00
Timothy Flynn
6fc189ea4a LibWebView: Generalize the generated Inspector for another tab container
The Inspector will have a split view, where the top view is that of the
exisiting DOM and accessibility trees, and the bottom view is that of
the currently inspected node's style properties. This patch generalizes
some of the generated code to support having these 2 views.
2023-11-29 13:56:35 +01:00
Timothy Flynn
2891633877 Meta: Port recent changes to the GN build
9836a9ad0e
bc9cdd4394
28723d8be1
f4a5c136c3
2023-11-29 13:56:35 +01:00
Aliaksandr Kalenik
707added91 LibAccelGfx: Premultiply linear gradient colors by alpha
With this change color blending for gradients matches CPU painter.
2023-11-29 13:53:23 +01:00
Andreas Kling
be8952b89d LibJS: Remove pointless Vector copy in FDI 2023-11-29 09:48:18 +01:00
Andreas Kling
aaa7b50f06 LibJS: Skip lexical declaration traversal in FDI if there are none 2023-11-29 09:48:18 +01:00
Andreas Kling
3b6785245f LibJS: Don't call shrink_to_fit() on same environment twice in FDI 2023-11-29 09:48:18 +01:00
Andreas Kling
3fc0333ee6 LibJS: Put Bytecode::CallFrame + register slots in a single allocation
The number of registers in a call frame never changes, so we can
allocate it at the end of the CallFrame object and save ourselves the
cost of allocating separate Vector storage for every call frame.
2023-11-29 09:48:18 +01:00
Andreas Kling
3dc5f467a8 LibJS: Always allocate ExecutionContext objects on the malloc heap
Instead of allocating these in a mixture of ways, we now always put
them on the malloc heap, and keep an intrusive linked list of them
that we can iterate for GC marking purposes.
2023-11-29 09:48:18 +01:00
Andreas Kling
845da3901d LibJS: Make ExecutionContext::function_name a GCPtr<PrimitiveString>
This required setting things up so that all function objects can plop
a PrimitiveString there instead of an AK string.

This is a step towards making ExecutionContext easier to allocate.
2023-11-29 09:48:18 +01:00
Andreas Kling
eda2a6d9f7 LibJS: Don't die when making PrimitiveString from "" DeprecatedFlyString 2023-11-29 09:48:18 +01:00
Andreas Kling
ecfcc9aef3 LibJS: Make Bytecode::Executable GC-allocated
This is a step towards making ExecutionContext easier to allocate.
2023-11-29 09:48:18 +01:00
Andreas Kling
ece961f882 LibJS: Pass call/construct argument lists as ReadonlySpan<Value>
(Instead of MarkedVector<Value>.) This is a step towards not storing
argument lists in MarkedVector<Value> at all. Note that they still end
up in MarkedVectors since that's what ExecutionContext has.
2023-11-29 09:48:18 +01:00
Aliaksandr Kalenik
9fa6628efa LibWeb: Apply stacking context transform in GPU painter 2023-11-29 09:48:10 +01:00
Lucas CHOLLET
aaf54f8cf8 AK: Allow Optional<T&> to be constructed by OptionalNone()
This is an extension of cc0b970d but for the reference-handling
specialization of Optional.

This basically allow us to write code like:
```cpp
Optional<u8&> opt;
opt = OptionalNone{};
```
2023-11-29 02:19:41 +03:30
Shannon Booth
d777b279e3 LibUnicode+Tests: Remove now unused to_unicode_*_full methods
Relocating all of the tests for these in LibUnicode over to the AK
String testsuite.
2023-11-28 17:15:27 -05:00
Shannon Booth
d1ed04a6cb FontEditor: Use String.to_uppercase
Remove the last user of Unicode::to_unicode_uppercase_full
2023-11-28 17:15:27 -05:00
Shannon Booth
96af80acd1 LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
Shannon Booth
9cd36839d2 LibWeb: Port DOMStringMap from DeprecatedString to String
Porting name to FlyString as it is often compared in lookup, and in many
cases, we already have a FlyString to supply anyway.
2023-11-28 17:15:27 -05:00
Shannon Booth
49a48fcfac LibWeb: Port CrossOriginOpenerPolicy from DeprecatedString
Noone is using the members yet, so this is straight forward!
2023-11-28 17:15:27 -05:00
Shannon Booth
1b05598cd3 LibWeb: Port ParsedCookie from DeprecatedString to String 2023-11-28 17:15:27 -05:00
Shannon Booth
f43313d099 LibWeb: Port LegacyPlatformObject from DeprecatedString to String 2023-11-28 17:15:27 -05:00
Shannon Booth
56d10bf198 LibWeb: Port Layout::TextNode from DeprecatedString 2023-11-28 17:15:27 -05:00
Shannon Booth
6b32a1f18f AK+LibUnicode: Expose TrailingCodePointTransformation in to_titlecase
Relocating the definition of this enum from LibUnicode to AK.
2023-11-28 17:15:27 -05:00