Commit Graph

55965 Commits

Author SHA1 Message Date
Simon Wanner
112eadc863 LibJS/JIT: Annotate disassembly with bytecode information 2023-10-31 07:07:17 +01:00
Simon Wanner
9f78e56823 LibJS/JIT: Record machine code location to bytecode location mapping 2023-10-31 07:07:17 +01:00
Timothy Flynn
cf93e56833 headless-browser: Use LibWebView to sanitize input URLs
Remove the ad-hoc sanitization in favor of LibWebView. This was missed
after commit 191e20d639.
2023-10-31 07:03:15 +01:00
Tobias Christiansen
3c41ac5ae4 Tests/LibWeb: Add object-{fit,position} test 2023-10-31 07:03:05 +01:00
Tobias Christiansen
3b1083c4cb Tests/LibWeb: Add object-position to the getComputedStyle test
The test was failing because we now support the new and shiny
object-position property.
2023-10-31 07:03:05 +01:00
Tobias Christiansen
e60253d64c LibWeb: Respect offsets always when painting with object-position
Previously we didn't always set the bitmap_intersect correctly when
applying an object-position. This lead to images not correctly being
centered when the axis that it should move along was not the specified
axis.
2023-10-31 07:03:05 +01:00
Tobias Christiansen
6f71b8be1b LibWeb: Use local 'offset' variable in ImagePaintable
We created the local and then did not use it everywhere we could.
2023-10-31 07:03:05 +01:00
Tobias Christiansen
3a4d30dddc LibWeb: Avoid truncation of aspect-ratio-computation in ImagePaintable
The value of the aspect ratio of the bitmap got truncated and this
lead to funky rendering problems when using object-fit and
object-position.
2023-10-31 07:03:05 +01:00
Ali Mohammad Pur
78c04cb8b2 AK+LibPDF: Make Format print floats in a roundtrip-safe way by default
Previously we assumed a default precision of 6, which made the printed
values quite odd in some cases.
This commit changes that default to print them with just enough
precision to produce the exact same float when roundtripped.

This commit adds some new tests that assert exact format outputs, which
have to be modified if we decide to change the default behaviour.
2023-10-31 09:12:35 +03:30
Andrew Kaster
26a5d84d91 Meta: Port f1b79e0cd3 to gn build 2023-10-31 00:36:51 +03:30
Andrew Kaster
2148b89d95 Meta: Update CA certificate to 2023-08-22 2023-10-31 00:36:51 +03:30
Andrew Kaster
baa26d10a8 LibTLS: Retry sending in TLSv12::flush() on EAGAIN or EINTR
Crashing here is not very helpful.
2023-10-31 00:36:51 +03:30
MacDue
c93d367d95 LibWeb: Layout SVG <text> elements during layout (not while painting)
Previously, all SVG <text> elements were zero-sized boxes, that were
only actually positioned and sized during painting. This led to a number
of problems, the most visible of which being that text could not be
scaled based on the viewBox.

Which this patch, <text> elements get a correctly sized layout box,
that can be hit-tested and respects the SVG viewBox.

To share code with SVGGeometryElement's the PathData (from the prior
commit) has been split into a computed path and computed transforms.
The computed path is specific to geometry elements, but the computed
transforms are shared between all SVG graphics elements.
2023-10-30 19:44:54 +01:00
MacDue
dc9cb449b1 LibWeb: Store computed SVG path data/transforms in LayoutState
This removes the awkward hack to recompute the layout transform at paint
time, and makes it possible for path sizes to be computed during layout.

For example, it's possible to use relative units in SVG shapes (e.g.
<rect>), which can be resolved during layout, but would be hard to
resolve again during painting.
2023-10-30 19:44:54 +01:00
Timothy Flynn
19313945f2 LibWeb: Implement loading a favicon in absence of a <link> icon element
For example, serenityos.org does not contain a <link rel="icon"> element
to indicate its favicon. Before navigables, we implemented attempting to
load a fallback favicon in a rather ad-hoc manner. This implements the
full spec steps to do so after the HTML document is parsed.
2023-10-30 18:31:15 +01:00
Timothy Flynn
b1274a885b LibWeb: Return success when a <link> element decodes a valid favicon 2023-10-30 18:31:15 +01:00
Timothy Flynn
1504469c50 js: Implement the exit builtin without calling the native exit function
If we invoke the exit native function from within the exit builtin, the
native call will then invoke global destructors. This ultimately ends up
deleting the JS::NativeFunction that defines the exit builtin, thus we
try to delete the AK::Function held inside the NativeFunction while that
AK::Function is executing. This is explicitly forbidden by AK::Function.

