Commit graph

48623 commits

Author SHA1 Message Date
Coderdreams
14c9ef2563 Ladybird: Open target _blank links in new tab 2023-03-26 21:22:58 +01:00
Aliaksandr Kalenik
05a2d1f0e0 LibWeb/WebDriver: Wait for more data to arrive if request is incomplete
Currently significant portion of requests coming to WebDriver server
fails with error while parsing json body because requests are parsed
when they are not complete yet.

This change solves this by waiting for more data to arrive if HTTP
request parser found that there is not enough data yet to parse
the whole request.

In the future we would probably want to move this logic to LibHTTP
because this problem is relevant for any HTTP server.
2023-03-26 17:56:17 +02:00
Aliaksandr Kalenik
7b8a857e30 LibHTTP: Return error if request is incomplete
If there is not enough input to completely parse HTTP request we need
to return error and handle it in HTTP server.
2023-03-26 17:56:17 +02:00
Aliaksandr Kalenik
9220cdc285 LibHTTP+WebDriver+WebServer: Return error from HTTP request parser 2023-03-26 17:56:17 +02:00
Aliaksandr Kalenik
5b31d1208f LibWeb: Run XML parser input through encoding decoder
Fixes the issue that XML parser fails when loader passes input that is
prefixed with byte order mark.

Also it generally makes sense to pass text source through encoding
decoder before parsing. Probably we would even want to introduce method
similar to `create_with_uncertain_encoding` in `HTMLParser` but for
`XMLParser` to be make harder unconsciously pass non-UTF8 input to XML
parser.
2023-03-26 15:48:45 +01:00
Timothy Flynn
04b51e39d6 LibTimeZone: Update to TZDB version 2023b
https://mm.icann.org/pipermail/tz-announce/2023-March/000078.html
2023-03-26 15:43:40 +01:00
Timothy Flynn
b3d033f027 LibWeb: Declare overflow_value_makes_box_a_scroll_container as static
It is only used in this file, and not being declared static gives a "no
previous declaration" error.
2023-03-26 10:38:05 -04:00
Cameron Youell
f251ff0521 LibWeb: Fix non return in overflow value check 2023-03-26 15:03:43 +01:00
Andreas Kling
949483fb01 Tests/LibWeb: Test flex column item with auto height and max-width
This case is important because we have to clamp the width before using
it to determine the auto height.
2023-03-26 15:14:35 +02:00
Andreas Kling
5b030a6923 Tests/LibWeb: Add test for flex item auto height with flex-wrap: wrap 2023-03-26 15:14:35 +02:00
Andreas Kling
2699f226fb LibWeb: Don't compute main axis "auto min-size" for flex item cross axis
The "flex item automatic minimum size in the main axis is the
content-based minimum size" behavior should only apply to flex item
sizes in the main axis. There was one case where we incorrectly applied
this behavior in the cross axis
2023-03-26 15:14:35 +02:00
Andreas Kling
1f7e6cc022 LibWeb: Use zero automatic minimum size for scroll-container flex items
The "flex item automatic minimum size in the main axis is the
content-based minimum size" behavior should only apply to flex items
that aren't scroll containers. We were doing it for all flex items.
2023-03-26 15:14:35 +02:00
Andreas Kling
8038824211 LibWeb: Add Layout::Box::is_scroll_container()
The computed `overflow` property values determine whether a box is a
scroll container or not, so let's have a simple helper for asking this.
2023-03-26 15:14:35 +02:00
Andreas Kling
3932afdc6a LibWeb: Remove unnecessary repeat of partial flex layout algorithm
When calculating one of the intrinsic sizes for a flex container, we
already go through the flex layout algorithm.

There's no need to perform some of the algorithm steps a second time.
This is a relic from an earlier time when we tried to bail early from
the layout algorithm in  the intrinsic sizing case. Now that we go
through the whole thing anyway, this is much simpler. :^)
2023-03-26 15:14:35 +02:00
MacDue
d38392d416 Base: Use radio button groups on accent-color demo page 2023-03-26 15:09:57 +02:00
MacDue
bcfe275563 Base: Add two more radio buttons to HTML input test page
You can't really test radio buttons with just one button.
2023-03-26 15:09:57 +02:00
MacDue
f96747b722 LibWeb: Check all conditions of radio button groups
This fixes a few issues I noticed when playing around with radio
buttons. Previously radio buttons would uncheck checkboxes with
the same "name" attribute, uncheck inputs across different forms,
and treated no name attribute as a group.

