Commit graph

45719 commits

Author SHA1 Message Date
Tim Schumacher
7e3625b0e2 LibCompress: Move compressor construction out of ZlibCompressor() 2023-01-10 10:28:26 +01:00
Tim Schumacher
f4afee4278 LibCompress: Switch DeflateCompressor to a fallible constructor 2023-01-10 10:28:26 +01:00
Tim Schumacher
8cd2cf2b77 LibCompress: Port DeflateCompressor to Core::Stream 2023-01-10 10:28:26 +01:00
Tim Schumacher
a212bc3052 LibCompress: Port GzipCompressor to Core::Stream 2023-01-10 10:28:26 +01:00
Tim Schumacher
b4b80b7ec6 LibCore: Add {Big,Little}EndianOutputBitStream
Also add some tests that ensure that the input and output streams match
each other, because I can't wrap my head around what the internal
representation looks like.
2023-01-10 10:28:26 +01:00
Tim Schumacher
0bdbe27d6b LibCore: Rename InputBitStream.h to BitStream.h
We won't just be defining readable streams here from now on, but also
writable streams.
2023-01-10 10:28:26 +01:00
MacDue
c8c065b6b0 LibWeb+LibGfx: Migrate (most of) the CSS gradient painting to LibGfx
This moves the CSS gradient painting to the painter creating:

 - Painter::fill_rect_with_linear_gradient()
 - Painter::fill_rect_with_conic_gradient()
 - Painter::fill_rect_with_radial_gradient()

This has a few benefits:
 - The gradients can now easily respect the painter scale
 - The Painter::fill_pixels() escape hatch can be removed
 - We can remove the old fixed color stop gradient code
    - The old functions are  now just a shim
 - Anywhere can now easily use this gradient painting code!

This only leaves the color stop resolution in LibWeb (which is fine).
Just means in LibGfx you have to actually specify color stop positions.

(Also while here add a small optimization to avoid generating
excessively long gradient lines)
2023-01-10 10:25:58 +01:00
MacDue
668204041b AK: Add Span::first()
The missing sibling to Span::last()!
2023-01-10 10:25:58 +01:00
Aliaksandr Kalenik
30b51b06b9 LibWeb: Fix y position calculation for blocks with clearance
This change fixes problem that y position of blocks with
clearance might not include border_top and padding_top
by changing `place_block_level_element_in_normal_flow_vertically`
to accept y position without `border_box_top` and adding it
on the last step when clearance is already taken in account.