Instead, simply set a flag to exit the REPL after the builtin executes.
2023-10-30 18:12:17 +01:00
Andrew Kaster
f9386737a6 LibTLS: Add certificate verification for ECDSA with SECP256r1 curves 2023-10-30 10:17:39 -06:00
Michiel Visser
c548dca174 LibTLS: Add ECDSA support with the secp256r1 curve 2023-10-30 10:17:39 -06:00
Michiel Visser
caf533bddf LibCrypto: Add ECDSA signature checking with secp256r1 2023-10-30 10:17:39 -06:00
Simon Wanner
0daebef727 LibJS/JIT: Clear exception before executing finalizer
language/statements/try/S12.14_A13_T2.js                        -> 
language/statements/try/S12.14_A15.js                           -> 
language/statements/try/S12.14_A7_T1.js                         -> 
language/statements/try/S12.14_A7_T2.js                         -> 
language/statements/try/S12.14_A7_T3.js                         -> 
language/statements/try/completion-values-fn-finally-abrupt.js  -> 
language/statements/try/completion-values-fn-finally-return.js  -> 
2023-10-30 15:05:26 +01:00
Simon Wanner
bd62c4763c LibJS/JIT: Flip saved_return_value condition in ContinuePendingUnwind
This did not match the `if (saved_return_value) return else resume`
in Interpreter.

test/built-ins/Promise/all/resolve-poisoned-then.js         -> 
test/built-ins/Promise/all/resolve-thenable.js              -> 
test/built-ins/Promise/allSettled/resolve-poisoned-then.js  -> 
test/built-ins/Promise/allSettled/resolve-thenable.js       -> 
test/built-ins/Promise/race/resolve-self.js                 -> 
test/language/statements/try/S12.14_A7_T1.js                -> 
test/language/statements/try/S12.14_A7_T2.js                -> 
test/language/statements/try/S12.14_A7_T3.js                -> 
2023-10-30 15:05:26 +01:00
Simon Wanner
82c057391e LibJS/JIT: Handle uninitialized bindings in GetLocal
test262: +78     -72     -4 💥
2023-10-30 15:05:26 +01:00
Simon Wanner
5b2c0dfec0 LibJS/JIT: Return result of SuperCallWithArgumentArray
test/language/expressions/optional-chaining/call-expression.js 💥️ -> 
test/language/expressions/super/call-expr-value.js             💥️ -> 
2023-10-30 15:05:26 +01:00
Evgeniy Baskov
da45bd3fde LibJS/JIT: Implement static exception handling 2023-10-30 13:10:08 +01:00
Hendiadyoin1
1341f4438d LibJS: Save scheduled jumps when entering unwind contexts
These are then restored upon `ContinuePendingUnwind`.
This stops us from forgetting where we needed to jump when we do extra
try-catches in finally blocks.

