Commit graph

37164 commits

Author SHA1 Message Date
EWouters 72d5a19db3 Ports/ca-certificates: Update ca-certificates to version 2022-03-29 2022-04-11 19:43:56 -07:00
EWouters 67ce82ba97 Ports/c-ray: Update c-ray to git commit 8f30eb9
Part of the fix-linkage patch is removed as the changes are no
longer required.
2022-04-11 19:43:56 -07:00
EWouters 711e317bd5 Ports/byacc: Update byacc to version 20220128 2022-04-11 19:43:56 -07:00
EWouters aa0f356a81 Ports/brogue: Update brogue to version 1.10.1
Also preserve the `-j$(nproc)` flag.
2022-04-11 19:43:56 -07:00
EWouters 7952af9b6d Ports/bc: Update bc to version 5.2.3
Also added the recommended CFLAGS.
2022-04-11 19:43:56 -07:00
Jelle Raaijmakers 4c1d8a7785 LibSoftGPU: Optimize clipping code
Three optimizations are applied:

1. If the list of vertices to clip is empty, return immediately after
   clearing the output list.

2. Remember the previous vertex instead of recalculating whether it is
   within the clip plane.

3. Instead of copying and swapping lists around, operate on the input
   and output lists directly. This prevents a lot of `malloc`/`free`
   traffic as a result of vector assignments.

This takes the clipping code CPU load from 3.9% down to 1.8% for
Quake 3 on my machine.
2022-04-11 19:31:23 -07:00
Jelle Raaijmakers 60fccdbd71 LibSoftGPU: Remove superfluous braces in Clipper 2022-04-11 19:31:23 -07:00
Tim Schumacher a1686db2de Kernel: Skip setting region name if none is given to mmap
This keeps us from accidentally overwriting an already set region name,
for example when we are mapping a file (as, in this case, the file name
is already stored in the region).
2022-04-12 01:52:21 +02:00
Linus Groh 00b8ce4a6d LibJS: Pass this value to fallback func in Array.prototype.toString()
The existing code looks innocently correct, implementing the following
step:

    3. If IsCallable(func) is false, set func to the intrinsic function
       %Object.prototype.toString%.

as

    return ObjectPrototype::to_string(vm, global_object);

However, this misses the fact that the next step calls the function with
the previously ToObject()'d this value (`array`):

    4. Return ? Call(func, array).

This doesn't happen in the current implementation, which will use the
unaltered this value from the Array.prototype.toString() call, and make
another, unequal object in %Object.prototype.toString%. Since both that
and Array.prototype.toString() do a Get() call on said object, this
behavior is observable (see newly added test).

Fix this by actually doing what the spec says and calling the fallback
function the regular way.
2022-04-12 00:23:27 +01:00
djwisdom 2af869d018 Base: Add new dark theme alternative 2022-04-12 00:00:30 +01:00
Luke Wilde c32dcf7f75 LibJS: Update ZonedDateTime AO spec comments for structured headers
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/01714a5
2022-04-11 23:47:02 +01:00
Andreas Kling b3d85afd92 LibWeb: Make Layout::Box::set_needs_display() work for all boxes
For inline-blocks and inline replaced elements, we previously fell into
a code path that tried to find a corresponding line box fragment to
invalidate. However, we don't need to do any of that, all we need to do
is get the absolute rect from our paintable, and invalidate that.

This makes CRC2D invalidations happen immediately instead of as a side
effect of some other invalidation.
2022-04-12 00:11:48 +02:00
Linus Groh 7e18d1c078 LibJS: Remove unused include from AbstractOperations.cpp 2022-04-11 21:34:57 +01:00
Linus Groh 24d772af7c LibJS: Move additional notes to spec comments onto their own line
Having all spec comments verbatim on their own line with no additions
made by us will make it easier to automate comparing said comments to
their current spec counterparts.
2022-04-11 21:32:37 +01:00
Luke Wilde 90f14de1e9 LibJS: Call HostEnsureCanCompileStrings in CreateDynamicFunction
I noticed we were missing this when I added to PerformEval :^)
2022-04-11 21:23:36 +01:00
Luke Wilde 7798821f5b LibJS: Add tests for the new steps added to PerformEval 2022-04-11 21:23:36 +01:00
Luke Wilde 34f902fb52 LibJS: Add missing steps and spec comments to PerformEval
While adding spec comments to PerformEval, I noticed we were missing
multiple steps.