Bug reproducer:
```html
<style>
.a {
    border: 10px salmon solid;
    width: 50px;
    height: 50px;
    float: left;
}
.b {
    clear: both;
    border: 20px slateblue solid;
    width: 50px;
    height: 50px;
}
</style>
<div class="a"></div><div class="b"></div><div class="c"></div>
```
2023-01-10 10:24:05 +01:00
Linus Groh
7762c1ac61 LibJS: Verify that objects are only initialized once
We already do this in a couple of other places, we wouldn't ever want to
re-assign already initialized constructor and prototype objects.
2023-01-09 22:14:35 -05:00
Linus Groh
63136615d2 LibJS: Make namespace object initialization lazy as well 2023-01-09 22:14:35 -05:00
Linus Groh
76f89bf50d LibJS: Use intrinsic namespace objects in set_default_global_bindings()
We were accidentally allocating a new instance for each of the namespace
objects. Use the existing ones from the realm's intrinsics instead.
2023-01-09 22:14:35 -05:00
Taj Morton
20991a6a3c Kernel/FileSystem: Fix kernel panic during FS init or mount failure
Resolves issue where a panic would occur if the file system failed to
initialize or mount, due to how the FileSystem was already added to
VFS's list. The newly-created FileSystem destructor would fail as a
result of the object still remaining in the IntrusiveList.
2023-01-09 19:26:01 -07:00
Timothy Flynn
6fcc1c7426 AK+LibUnicode: Provide Unicode-aware String case transformations
Since AK can't refer to LibUnicode directly, the strategy here is that
if you need case transformations, you can link LibUnicode and receive
them. If you try to use either of these methods without linking it, then
you'll of course get a linker error (note we don't do any fallbacks to
e.g. ASCII case transformations). If you don't need these methods, you
don't have to link LibUnicode.
2023-01-09 19:23:46 -07:00
Timothy Flynn
12f6793223 LibUnicode: Move Unicode-aware case transformations to a helper file
These will be needed by AK::String as well, so move them to a helper
file where they can be re-used.
2023-01-09 19:23:46 -07:00
Nico Weber
2949824849 Toolchain: Do not use install -D in BuildIt.sh
`-D` doesn't exist on macOS. Just call `mkdir -p` instead.
2023-01-09 19:23:20 -07:00
Nico Weber
491af34d36 Toolchain: Add macOS definitions of MD5SUM and NPROC in BuildIt.sh 2023-01-09 19:23:20 -07:00
Nico Weber
f2011ad0dd Toolchain: Make BuildCMake.sh work on macOS without brew on PATH 2023-01-09 19:23:20 -07:00
Timothy Flynn
f3db548a3d AK+Everywhere: Rename FlyString to DeprecatedFlyString
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so
let's rename it to A) match the name of DeprecatedString, B) write a new
FlyString class that is tied to String.
2023-01-09 23:00:24 +00:00
Timothy Flynn
2eacc7aec1 AK: Add Utf16View::to_utf8 to convert the view to a UTF-8 AK::String 2023-01-09 23:00:24 +00:00
Timothy Flynn
d0403ec14f AK+Everywhere: Rename Utf16View::to_utf8 to to_deprecated_string
A subsequent commit will add to_utf8 back to create an AK::String.
2023-01-09 23:00:24 +00:00
Julian Offenhäuser
2a70ea3ee7 LibPDF: Propagate errors in PDFFont::create() 2023-01-09 22:54:36 +00:00
Julian Offenhäuser
ac31b1bda3 LibPDF: Make glyphs from standard 14 fonts show up in Type1Font
Previously, we would assume that all standard 14 fonts use a
TrueTypeFont dictionary. Now we render them in Type1Font as well,
given that it doesn't contain a PostScript font program.
2023-01-09 22:54:36 +00:00
Julian Offenhäuser
a37f3390dc LibPDF: Allow numbers to start with whitespace 2023-01-09 22:54:36 +00:00
Karol Kosek
ab57fde8ec LibWebView: Port to Core::Stream 2023-01-09 22:50:53 +00:00
Karol Kosek
e3d9a3426e Ladybird: Port to Core::Stream::File 2023-01-09 22:50:53 +00:00
Timothy Flynn
3d22efccca LibUnicode+LibJS: Propagate OOM from Unicode normalization 2023-01-09 22:48:15 +00:00
Timothy Flynn
1ff29afc45 LibUnicode+LibJS+LibWeb: Propagate OOM from Unicode case transformations 2023-01-09 22:48:15 +00:00
Timothy Flynn
48474b0de6 LibJS: Handle OOM errors in String.prototype.replaceAll 2023-01-09 22:48:15 +00:00
Timothy Flynn
57b918807e LibJS: Handle OOM errors in the GetSubstitution AO 2023-01-09 22:48:15 +00:00
Julian Offenhäuser
5b7dfe848d LibGfx: Implement TrimmedTable mappings for Cmaps 2023-01-09 22:38:40 +00:00
Julian Offenhäuser
04ee181b21 LibGfx: Implement ByteEncoding mappings for Cmaps 2023-01-09 22:38:40 +00:00
Julian Offenhäuser
0ff9f2b865 LibGfx: Select a valid TTF cmap subtable for the Macintosh platform
While this subtable ID is supposed to be deprecated, it is used heavily
in PDF files.

It supports mapping one or two-byte values, with quite a large list of
encodings to tell you which one to expect.
For our use case, we ignore this encoding ID and just pick the first
subtable with this platform ID. Unsupported encodings will get caught
by Subtable::glyph_id_for_code_point() anyway.
2023-01-09 22:38:40 +00:00
Jelle Raaijmakers
7c2976e006 Ports: Make sed work on macOS
The ports `libvorbis`, `readline` and `timidity` would not install on
macOS as a result of using `sed -i` without an extension provided. GNU
sed is available through Homebrew, but it does not replace `sed` by
default.

