Commit graph

36799 commits

Author SHA1 Message Date
Kenneth Myhra ab9a78a305 tr: Utilize TRY more
This converts the local functions to return ErrorOr<T> and utilizes TRY
more.
2022-03-29 21:28:29 -07:00
Kenneth Myhra e548b2cff2 tr: Port to LibMain 2022-03-29 21:28:29 -07:00
Kenneth Myhra 8bd7c5b3d5 test_env: Port to LibMain 2022-03-29 21:28:29 -07:00
Kenneth Myhra 3df8c9e9de test-unveil: Port to LibMain 2022-03-29 21:28:29 -07:00
Kenneth Myhra 0015040ebd LibCore: Add syscall wrapper for access() 2022-03-29 21:28:29 -07:00
Kenneth Myhra f4aef35e6e test-pthread: Port to LibMain and let local functions return ErrorOr<T>
This ports 'test-pthread' to LibMain and converts the local functions of
the program to return ErrorOr<T>.
2022-03-29 21:28:29 -07:00
Kenneth Myhra d69f3aa958 test-fuzz: Allow listing fuzzing targets without specifying input file 2022-03-29 21:28:29 -07:00
Kenneth Myhra 4994718d8d test-fuzz: Port to LibMain
Also use StringView in place of raw C strings and String.
2022-03-29 21:28:29 -07:00
Kenneth Myhra b47a9ab4dc test-bindtodevice: Port to LibMain
This ports 'test-bindtodevice' to LibMain and convert the local 'test'
function to return ErrorOr<T>.
2022-03-29 21:28:29 -07:00
Kenneth Myhra e302fac34b kcov-example: Port to LibMain 2022-03-29 21:28:29 -07:00
Kenneth Myhra 234025ee53 telws: Port to LibMain 2022-03-29 21:28:29 -07:00
Kenneth Myhra bb4994d67b run-tests: Port to LibMain 2022-03-29 21:28:29 -07:00
Kenneth Myhra 7d87f0d56d markdown-check: Use Core::ArgsParser 2022-03-29 21:28:29 -07:00
Kenneth Myhra de7d333d43 markdown-check: Port to LibMain 2022-03-29 21:28:29 -07:00
Simon Wanner 6437f5da36 LibWeb: Add basic support for the attr() CSS function
CSS Values and Units Module Level 5 defines attr as:
  `attr(<q-name> <attr-type>?, <declaration-value>?)`

This implementation does not contain support for the type argument,
effectively supporting `attr(<q-name>, <declaration-value>?)`
2022-03-30 03:18:14 +02:00
jd ba6ba67fa0 Toolchain: Fix serenity.nix
* x11 package name has changed to xlibsWrapper.
* texinfo is necessary for Makeinfo.
* e2fsprogs was recenty fixed on nicpkgs to include fuse2fs to mount
serenity images without root access but it needed some configuration.
2022-03-29 16:36:28 -07:00
Lady Gegga 260cf6c3b2 Base: Add Ninjyak to emoji.txt 2022-03-30 00:32:43 +01:00
Lady Gegga 1af923e646 Base: Add 2212, 2600, 2717, 2718 to font Katica Regular 10
2600 - https://www.unicode.org/charts/PDF/U2600.pdf
2212 - https://www.unicode.org/charts/PDF/U2200.pdf
2717, 2718 - https://www.unicode.org/charts/PDF/U2700.pdf
2022-03-30 00:32:43 +01:00
Lady Gegga 9c1d480083 Base: Add 2212 to font Katica Bold 10
2212 - https://www.unicode.org/charts/PDF/U2200.pdf
2022-03-30 00:32:43 +01:00
Lady Gegga 3087aded59 Base: Add 2600 to font Pabbleton Bold 14
2600 - https://www.unicode.org/charts/PDF/U2600.pdf
2022-03-30 00:32:43 +01:00
Lady Gegga 68990d3682 Base: Add emoji Ninjyak (10CD22) 2022-03-30 00:32:43 +01:00
Andreas Kling 6a4247bee9 LibWeb: Use more precise font metrics when doing inline layout
We now position inline-level boxes based on ascent and descent metrics
from the font in use. This makes our basic text layouts look a lot more
like those produced by other browsers. :^)

