Commit Graph

39104 Commits

Author SHA1 Message Date
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
Jonta
b8bc64c1c7 Docs: Add kleines Filmröllchen's YouTube-channel 2022-07-04 14:50:07 +02:00
networkException
48c54e6796 LibWeb: Use lowercase type selectors to match against html elements
Previously we would fail to match a selector like "NAV" against a <nav>
html element.

Note that the strings must be identical in XML Documents.
2022-07-04 12:39:48 +02:00
networkException
6805baeedd LibWeb: Add the type field to DOM::Document
This patch adds the document type concept to documents and sets it in
various places.
2022-07-04 12:39:48 +02:00
networkException
baac3ba60c LibWeb: Remove unnecessary return in ResolvedCSSStyleDeclaration 2022-07-04 12:39:48 +02:00
Ali Mohammad Pur
6e24d845e0 Shell: Immediately resolve value when setting a variable
The lazy resolution mechanism made it so that the variables were linked
together, causing unexpected behaviour:

    true
    x=$? # expected: x=0
    false
    echo $x # expected: 0, actual: 1
2022-07-04 10:23:15 +00:00
Maciej
f94c7fc880 Base: Update Network manpage to the new NetworkServer behavior 2022-07-04 13:20:24 +03:00
Maciej
65307cf5cc NetworkServer: Enable DHCP on interfaces that are not listed in config 2022-07-04 13:20:24 +03:00
FrHun
544636fd0f LibGUI: Notify the layout system of more relevant events in TabWidget 2022-07-04 11:15:40 +02:00
FrHun
ccdccadc24 LibGUI: Implement calculated min/preferred sizes for TabWidget 2022-07-04 11:15:40 +02:00
FrHun
309874b4fb LibGUI: Add horizontal and vertical totals to Margins 2022-07-04 11:15:40 +02:00
FrHun
dba6f0bc4b AK: Add header for generic shorthands
These are functions that can be expressed with just normal operators,
but would be very repetetive.
2022-07-04 11:15:40 +02:00
FrHun
f35efe9bc8 LibGUI: Notify layout system of more relevant events in Widget 2022-07-04 11:15:40 +02:00
FrHun
a0938d62f3 LibGUI: Avoid some unneeded relayouts from layout relevant changes 2022-07-04 11:15:40 +02:00
FrHun
80ea141ffe LibGUI: Calculate Window min_size on show 2022-07-04 11:15:40 +02:00
FrHun
53215be7ae WidgetGallery: Repair GML layout on BasicsTab 2022-07-04 11:15:40 +02:00
MacDue
2ee7c44036 Base: Add some background-clip + border-radius HTML examples 2022-07-04 11:12:44 +02:00
MacDue
61b447e53f LibWeb: Shrink border radii for background-clip and support with images
Since background layers can have different clipping this has also
required doing the corner clipping for each layer, rather than
just once.
2022-07-04 11:12:44 +02:00
MacDue
0070c28714 LibWeb: Add .shrink() to BorderRadiusData and BorderRadiiData 2022-07-04 11:12:44 +02:00
Igor Pissolati
44057c9482 LibWeb: Make hit testing respect hidden overflow 2022-07-04 11:09:27 +02:00
Linus Groh
4b70ddf5a0 LibJS: Let Array.prototype.toSpliced throw RangeError for len <= 2^53-1
This aligns it with the spec again, it was clarified that the additional
range check before ArrayCreate is intentional:
https://github.com/tc39/proposal-change-array-by-copy/issues/94

Also cast the final variable to an u64 instead of size_t after we have
determined that it is safe to do so, as that's what Array::create()
takes now.
2022-07-04 10:10:11 +02:00
Linus Groh
5927cdd9c5 LibJS: Use u64 for the length parameter in Array::create()
This doesn't matter per se as the value is immediately validated to be
in the 0 to 2^32 - 1 range, but it avoids having to cast a number that
potentially doesn't fit into a size_t into one at the call site. More
often than not, array-like lengths are only validated to be <= 2^52 - 1,
i.e. MAX_SAFE_INTEGER.

This is fully backwards compatible with existing code as a size_t always
fits into an u64, but an u64 might not always fit into a size_t.
2022-07-04 10:10:11 +02:00
Linus Groh
65eb1ee67a LibJS: Add spec comments to ArrayCreate 2022-07-04 10:10:11 +02:00
Linus Groh
1132151f3d LibJS: Use a template for 'Value from integral number' constructors
This also allows constructing from other integral types like u64, which
would have been ambiguous before (at least on i686):

```
error: call of overloaded 'Value(u64&)' is ambiguous
note: candidate: 'JS::Value::Value(i32)'
  175 |     explicit Value(i32 value)
      |              ^~~~~
note: candidate: 'JS::Value::Value(unsigned int)'
  164 |     explicit Value(unsigned value)
      |              ^~~~~
note: candidate: 'JS::Value::Value(long unsigned int)'
  153 |     explicit Value(unsigned long value)
      |              ^~~~~
note: candidate: 'JS::Value::Value(double)'
  141 |     explicit Value(double value)
      |              ^~~~~
```
2022-07-04 10:10:11 +02:00
Lenny Maiorani
c860d8f5be AK: Add nodiscard attribute to Find functions 2022-07-04 05:53:56 +00:00
Lenny Maiorani
ef4b98be52 AK: Add nodiscard attribute to BitStream functions 2022-07-04 05:53:56 +00:00