This now implements the radio button group check from the HTML spec.
2023-03-26 15:09:57 +02:00
Jelle Raaijmakers
256030da4e PixelPaint: Correctly set default layer name
Previously, if you confirmed the "new layer" dialog without any change
to the layer name, the layer would end up with an empty string for its
name.
2023-03-26 12:30:58 +01:00
Cameron Youell
f17bee0cb5 LibWeb: Fix mistype in LayoutState 2023-03-26 13:28:07 +02:00
Tim Ledbetter
30b3c30aba PixelPaint: Remove unused function definition from Image 2023-03-26 01:49:58 +01:00
Tim Ledbetter
8b4158633b PixelPaint: Use new String to format error messages 2023-03-26 00:47:29 +01:00
Tim Ledbetter
5b84fafbca PixelPaint: Include possible errno description in error messages
In the case where an error is created from an errno, calling
string_literal() will print nothing. Using Error's formatter
instead gives a more descriptive error message.
2023-03-26 00:47:29 +01:00
Tim Ledbetter
3faf089be5 PixelPaint: Add a Duplicate Layer action
The "Duplicate Layer" action inserts a copy of the selected layer into
the layer stack. The new layer is placed above the selected layer.
2023-03-26 00:44:26 +01:00
Tim Ledbetter
55feecee36 PixelPaint: Make wand tool work when layer and image rects differ
Previously, the position of the mask used to calculate the new
selection did not match the position of the active layer. The program
would crash when trying to set a mask pixel outside the bounds of the
active layer.
2023-03-26 00:21:29 +01:00
Julian Offenhäuser
bdd5f36121 LibPDF: Load replacements for TrueTypeFonts without an embedded font
This previously only happened for Type 1 fonts.
2023-03-25 16:27:30 -06:00
Julian Offenhäuser
5deac3a7f5 LibPDF: Actually return an error when failing to load replacement fonts 2023-03-25 16:27:30 -06:00
Julian Offenhäuser
fec7ccf020 LibPDF: Ask OpenType font programs for glyph widths if needed
If the font dictionary didn't specify custom glyph widths, we would fall
back to the specified "missing width" (or 0 in most cases!), which meant
that we would draw glyphs on top of each other in a lot of cases, namely
for TrueTypeFonts or standard Type1Fonts with an OpenType fallback.

What we actually want to do in this case is ask the OpenType font for
the correct width.
2023-03-25 16:27:30 -06:00
Julian Offenhäuser
2b3a41be74 LibPDF: Remove the subroutine length limit for PS1 font programs
A limit of 1024 subroutines seemed like a sensible choice, but some
fonts actually do exceed it. We will now only assert that the specified
amount is positive.
2023-03-25 16:27:30 -06:00
Julian Offenhäuser
4ec01669fc LibPDF: Scale vector paths with the view
This ensures that lines have the correct size at every scale factor.
2023-03-25 16:27:30 -06:00
Julian Offenhäuser
731676c041 LibPDF: Accept floats as line dash pattern phases 2023-03-25 16:27:30 -06:00
Julian Offenhäuser
95a804bc4e LibPDF: Allow the page rotation to be inherited 2023-03-25 16:27:30 -06:00
Julian Offenhäuser
b90a794d78 LibPDF: Allow pages with no specified contents
The contents object may be omitted as per spec, which will just leave
the page blank.
2023-03-25 16:27:30 -06:00
Julian Offenhäuser
fde990ead8 LibPDF: Allow optional inheritable page attributes
Previously, get_inheritable_object would always try to find the object
and throw an error if it couldn't. The spec tells us that some page
attributes, like CropBox, are optional but also inheritable. Others,
like the media box and resources, are technically required by the spec,
but omitted by some documents.

In both cases, we are now able to search for inheritable objects and
find a suitable replacement if there wasn't one.
2023-03-25 16:27:30 -06:00
Julian Offenhäuser
320f5f91ab LibPDF: Ignore whitespace in the ASCII hex filter
The spec tells us that any amount of whitespace may appear between the
hex digits and that it should just be ignored.
2023-03-25 16:27:30 -06:00
Nico Weber
29796f8f5e LibCrypto: Use 8-byte crc32 instruction on arm too
Takes

    % time Build/lagom/gunzip -c \
        /Users/thakis/Downloads/trace_bug.json.gz > /dev/null

from 3.9s to 3.87s.
2023-03-25 21:42:50 +00:00
Nico Weber
0452a8ed4b LibCrypto: Start sometimes hardware-accelerating crc32
Takes

    % time Build/lagom/gunzip -c \
        /Users/thakis/Downloads/trace_bug.json.gz > /dev/null

from 4s to 3.9s on my MBP.
2023-03-25 21:42:50 +00:00
Nico Weber
ee6843a13c Meta: Add "gunzip" and "gzip" to lagom build
This makes it easy to compare the performance of Serenity's
deflate implementation to the host system implementation.

On my M1 Max MBP:

    % time gunzip -c \
        /Users/thakis/Downloads/trace_bug.json.gz > /dev/null

takes between 0.064s and 0.082s.

    % time Build/lagom/gunzip -c \
        /Users/thakis/Downloads/trace_bug.json.gz > /dev/null

on the other hand takes 4 seconds.

