Commit graph

39129 commits

Author SHA1 Message Date
Linus Groh
1f5cef1319 LibJS: Make AST.cpp compile with -O0 2022-07-06 14:12:51 +02:00
DexesTTP
eae8520dbb LibJS: Properly compute the line for source location hints
These were obvious wrong uses of the old default "only first occurence"
parameter that was used in String::replace.
2022-07-06 11:12:45 +02:00
DexesTTP
e371552ff2 LibIMAP: Properly escape the whole string instead of the first character
These were obvious wrong uses of the old default "only first occurence"
parameter that was used in String::replace.
2022-07-06 11:12:45 +02:00
DexesTTP
6c7ee391cb LibWeb: Replace all uses of -'s and ::'s when running the IDL generator
These were obvious wrong uses of the old default "only first occurence"
parameter that was used in String::replace.
2022-07-06 11:12:45 +02:00
DexesTTP
7ceeb74535 AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes.

In particular, this does not fix any of the wrong uses of the previous
default parameter (which used to be 'false', meaning "only replace the
first occurence in the string"). It simply replaces the default uses by
String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
2022-07-06 11:12:45 +02:00
Tim Schumacher
b2454888e8 LibC: Stop leaking FILE in getpwuid and getpwnam 2022-07-06 10:34:20 +02:00
Tim Schumacher
ee5ee0ef86 LibC: Don't clear static storage during endpwent 2022-07-06 10:34:20 +02:00
Tim Schumacher
d903af3614 LibC: Don't clear static storage during endgrent
The POSIX documentation for `endgrent` only mentions that it "closes
the group database", not that it clears the backing storage for return
values. This means that applications might make use of the returned
values even after closing the group database itself. This includes our
own implementations for `getgrnam` and `getgrgid`.

The specification also states that "the storage areas might be
overwritten by a subsequent call to `getgrgid`, `getgrnam`, or
`getgrent`". This implies that `getgrgid` and `getgrnam` aren't meant
to have their own static storage and instead rely on the storage of
`getgrent`.
2022-07-06 10:33:10 +02:00
Andreas Kling
d2b7d2440f LibWeb: Cache flex item main sizes to avoid relayout during same cycle
This makes twitter.com actually load & render (although not very well.)
2022-07-06 00:22:42 +02:00
Linus Groh
8733fbae76 LibJS: Rename TimeHourMinuteBasicFormatNotAmbiguous
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/70de75b
2022-07-05 23:15:52 +02:00
Linus Groh
e1a6418015 LibJS: Rename TimeZoneNumericUTCOffsetNotAmbiguousAllowedNegative
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/9ddd57e
2022-07-05 23:15:52 +02:00
Linus Groh
8dcd0d4a06 LibJS: Rename TimeZoneNumericUTCOffsetNotAmbiguous
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/5ebd34b
2022-07-05 23:15:52 +02:00
Linus Groh
7ef3b42685 LibJS: Simplify TimeZoneNumericUTCOffsetNotAmbiguous
This is an editorial change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/ccef468
- https://github.com/tc39/proposal-temporal/commit/5b38ab4
2022-07-05 23:15:52 +02:00
Linus Groh
fec5d8d531 LibJS: Consistently check Temporal overflow options
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/c8ee2bd
2022-07-05 23:15:52 +02:00
Linus Groh
c3567faa8c LibJS: Remove unnecessary checks for undefined before ToPositiveInteger
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/9f3bf53
2022-07-05 23:15:52 +02:00
Jonta
6828937676 Docs: FAQ: Improve grammar in 2 paragraphs 2022-07-05 20:07:57 +00:00
Itamar
9498555256 LibWeb: Trigger a relayout after setting Element.innerHTML
In addition to tearing down the layout tree, we also want to trigger a
relayout for the changes made by setting Element.innerHTML to take
effect.
2022-07-05 21:27:37 +02:00
thankyouverycool
1d81d2e072 LibGUI: Don't ignore invisible widgets during layout changes
As they may be setting themselves visible again in the process.
Fixes inability to toggle widgets on and off in some apps.
2022-07-05 21:26:04 +02:00
Luke Wilde
de88e119a0 LibWeb: Implement XMLSerializer
The main thing that is missing is validating certain pieces of data
against XML productions in well-formed mode, but nothing uses
well-formed mode right now.

Required by Closure Library for sanitising HTML.
e687b3d8ab/closure/goog/html/sanitizer/safedomtreeprocessor.js (L117)
2022-07-05 21:25:05 +02:00
Tim Schumacher
60fc0ceabb Tests: Add tests for inheriting signal handlers 2022-07-05 20:58:38 +03:00
Tim Schumacher
67f352b824 Kernel: Copy signal handlers when forking 2022-07-05 20:58:38 +03:00
Tim Schumacher
add4dd3589 Kernel: Do a POSIX-correct signal handler reset on exec 2022-07-05 20:58:38 +03:00
Luke Wilde
a4e3fff3fb WebContent: Invalidate document style when changing the page's palette
This makes the page automatically update to reflect the system theme
when in "Color Scheme > Follow System Theme" mode without having to
manually cause a style update.
2022-07-05 18:23:22 +02:00
MacDue
3294753d6c Browser+WebContent: Fix inspecting non-visible nodes
I already fixed the crash from this in #14470, but didn't fully fix
the issue. Currently the browser just avoids sending the
inspect_dom_node() IPC call for non-visible nodes.

The main problem with this is it means the browser keeps displaying
the overlay for the previously selected node. This commit fixes
the crash in the WebContent side, so the IPC call can still be made
and the selection correctly updated.
2022-07-05 13:09:11 +02:00
Idan Horowitz
753844ec96 LibELF: Take TLS segment alignment into account in DynamicLoader
Previously we would just tightly pack the different libraries' TLS
segments together, but that is incorrect, as they might require some
kind of minimum alignment for their TLS base address.

We now plumb the required TLS segment alignment down to the TLS block
linear allocator and align the base address down to the appropriate
alignment.
2022-07-05 11:26:10 +02:00
Idan Horowitz
33214c29d3 AK: Add an align_down_to power of two helper
Matching the similar align_up_to helper
2022-07-05 11:26:10 +02:00
Ali Mohammad Pur
5f012778b8 LibRegex: Use the correct values for comparing LUT entries
Previously we were ignoring the insensitive flag for LUT lookups.
2022-07-05 07:19:13 +02:00
Ali Mohammad Pur
7d01ee63d6 LibRegex: Use proper CharRange constructor instead of bit_casting
Otherwise the range order would be inverted.
2022-07-05 07:19:13 +02:00
Andrew Kaster
c774790975 LibArchive: Guard against major() and minor() macros from old glibc
glibc before 2.28 defines major() and minor() macros from sys/types.h.

This triggers a Lagom warning for old distros that use versions older
than that, such as Ubuntu 18.04. This fixes a break in the
compiler-explorer Lagom build, which is based off 18.04 docker
containers.
2022-07-05 01:27:37 +02:00
Andreas Kling
d40167f7bb LibGfx: Always truncate glyph coordinates in Painter::draw_text_run()
This fixes an issue with glyphs jiggling 1px back and forth due to
inconsistent rounding.
2022-07-05 00:48:59 +02:00
Ali Mohammad Pur
6e655b7f89 LibRegex: Fully interpret the Compare Op when looking for overlaps
We had a really naive and simplistic implementation, which lead to
various issues where the optimiser incorrectly rewrote the regex to use
atomic groups; this commit fixes that.
2022-07-04 23:09:53 +02:00
MacDue
b6f2ba6917 Base: Example of border-radius on iframe and canvas elements 2022-07-04 23:09:06 +02:00
MacDue
304e0966aa Base: Add some border-radius + overflow: hidden HTML examples 2022-07-04 23:09:06 +02:00
MacDue
b21d95bbe3 Base: Move fun canvas demo JavaScript to seperate file
This will allow this demo to be reused for other tests.
2022-07-04 23:09:06 +02:00
MacDue
b179d514d9 LibWeb: Support adding a border-radius to <iframe> elements 2022-07-04 23:09:06 +02:00
MacDue
3600c34c1d LibWeb: Support adding a border-radius to <canvas> elements 2022-07-04 23:09:06 +02:00
MacDue
8c8dde59d2 LibWeb: Use ScopedCornerRadiusClip for image painting 2022-07-04 23:09:06 +02:00
MacDue
af21ee8717 LibWeb: Use ScopedCornerRadiusClip for shadow painting 2022-07-04 23:09:06 +02:00
MacDue
22e2e1dc93 LibWeb: Use ScopedCornerRadiusClip for background painting 2022-07-04 23:09:06 +02:00
MacDue
b7fd844c9d LibWeb: Add ScopedCornerRadiusClip
This a simple RAII helper for the BorderRadiusCornerClipper it
samples under the corners on construction, then blits them back
on exiting the scope. This encapsulates a fairly common pattern.
2022-07-04 23:09:06 +02:00
MacDue
f283e0ddc5 LibWeb: Support overflow: hidden with a border-radius
Note: With this change the border-radius is clipped if ethier the
overflow-x or overflow-y is hidden (it is a little unclear what
happens if just one is set, but it seems like most browsers
treat one set + border-radius the same as if overflow: hidden
was set).
2022-07-04 23:09:06 +02:00
MacDue
2ceb143571 LibWeb: Use padding box for clipping overflow
The padding box should be used otherwise the content can overflow
on to the boxes borders.
2022-07-04 23:09:06 +02:00
MacDue
9a97adf121 LibWeb: Add option to allocate new bitmap for BorderRadiusCornerClipper
This will be needed for overflow: hidden, that clips things which may
themselves use the BorderRadiusCornerClipper.
2022-07-04 23:09:06 +02:00
Andreas Kling
13b4d91f66 LibWeb: Always apply min/max cross size constraints to flex items
We were neglecting to apply min-size and max-size constraints in the
fast path for flex items with a definite cross size.
2022-07-04 22:30:59 +02:00
Andreas Kling
7a7043f821 LibWeb: Simplify some WeakPtr assignments
We can assign a raw pointer directly to a WeakPtr without null-checking
it first.
2022-07-04 22:30:59 +02:00
Daniel Bertalan
ebac8abc04 LibJS: Explicitly instantiate Parser::parse_function_node
Due to macOS visibility rules, this function did not end up being
exported from liblagom-js.dylib, causing LagomWeb to fail to link.
2022-07-04 21:46:02 +02:00
Daniel Bertalan
569388e4af LibHTTP: Include JsonObject.h in Job.cpp
JsonArray.h does not #include the definition of JsonValue::serialize, as
it lives in JsonObject.h. The macOS Clang target handles symbol
visibility slightly differently (I couldn't figure out how exactly), so
no visible instantiation ended up being created for the function,
causing a link failure.
2022-07-04 21:46:02 +02:00
Daniel Bertalan
e15d6125b2 Tests: Move sprintf test from AK/ to LibC/
This test doesn't test AK::String, but LibC's sprintf instead, so it
does not belong in `Tests/AK`. This also means this test won't be ran on
Lagom using the host OS's printf implementation.

Fixes a deprecated declaration warning when compiling with macOS SDK 13.
2022-07-04 21:46:02 +02:00
Daniel Bertalan
fc3532e9b7 Lagom: Do not set -fno-semantic-interposition on macOS
The Mach-O file format does not have ELF's interposition rules, so this
flag does not make sense for macOS builds. While GCC silently accepts
the unsupported option, Clang issues a warning for it.

This commit makes it possible to build Lagom with LLVM from Homebrew.
2022-07-04 21:46:02 +02:00
Linus Groh
28a3c064c5 LibJS/Tests: Disable one Array.prototype.toSpliced test for now
It keeps failing on i686, and will until we've updated a bunch of size_t
APIs in the codebase to u64.
2022-07-04 18:50:35 +02:00