Commit Graph

49793 Commits

Author SHA1 Message Date
Emil Militzer
3f7a37465d LibWeb: Add missing inline-grid for display CSS property 2023-05-02 20:27:28 +02:00
Aliaksandr Kalenik
f6ff37398c LibWeb: Fix intrinsic sizing when min or max width is specified
Fixes the problem that width is incorrectly computed in intrinsic
sizing mode when there are blocks that have min-width or max-width
specified.

Actually that is just the fix of a symptom of the larger problem that
Length::to_px() returns 0 when value is auto regardless of available
size.
2023-05-02 18:50:26 +02:00
Nico Weber
9bd35fda56 ICC: Implement TRC inversion in from_pcs for parametric curves 2023-05-02 17:15:48 +01:00
Nico Weber
4169c94ebe ICC: Implement some of Profile::from_pcs()
This implements conversion from profile connection space to the
device-dependent color for matrix-based profiles.

It only does the inverse color transform but does not yet do the
inverse tone reproduction curve transform -- i.e. it doesn't
implement many cases (LUT transforms), and it does the one thing
it does implement incorrectly. But to vindicate the commit a bit,
it also does the incorrect thing very inefficiently.
2023-05-02 17:15:48 +01:00
Nico Weber
2319b2ffb5 ICC: Use snake_case instead of matching spec's camelCase in to_pcs() 2023-05-02 17:15:48 +01:00
Nico Weber
72f0575fb0 LibGfx: Fix -Wdouble-promotion for float matrices 2023-05-02 17:15:48 +01:00
Nico Weber
82bd7c33d1 ICC: Make a "not yet implemented" string more precise 2023-05-02 17:15:48 +01:00
Nico Weber
103f818afc ICC: Rename tag_for_rendering_intent()
To make clear it's for forward transforms, it's now called
forward_transform_tag_for_rendering_intent().

No behavior change.
2023-05-02 17:15:48 +01:00
Ali Mohammad Pur
2306219ef9 AK: Accomodate always-32-bit data member pointers in IntrusiveList
This only exists on windows, but we've made an effort to keep jakt
working on windows, so let's support this silliness.
2023-05-02 17:46:39 +03:30
Daniel Bertalan
be7bc41470 LibJS: Fix mix-up between assignment and comparison 2023-05-02 07:03:57 -04:00
Daniel Bertalan
00b4976f2c Everywhere: Make Lagom build with GCC 13
GCC 13 was released on 2023-04-26. This commit fixes Lagom build errors
when using an updated host toolchain:
- Adds a workaround for a bug in constraint handling, which made LibJS
  fail to compile: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109683
- Silences the new `-Wdangling-reference` diagnostic globally. It
  produces multiple false positives with no clear way to silence them
  without `#pragmas`.
- Silences `-Wself-move` in `RefPtr` tests as GCC 13 adds this
  previously Clang-exclusive warning.
2023-05-02 07:03:57 -04:00
Zaggy1024
1422f7f904 LibVideo/VP9: Revert framebuffer size reduction to allow OOB blocks
The framebuffer size was reduced in f2c0cee, but this caused some niche
block layouts to write outside of the frame.

This could be fixed by adding checks to see if a block being predicted/
reconstructed is within the frame, but the branches introduced by that
reduce performance slightly. Therefore, it's better to keep the
framebuffer sized according to the decoded frame size in 8x8 blocks so
that any block can be decoded without bounds checking.

A test was added to ensure that this continues to work.
2023-05-02 07:00:46 -04:00
Aliaksandr Kalenik
6cec431720 LibWeb: Set zero underflow when calculating intrinsic width of block
This fix resolves issue where calculating the min size of a block could
result in incorrect value if width of the block's children was
compensated by margins to fit into container width (which is equal to 0
during min size calculation).
2023-05-02 12:41:45 +02:00
Andreas Kling
00e3e82bbd LibWeb: Account for box-sizing:border-box in layout-less definite sizes
When we determine that a size is definite because it can be resolved now
without performing layout, we also need to account for the box-sizing
property.