I've tried to match the terminology used by the CSS Inline Layout spec.

This will regress Acid2 a little bit, and probably various other sites,
but on the whole it's the direction we should be heading, so let's go.
2022-03-30 01:12:44 +02:00
Andreas Kling fae8fde913 LibWeb: Draw inspector overlay label with default font 2022-03-30 00:57:15 +02:00
Andreas Kling 6d260b14b4 LibGfx: Rasterize TTF glyphs using "hhea" metrics instead of "os2"
This matches what other font systems appear to do.
2022-03-30 00:57:15 +02:00
Andreas Kling 9b0d158e69 LibWeb: Only set children-are-not-inline when inserting in-flow child
We were marking block boxes as having non-inline children when inserting
any child box, even if the child was out-of-flow.
2022-03-30 00:57:15 +02:00
Andreas Kling 1c88536298 LibWeb: Use the new Gfx::Painter::draw_text_run() API for drawing text
This avoids a bunch of unnecessary work in Painter which not only took
time, but sometimes also led to alignment issues. draw_text_run() will
draw the text where we tell it, and that's it.
2022-03-30 00:57:15 +02:00
Andreas Kling dd940dfa85 LibWeb: Use font-derived metrics for "line-height:normal"
Instead of multiplying the font-size with 1.4f because reasons, we now
ask the font for its preferred line spacing.
2022-03-30 00:57:15 +02:00
Andreas Kling 56a284713d LibGfx: Add ascent, descent and line gap to FontPixelMetrics
These are the main values we need in LibWeb to perform inline layout.
2022-03-30 00:57:15 +02:00
Andreas Kling 7850628ff1 LibGfx: Add Painter::draw_text_run(), a simplified text painting API
This API does:
    - Take a Utf8View
    - Take the starting point on the baseline as its input coordinate

This API does not:
    - Align the text
    - Wrap the text
    - Elide too-long text into "..."
2022-03-30 00:57:15 +02:00
Andreas Kling e398164f10 LibGfx: Make Font::pixel_metrics() virtual
This makes it easier for BitmapFont and ScaledFont to implement metrics
lookup themselves.
2022-03-30 00:57:15 +02:00
Andreas Kling 344374588b LibGfx: Rename FontMetrics => FontPixelMetrics
Let's make it clear in the type name that this contains pixel metrics.
Also rename Font::metrics() => Font::pixel_metrics().
2022-03-30 00:57:15 +02:00
Andreas Kling 0f6dd8c62b LibGfx: Make Gfx::FontMetrics include the advance of '0' instead of 'M'
CSS actually wants the advance of the ASCII '0' character for its "ch"
units, so let's include that instead of the arbitrarily chosen 'M'.
2022-03-30 00:57:15 +02:00
Andreas Kling 2f7b6af87e LibGfx: Remove code point parameter from Gfx::Font::Metrics
Everyone was asking for the glyph width of 'M' anyway. We can just make
that request implicit and simplify the API.
2022-03-30 00:57:15 +02:00
Andreas Kling b0955fd269 LibWeb: Add fast_is<T>() for some common DOM Node subclasses 2022-03-30 00:52:02 +02:00
Jelle Raaijmakers 02e2f11380 Browser: Make storage inspector columns sortable 2022-03-29 23:51:47 +01:00
Jelle Raaijmakers 62fbf282b1 Browser: Reorder storage inspector columns
Show "domain" and "path" as the first two columns. Since we're showing
all cookies for all domains and all paths, you will probably want to
see the domain and path before the actual cookie name and value.
2022-03-29 23:51:47 +01:00
Linus Groh 68ee193464 LibJS: Check type of ShadowRealm.prototype.importValue() 2nd argument
This is a normative change in the ShadowRealm spec.