Namely, these were:
- Checking if the host will allow us to compile the string
  (allowing LibWeb to perform CSP for eval)
- The parser's initial state depending on the environment around us
  on direct eval:
   - Allowing new.target via eval in functions
   - Allowing super calls and super properties via eval in classes
   - Disallowing the use of the arguments object in class field
     initializers at eval's parse time
- Setting ScriptOrModule of eval's execution context

The spec allows us to apply the additional parsing steps in any order.
The method I have gone with is passing in a struct to the parser's
constructor, which overrides the parser's initial state to (dis)allow
the things stated above from the get-go.
2022-04-11 21:23:36 +01:00
Andreas Kling f4f850aaf2 LibWeb: Support CSSRule.type
We already had the CSSRule::Type enum, but the values were not aligned
with the CSSOM spec. This patch takes care of that, and then exposes
the type of a CSSRule to JavaScript via the "type" attribute.
2022-04-11 21:10:08 +02:00
Andreas Kling a0ba49a50a LibWeb: Support CSSStyleDeclaration.getPropertyPriority() 2022-04-11 21:10:07 +02:00
Andreas Kling a8afb883c1 LibWeb: Implement CSS declaration block's "updating flag"
This flag is used to prevent reparsing the style attribute after it is
automatically updated after using the CSSOM API to mutate style.
2022-04-11 21:10:07 +02:00
Andreas Kling 66618a666b LibWeb: Implement CSSStyleDeclaration.{set,remove}Property close to spec
We already had setProperty() but it was full of ad-hoc idiosyncracies.
This patch aligns setProperty() with the CSSOM spec and also implements
removeProperty() since that's actually needed by setProperty() now.

Some things fixed by this:
- We now support the "priority" parameter to setProperty()
- Element "style" attributes now update to reflect CSSOM mutations
2022-04-11 21:10:07 +02:00
Simon Danner 9ad9c72827 LibGfx: Draw complex emojis correctly
Previously draw_text_run only passed a single code point to
draw_glyph_or_emoji. This lead e.g. to broken unicode flag support.
Improve this by passing along the code_point iterator, so the emoji code
can detect the correct emojis and advance it as needed.
2022-04-11 21:09:52 +02:00
Sam Atkins f64ff945b2 env: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins f0aba519c3 Utilities: Read positional arguments as Strings not char*s
This is a pretty trivial change so they're all batched together.
2022-04-11 21:09:42 +02:00
Sam Atkins 84b67754c0 Shell: Read script arguments as Strings instead of char*s
This saves work in places that previously had to create a
`Vector<String>` anyway, or repeatedly cast the char* to a String.
Plus, Strings are nicer than char*. :^)
2022-04-11 21:09:42 +02:00
Sam Atkins 1ac6c4df72 strace: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins 3e5b1b1dbc LibCore: Add ArgsParser::add_positional_argument(Vector<String>&, ...) 2022-04-11 21:09:42 +02:00
Sam Atkins b81a3a6f0e profile: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins eb857e45dc HackStudio: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins 88800e8f32 FileManager: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins d2b32924d6 pls: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins 3971f71235 Terminal: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins 5a47b74227 paste: Use Core::System::{exec,setenv} 2022-04-11 21:09:42 +02:00
Sam Atkins 32ab09a930 LibCore: Add a wrapper for execvpe() and friends
This is a single function, which behaves like the various LibC exec()
functions depending on the passed parameters. No direct equivalent is
made for execl() - you have to wrap your arguments in a Span of some
kind.