This lets us remove a hack from flex layout where box-sizing:border-box
was manually undone at one point in the layout algorithm.
2023-05-02 11:47:13 +02:00
Andreas Kling
deea7cbc11 LibWeb: Remove vestigial resolve_definite_width/height helper functions
These functions no longer do anything interesting and just forward to
content_width/content_height. Let's make the callers use those directly
instead and remove this indirection layer.
2023-05-02 11:47:13 +02:00
Joel Petersson
e98315de6b SoundPlayer: Fix glitchy visualization on pause/stop
Previously when pausing or stoping a track in SoundPlayer,
the visualizations would glitch out. This was caused by them
being updated with the same buffer over and over.
With this patch a pause action will freeze the visualization at the
point of the pause and a stop action will reset the visualization
so it displays nothing until a track is started.
2023-05-02 09:15:20 +02:00
Joel Petersson
f1d8e55168 SoundPlayer: Introduce buffer_reset api to VisualizationWidget
Previously there was no way to clear the internal buffer in a
VisualizationWidget. These buffers are what determines how a
VisualizationWidget is rendered, so with this commit we are now
able to reset visualizations.
2023-05-02 09:15:20 +02:00
Caoimhe
d05cb50b24 LibGUI: Only clear TreeView::m_view_metadata when required
Prior to this commit, we were always clearing the TreeView's metadata,
even if it wasn't needed. Now, we only clear it if the callee says that
we should invalidate indices.

This fixes an issue in FileManager (#6903), where updating the file
system by creating/deleting any file/folder would cause the tree to
collapse completely.

This may be more of a 'patch' than an actual fix, since I don't have a
lot of experience with `GUI::TreeView` or `GUI::Model`, but it doesn't
appear to break any other `TreeView` use-cases and using FileManager is
now much better than it was before :^)
2023-05-02 07:24:55 +02:00
Ali Mohammad Pur
8d446d2a9e LibWeb: Make XMLDocumentBuilder create elements with the HTML namespace
Otherwise we'll end up with all-generic elements and not run any special
HTML sauce logic, leading to very plain pages.
2023-05-01 15:22:55 +02:00
Andreas Kling
75d603c31b LibWeb: Support getting the grid-template-areas from resolved style
Without this, we crash when opening the DOM inspector.
2023-05-01 11:23:40 +02:00
Andreas Kling
9fa51987f8 Userland+Base: Treat ".webp" files as images :^) 2023-05-01 11:10:56 +02:00
Andreas Kling
676e1c2cdc CertificateSettings: Add missing ellipsis on import/export buttons 2023-05-01 11:10:18 +02:00
Fabian Dellwing
006d2e6508 nc: Fix overflow in port and local_port argument 2023-04-30 21:12:46 +03:30
Fabian Dellwing
4ebc7306da LibCore: Implement integral ArgsParser positionals through a template
This matches the behaviour of options.
2023-04-30 21:12:46 +03:30
Fabian Dellwing
f4ed9d5d83 LibCore: Add support for short integral type to ArgsParser 2023-04-30 21:12:46 +03:30
Fabian Dellwing
8f34478e75 Ports: Add ssmtp port 2023-04-30 19:23:08 +02:00
Jelle Raaijmakers
1951f7874d LibELF: Report file path for unimplemented DYNAMIC tags
This allows us to immediately locate the shared library with the
unimplemented tag.
2023-04-30 14:10:01 +02:00
Andreas Kling
98b8bab441 LibGUI: Use Variant's built-in equality operator in Window and Widget
Now that Variant has operator==(), we don't need to go through all this
trouble to compare two Variant values.
2023-04-30 14:01:59 +02:00
iyush
a268dcb1e2 HackStudio: Move around execution order and prevent crashing
Previously hackstudio tried to synchronize the language server before
executing the command inside the editor.  If sync-command for the server
(for example the CommentLineCommand) is not implemented inside the
function responsible for syncing the language server, the IDE would
crash.

This patch makes it such that the synchronization happens only after IDE
executes the command locally.  If such command is not implemented (as
was the case earlier), it would simply reupdate the content inside the
language server. Even though the reupdate might be expensive, it is
better than crashing hackstudio altogether.

Because of reordering, the relevant function names have been changed to
better reflect the code flow.
2023-04-30 06:08:22 +02:00
Dan Klishch
4653b38808 AK: Replace linear exponentiation by binary in MinimalBigInt
This further optimizes floating point parsing (specifically with a large
amount of digits). The commit shaves additional 20% of the run time for
750-digit numbers. No performance degradation is noticeable for small
numbers.
2023-04-30 06:05:54 +02:00
Dan Klishch
80517b5a70 AK: Use helpers from BigIntBase.h in MinimalBigInt
Although it might seem like we've switched to more generic functions,
which must run slower, it is not the case. The time required to parse
"1", for example, decreased by 1%. For numbers with more digits, the
effect is more noticeable: 8-digit numbers are parsed ~5% faster; for
gigantic 750-digit numbers, parsing is 2 times faster.