Co-Authored-By: Jesús "gsus" Lapastora <cyber.gsuscode@gmail.com>
2023-10-30 13:10:08 +01:00
Hendiadyoin1
4da5b8ec67 LibJS: Reset scheduled-jump flag when throwing an exception
Otherwise we might attempt to follow the scheduled jump later
2023-10-30 13:10:08 +01:00
Hendiadyoin1
f5645e3c9c LibJS: Use static unwind mappings for unwind related functions 2023-10-30 13:10:08 +01:00
Hendiadyoin1
73f347b75c LibJS: Create static unwind mappings for BasicBlocks
This is currently only used in the bytecode dump to annotate to where
unwinds lead per block, but will be hooked up to the virtual machine in
the next commit.
2023-10-30 13:10:08 +01:00
Tobias Christiansen
647f0ccd3f LibWeb: Add rendering support for 'object-position'
Images now get rendered correctly according to the 'object-position'
property.
2023-10-30 10:40:30 +00:00
Tobias Christiansen
d00c7e55a5 LibWeb: Add plumbing for the new 'object-position' property
Now, the 'object-position' property gets properly parsed and is
provided to the rest of the ecosystem.
In the parser we use the same parsing as for the background-position,
which is not entirely correct but almost a <position>.
2023-10-30 10:40:30 +00:00
Tobias Christiansen
7e11de272f LibWeb: Add 'object-position' property and 'position' enum
This patch adds the 'object-position' CSS property description to the
json for code generation.
Also the 'position' enum is added. The values of this enum are the
valid inputs to the object-position property from CSS Values-4.
2023-10-30 10:40:30 +00:00
Tobias Christiansen
6602b1ddb1 LibWeb: Rename "position" enum to "positioning"
The postitioning enum values are used by the position CSS property.
Unfortunately, the prior naming clashes with the CSS Values-4 type
named position, which will be implemented in a later commit.
2023-10-30 10:40:30 +00:00
Gurkirat Singh
60640fe38d Utilities: Implement slugify using AK/Slugify 2023-10-30 10:39:59 +00:00
Gurkirat Singh
ab2d8c092e LibCore: Implement handler for Vector<String> positional arguments 2023-10-30 10:39:59 +00:00
Gurkirat Singh
da8a3f9ff2 LibMarkdown: Render slugified anchor tag in heading
Because slugify function accepts AK::String, which can hold unicode
code_points as well, heading text is normalised to ensure with NFD
form to ensure same binary respresentation of a particular string.
2023-10-30 10:39:59 +00:00
Gurkirat Singh
f1b79e0cd3 AK: Implement slugify function for URL slug generation
The slugify function is used to convert input into URL-friendly slugs.
It processes each character in the input, keeping ascii alpha characters
after lowercase and replacing non-alphanum characters with the glue
character or a space if multiple spaces are encountered consecutively.
The resulting string is trimmed of leading and trailing whitespace, and
any internal whitespace is replaced with the glue character.

It is currently used in LibMarkdown headings generation code.
2023-10-30 10:39:59 +00:00
Gurkirat Singh
670925a84f Meta: Add anchors to headings of man pages 2023-10-30 10:26:21 +00:00
dependabot[bot]
82ce4acfe5 CI: Bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 10:22:21 +00:00
dependabot[bot]
8e1b0a46f7 CI: Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 10:21:11 +00:00
Andreas Kling
0c6d094a7e LibJS/JIT: Stop logging JIT success by default (but still log failure) 2023-10-30 07:11:43 +01:00
Zaggy1024
dfaf645302 LibJS: Add an inline JIT fast path when ToNumeric has nothing to do
In most cases, this op will do nothing, as it is running on an the
accumulator while it already contains a number. Let's avoid doing that
native call.
2023-10-30 07:10:54 +01:00
Simon Wanner
a2b0154661 LibJS/JIT: Compile the AsyncIteratorClose instruction 2023-10-30 07:10:24 +01:00
Simon Wanner
ac59e982a9 LibJS/JIT: Compile the CopyObjectExcludingProperties instruction 2023-10-30 07:10:24 +01:00
Simon Wanner
9494fbe670 LibJS/JIT: Compile the PutByValueWithThis instruction 2023-10-30 07:10:24 +01:00
Simon Wanner
847889343f LibJS/JIT: Compile the New##ErrorName instructions 2023-10-30 07:10:24 +01:00
Simon Wanner
fd059d4e4a LibJS/JIT: Compile the JumpUndefined instruction 2023-10-30 07:10:24 +01:00
Simon Wanner
a16082c6a5 LibJS/JIT: Compile the HasPrivateId instruction 2023-10-30 07:10:24 +01:00
Simon Wanner
712c89dacf LibJS/JIT: Compile the GetNewTarget instruction 2023-10-30 07:10:24 +01:00
Simon Wanner
19045d6431 LibJS/JIT: Compile the GetMethod instruction 2023-10-30 07:10:24 +01:00