See: https://github.com/tc39/proposal-shadowrealm/commit/2b45a15
2022-03-29 23:48:25 +01:00
Linus Groh f1d744e11a LibJS: Fix sign in PlainYearMonth.prototype.subtract()
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6cf421b
2022-03-29 23:21:17 +01:00
Linus Groh e4fe60b972 LibJS: Update incorrect spec comment in ToRelativeTemporalObject
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/4cb192d
2022-03-29 22:56:03 +01:00
Jelle Raaijmakers c637795888 Ports: Update PHP to 8.1.4 2022-03-29 22:49:27 +01:00
Jelle Raaijmakers cf1baddb67 LibC: Implement getdtablesize() 2022-03-29 22:49:27 +01:00
GeekFiftyFive 8fee285d72 LibHTTP: Append port to Host header if it exists 2022-03-30 00:34:29 +03:00
Andreas Kling 0fd51ae811 LibWeb: Ignore empty anonymous block children in height:auto calculation
This fixes a regression on GitHub from
5da7ebb806.

Thanks to Simon for reporting it! :^)
2022-03-29 22:30:58 +02:00
Linus Groh 1e01a85cdf LibJS: Import C++ sources from libjs-test262 :^)
This commit upstreams most of the C++ bits of the LibJS test262 runner
at https://github.com/linusg/libjs-test262/, specifically everything but
the main.cpp file serving as the actual executable.
Since all of these are just regular JS objects, I opted to put them in
LibJS itself, in a new Contrib/ directory like many other projects have
one. Other code that can end up there in the future is the runtime for
esvu, which might even share some functionality with test262's $262
object.

The code has been copied verbatim, and only a small number of changes
have been made:

- Putting everything into the JS::Test262 namespace
- Removing now redundant JS namespace prefixes
- Updating includes to use absolute <LibJS/...> paths
- Updating the SPDX-License-Identifier comments from MIT to BSD-2-Clause

I gained permission to change the license and upstream these changes
from all the major contributors to this code: Ali, Andrew, David, Idan.

The removal of the code from the source repository is here:
https://github.com/linusg/libjs-test262/pull/54

This is only the first step, the goal is to eventually upstream the
actual libjs-test262-runner executable and supporting Python scripts
into SerenityOS as well.
2022-03-29 21:01:08 +01:00
Andreas Kling e7eb6241c2 LibWeb: Ignore list-item marker boxes in height:auto calculation 2022-03-29 21:50:31 +02:00
Daniel Bertalan 941d152a88 Ports: Stop zlib from trying to use the host linker
Backports an upstream fix for a bug that caused the host compiler to be
used for linking even though the cross-compiler was specified in the
`CC` environment variable.

This didn't cause an issue for SERENITY_ARCH=i686 on Linux hosts,
because seeing that the host linker couldn't deal with i686 objects, the
configure script fell back to generating only a static library. On
x86-64, the host toolchain was able to deal with the object files, but
tried to link those to host libraries. On macOS hosts, nothing worked.
2022-03-29 20:25:36 +02:00
Andreas Kling 5da7ebb806 LibWeb: Make height:auto for non-BFC-root blocks more correct
Unlike BFC root blocks with height:auto, when the block *isn't* a BFC
root, we don't have to look for the "bottommost" block-level child and
determine the width from that.

Instead, we should just look at the last in-flow block-level child.
This was already indicated in the spec comment next to the code, but
the code itself was wrong.

This makes the body element on Acid3 have the correct height. It also
introduces a small regression on Acid2 that we'll have to track down.
2022-03-29 18:53:27 +02:00
Andreas Kling 18048efce0 LibWeb: Don't round numbers too early when painting backgrounds
Preserve floating point precision and delay rounding until the last
moment when figuring out where to paint background layers. This fixes an
issue on Acid3 where a thin sliver of red was visible because the
background X position was incorrectly rounded by 1px.
2022-03-29 18:53:27 +02:00
Andreas Kling afebc372b9 LibGfx: Use llroundf() in Rect<float>::to_rounded()
No need to drag the values through a float-to-double conversion.
2022-03-29 18:53:27 +02:00
Daniel Glazman fdf1c3c2f1 LibWeb: More tests for attribute selectors 2022-03-29 18:53:20 +02:00