Instead, provide a new `sed_in_place` function that calls `sed` with the
right arguments.
2023-01-09 22:36:50 +00:00
Andreas Kling
3110f5b328 Presenter: Rearchitect on top of LibWeb
This patch replaces the bespoke rendering engine in Presenter with a
simple pipeline that turns presentations into single-page HTML files.
The HTML is then loaded into an OutOfProcessWebView.

This achieves a number of things, most importantly:
- Access to all the CSS features supported by LibWeb
- Sandboxed, multi-process rendering

The code could be simplified a lot further, but I wanted to get the new
architecture in place without changing anything about the file format.
2023-01-09 22:34:57 +00:00
Andreas Kling
ed3c2cbdf6 LibWebView: Add OOPWV "content scales to viewport" hint
By setting this hint, you indicate to OOPWV that the content inside will
scale itself to the viewport size. In such situations, it's fine for
OOPWV to reuse a scaled version of an outdated backing store while the
view is being resized.
2023-01-09 22:34:57 +00:00
Andreas Kling
c55739bbc0 LibGfx: Make Rect::align_within() correct for TopCenter and BottomCenter
Also update the LibGfxDemo to actually show off these alignments.
2023-01-09 19:54:26 +01:00
implicitfield
f63ecc2763 VideoPlayer: Port to GML 2023-01-09 17:32:03 +00:00
implicitfield
f0a33b2a8e VideoPlayer: Propagate errors from VideoPlayerWidget::initialize_menubar 2023-01-09 17:32:03 +00:00
implicitfield
a2ca2d8364 LibGUI: Register "jump_to_cursor" as a GML property 2023-01-09 17:32:03 +00:00
Arda Cinar
33ea96912a SpaceAnalyzer: Do not reset the path to '/' after a refresh
Clicking analyze or deleting a file would always cause the tree view in
the widget to reset back to viewing the root. This was changed to stay
in the directory currently being viewed
2023-01-09 17:08:17 +00:00
Arda Cinar
c045ae1a96 SpaceAnalyzer: Keep the current path via filenames, not indices
The tree map widget keeps the current path to allow the user to navigate
between directories. This path was being kept as indices into the
children array. The indices might change after the tree is regenerated
and this change is required to keep the user's current place after a
re-analysis
2023-01-09 17:08:17 +00:00
Arda Cinar
ba33267132 SpaceAnalyzer: Add a method to TreeNode to get a child node by name
This will make it easier to get to a tree node given a file path
2023-01-09 17:08:17 +00:00
Arda Cinar
0d67e60559 SpaceAnalyzer: Make sure data fields of TreeNode are encapsulated
Made the member fields of Tree and TreeNode structures private and moved
the functions in main.cpp that accessed the internals of these
structures inside the TreeNode class
2023-01-09 17:08:17 +00:00
Arda Cinar
8ba37872e9 SpaceAnalyzer: Remove an unnecessary level of inheritance
The TreeMapNode and TreeMap structs inside TreeMapWidget.h both had
single implementers, TreeNode and Tree inside main.cpp. The indirection
was removed and the new structures were moved to their own file
2023-01-09 17:08:17 +00:00
Andreas Kling
f476b827de Ladybird: Let Qt pick the reload shortcut
This fixes an issue on platforms where Ctrl+R is the preferred native
shortcut, and we were effectively trying to set it twice.
2023-01-09 17:32:00 +01:00
Aliaksandr Kalenik
1242bd5ee5 LibWeb: Move clear property from table-root to table-wrapper
CSS 2.2 only mentions that float property need to be moved
but in practice clear property also need to be moved to
produce correct layout.
2023-01-09 15:47:59 +01:00
Aliaksandr Kalenik
77a2b151ea LibWeb: Use table_box() to get root box in TFC
Introduce `table_box()` function that returns table formatting
context root box casted to `TableBox` similar to how it's done
in other formatting contexts like `root()` in BFC and
`flex_container` in FFC. And replace `context_box()` calls
in TFC with calls to `table_box()`.
2023-01-09 15:06:27 +01:00
Aliaksandr Kalenik
f26eed9633 LibWeb: Rename used_width to used_height in TFC row struct
Rename used_width to used_height because it is used
to store row height.
2023-01-09 15:06:27 +01:00
Aliaksandr Kalenik
0e1da540b6 LibWeb: Move cells positioning in separate function in TFC 2023-01-09 15:06:27 +01:00