The later result is achieved by using UFixedBigInt<64>::wide_multiply
instead of u128::operator*(u128).
2023-04-30 06:05:54 +02:00
Dan Klishch
a179383dcc AK: Add benchmarks for floating point parsing 2023-04-30 06:05:54 +02:00
Dan Klishch
3c900765bc AK: Move taint_for_optimizer to StdLibExtras.h
Additionally, split it into two versions (for IsIntegral<T> -- asking
to place value into register and for !IsIntegral<T> -- asking to place
value into memory with memory clobber), so that Clang is no more
completely confused about `taint_for_optimizer(AK::StringView&)`.
2023-04-30 06:05:54 +02:00
Matthew Olsson
a9d192e882 LibJS+LibWeb: Explicitly mark ignored members in visit_edges methods 2023-04-30 06:04:33 +02:00
Matthew Olsson
39d8c8d2a9 LibJS+LibWeb: Add missing visit calls in visit_edges implementations 2023-04-30 06:04:33 +02:00
Matthew Olsson
a3344cab63 LibWeb: Fix incorrect usage of JS::GCPtr 2023-04-30 06:04:33 +02:00
Matthew Olsson
48d92eecac Lagom: Enforce GC-allocated fields are visited in LibJSGCVerifier 2023-04-30 06:04:33 +02:00
Matthew Olsson
82eeee2008 LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objects 2023-04-30 06:04:33 +02:00
Matthew Olsson
98ed74087f Lagom: Enforce uniform calls to Base::visit_edges in LibJSGCVerifier
This ensures that all visit_edges implementations include a call to
Base::visit_edges. In particular, this gives three nice benefits:

  - The call can't be forgotten (the main benefit, of course).
  - All of the calls look the same. In other words, always use "Base"
    instead of the actual concrete class.
  - Ensure the object has a call to JS_CELL or JS_OBJECT in the
    definition. Otherwise, Base will not be defined and the call will
    not compile.
2023-04-30 06:04:33 +02:00
Matthew Olsson
3f22919eb5 LibWeb: Add missing JS::GCPtr wrappers in HTMLLinkElement 2023-04-30 06:04:33 +02:00
Liav A
bc3eb6d65f Kernel/VirtIO: Use proper error propagation from the get_config method
This allows us to drop null-checks at call-sites, thus simplifying the
code and reducing the chance of nullptr-dereference errors.
2023-04-30 06:03:47 +02:00
Liav A
87a32ab869 Kernel/VirtIO: Improve error handling during device initialization
Rename the initialize method to initialize_virtio_resources so it's
clear what this method is intended for.

To ensure healthier device initialization, we could also return the type
of ErrorOr<void> from this method, so in all overriden instances and in
the original method code, we could leverage TRY() pattern which also
does simplify the code a bit.
2023-04-30 06:03:47 +02:00
Liav A
aa985a0570 Kernel/VirtIO: Move declarations and definitions to a separate file 2023-04-30 06:03:47 +02:00
Zaggy1024
2ec043c4db LibVideo/VP9: Make inter-prediction fast path accumulators 32-bit
Some occasional cases could cause the accumulator to overflow and have
an incorrect result. It would be nice to use a smaller accumulator, but
it seems not to be correct. :^(

We now cast to i16 to allow 128-bit vectorization to make use of one
whole register instead of having to split the loop into multiple.

This results in about a 5% reduction in performance in my testing.
2023-04-30 05:58:27 +02:00
Nico Weber
3a5d20d82b icc: Add a --measure flag that prints color difference in profile
If --measure is passed, icc prints the color pairs with the smallest
and largest perceptual difference between them.

Converting 254 * 254 * 254 * 4 = 65 Million colors from sRGB to LAB
and then computing 254 * 254 * 254 * 3 = 49 Million DeltaEs between
them takes a while. On my laptop, it takes 17s to run. So there's
a small progress display.
2023-04-30 05:57:20 +02:00
Nico Weber
8ab6e0d3a5 ICC: Mark Profile::to_pcs() and to_lab() const 2023-04-30 05:57:20 +02:00
Nico Weber
cd81b3e2fa TestICCProfile: Don't capture sRGB by value
No behavior change.
2023-04-30 05:57:20 +02:00
Nico Weber
923027b1df LibGfx: Add DeltaE() function 2023-04-30 05:57:20 +02:00
Nico Weber
adec1abf81 LibGfx: Move CIELAB to its own file 2023-04-30 05:57:20 +02:00
martinfalisse
22202715fc LibWeb: Parse grid-template property 2023-04-30 05:56:10 +02:00