(That .gz file is a 5.8M file -- the largest .gz file that happend to be
in my Downloads folder.)
2023-03-25 21:42:50 +00:00
Lucas CHOLLET
3323127db0 LibGUI: Allow blocking modals and popups to handle their own shortcuts
Since ef7d9c0, shortcut propagation was blocked for blocking modals and
popups. This however is an issue as some blocking modals (like
FilePicker) use shortcuts. This patch allows propagation of shortcuts
but only until the current window.
2023-03-25 21:42:53 +01:00
Lucas CHOLLET
baac824ee3 LibGUI: Make propagate_shortcuts handle different level of propagation
First, this patch renames the function
`propagate_shortcuts_up_to_application` to `propagate_shortcuts`.
Handling those levels, will allow us to differentiate shortcuts at
`Window` level and `Application` level. Which will be convenient to
handle dialog-specific shortcuts.
2023-03-25 21:42:53 +01:00
Cubic Love
0b14ef134d Base: Add Keyboard Shortcuts & Tips and Tricks man pages
Add a list of system and general keyboard shortcuts as well as a list
of tips and tricks to man7 (Miscellanea). Add links to these in the
Help-index to aid discoverability for new users.
2023-03-25 14:35:11 -06:00
Cubic Love
911baf3b7c Base: Add keyboard symbols to Katica Regular 12
These symbols represent common icons found on a user's keyboard
(PC and Mac). Now it will be possible for these icons to be used in
documentation (if desired) as Katica Regular 12 is used by LibMarkdown/
the Help application. Some bonus symbols have been added where they've
been easy to make along the way.

https://www.unicode.org/charts/PDF/U1F100.pdf
1F130

https://www.unicode.org/charts/PDF/U2190.pdf
2190-2193, 21B7, 21B9, 21DE-21DF, 21E4-21F3

https://www.unicode.org/charts/PDF/U2200.pdf
229E

https://www.unicode.org/charts/PDF/U2300.pdf
2303, 2318, 2324-2327, 232B, 2370, 2380, 2384, 2386, 2388, 238B-238C,
2397-239A, 23CE, 23FB-23FE

https://www.unicode.org/charts/PDF/U2460.pdf
24D8

https://www.unicode.org/charts/PDF/U25A0.pdf
25A4, 25B2-25B3, 25B7, 25BC-25BD, 25C1, 25C6-25C8

https://www.unicode.org/charts/PDF/U2700.pdf
2726-2727, 2732

https://www.unicode.org/charts/PDF/U27F0.pdf
27F3, 27F5-27F7

https://www.unicode.org/charts/PDF/U2B00.pdf
2B58

https://www.unicode.org/charts/PDF/U2900.pdf
2912-2913
2023-03-25 14:35:11 -06:00
Lucas CHOLLET
3f9c5af553 LibGfx/JPEG: More support for scans with a single component
Introduced in 2c98eff, support for non-interleaved scans was not working
for frames with a number of MCU per line or column that is odd. Indeed,
the decoder assumed that they have scans that include a fabricated MCU
like scans with multiple components.

This patch makes the decoder handle images with a number of MCU per line
or column that is odd. To do so, as in the current decoder state we do
not know if components are interleaved at allocation time, we skip over
falsely-created macroblocks when filling them. As stated in 2c98eff,
this is probably not a good solution and a whole refactor will be
welcome.

It also comes with a test that open a square image with a side of 600px,
meaning 75 MCUs.
2023-03-25 21:31:21 +01:00
Lucas CHOLLET
b820f9ffbd LibGfx/JPEG: Rename mb_index to macroblock_index 2023-03-25 21:31:21 +01:00
Lucas CHOLLET
3d7888f309 LibGfx/JPEG: Log components present in a scan 2023-03-25 21:31:21 +01:00
Jelle Raaijmakers
e18c87c60c Meta: Make audio hardware configurable through environment variable
The new environment variable `SERENITY_AUDIO_HARDWARE` accepts the
values `ac97` and `intelhda` (default).
2023-03-25 21:27:03 +01:00
Jelle Raaijmakers
dd0a25de4d Meta: Use more aptly named variable for PC speaker configuration 2023-03-25 21:27:03 +01:00
Jelle Raaijmakers
dd8fa73da1 Kernel: Add support for Intel HDA
This is an implementation that tries to follow the spec as closely as
possible, and works with Qemu's Intel HDA and some bare metal HDA
controllers out there. Compiling with `INTEL_HDA_DEBUG=on` will provide
a lot of detailed information that could help us getting this to work
on more bare metal controllers as well :^)

Output format is limited to `i16` samples for now.
2023-03-25 21:27:03 +01:00
Jelle Raaijmakers
c530f74e2f Kernel: Mention right parent class for AC'97's device_name 2023-03-25 21:27:03 +01:00
Andreas Kling
b3b9ac6201 LibWeb: Add FIXME whining to debug log if layout produces negative sizes
Negative width/height sizes are not allowed in CSS, so if our layout
algorithm resolves something to a negative size, we have boogs.

Instead of crashing or rendering something very wrong, we now clamp the
values to 0 and whine on the debug log so that someone can go and figure
out how we got the negative values in the first place. :^)
2023-03-25 19:41:31 +01:00
Andreas Kling
4bf10674fa LibWeb: Don't allow resolved height of abspos elements to become negative
We have to clamp the resulting height to 0 when solving for it.
2023-03-25 19:41:31 +01:00