On Serenity, this calls the syscall directly, whereas Lagom forwards to
the appropriate LibC function.
2022-04-11 21:09:42 +02:00
Linus Groh b4c6fd51be LibJS: Use single page spec link for BoundFunctionCreate 2022-04-11 19:44:56 +01:00
Linus Groh 231acda7f8 LibJS: Fix two bogus spec links 2022-04-11 19:44:33 +01:00
Simon Danner bd90498332 LibWeb: Add SVGDefsElement
* Similarly to clipPath, this doesn't need to get rendered, so return no
  LayoutNode.
2022-04-11 20:19:10 +02:00
stelar7 55e9192886 HackStudio: Fix inverted condition when trying to create directories 2022-04-11 16:44:36 +02:00
Julen Ruiz Aizpuru 23ea5c6721 BrowserSettings: Validate homepage URL 2022-04-11 08:19:29 -04:00
Florian Stellbrink af3174c9ce LibGFX: Transform vertices when drawing antialiased lines
Previously we transformed each rasterized point when drawing a line.
Now we transform the lines' endpoints instead.

That means running two transforms per line instead of transforms for
each pixel. It is not clear that the overhead for the fast path is
still worth it. If we still want to optimize identity and translations,
it is probably better to do that inside AffineTransform.

In addition this will behave nicer if the transform includes scaling.
Previously this would rasterize lines before scaling. Which means
drawing too many points when scaling down, and not drawing enough
points when scaling up.
With the new approach we will automatically rasterize at pixel scale.

This is essentially the same as OpenGL, where vertices are transformed
and rasterization happens in screen space.
2022-04-11 03:16:37 +02:00
Andreas Kling b4a8be5dc9 LibWeb: Reset canvas elements when their width/height attribute are set 2022-04-11 03:05:19 +02:00
Andreas Kling 88ef1bff38 LibWeb: Add fast path for CRC2D.drawImage() with simple transform
If the transform is a simple translation, we don't need to run the big
and slow transform rasterizer.
2022-04-11 02:29:37 +02:00
Andreas Kling 57feb0f3ec LibWeb: Add missing null check of independent formatting context in FFC
When calling layout_inside() on a flex item that can't have children of
its own, layout_inside() will not return an independent formatting
context, so we need to handle that case here.
2022-04-11 01:20:24 +02:00
Andreas Kling fc8c4ea23f LibWeb: Let BFC compute width for block-level replaced elements
We never really hit this code path before, but now that IMG elements can
be block-level, we need to get them hooked up with box model metrics.
2022-04-11 01:04:09 +02:00
Andreas Kling edfa4508a5 LibWeb: Create a no-op formatting context for childless replaced boxes
This is a hack that allows block-level replaced elements to be flex
items. Flexbox layout currently assumes (in many places) that it's
always possible to create an independent formatting context for each of
its items.
2022-04-11 01:03:47 +02:00
Andreas Kling b1a6a8600a LibWeb: Honor "display:block" on IMG elements
Previously we forced all image elements to be inline-level. Now they can
participate in block layout if they prefer. :^)
2022-04-11 01:03:47 +02:00
Tim Schumacher 1bdaee475b DHCPClient: Close outgoing sockets after use 2022-04-11 00:15:06 +02:00
Andreas Kling ede818cbf9 AK: Disable the HashTable<double> test until UB issue is fixed 2022-04-11 00:11:53 +02:00
Andreas Kling ca2807ba42 AK: Honor box's own intrinsic size in calculate_intrinsic_sizes()
If a layout box claims to have both intrinsic width and height, we can
simply return those instead of performing any kind of layout.
2022-04-11 00:11:53 +02:00
kleines Filmröllchen 5319e3a03f LibCore+Userland: Remove File::ensure_parent_directories
We have a much safer and more powerful alternative now, so let's move
the few users over.
2022-04-11 00:08:48 +02:00