Commit graph

58246 commits

Author SHA1 Message Date
MacDue
e9e1ee11d4 LibGfx: Decrease flatness a little in Path::stroke_to_fill()
Noticed larger stroke widths were looking a little 'low poly', this
looks a little nicer.

(Minor LibWeb test changes)
2024-01-21 19:23:31 +01:00
Tim Ledbetter
58df9c45b9 LibWeb: Avoid division by zero when computing table width
Previously, a crash could occur when computing the width of a table
with cells that had a percentage width of 0.
2024-01-21 16:11:25 +01:00
Aliaksandr Kalenik
21364711da LibWeb/WebGL: Switch context in AccelGfxContext destructor
Destructor of AccelGfxContext needs to make sure that correct OpenGL
context is active so that destructors of its members could proceed
destroying they resources (for example framebuffer owned by
AccelGfx::Canvas).

Fixes https://github.com/SerenityOS/serenity/issues/22879
2024-01-21 16:09:54 +01:00
Aliaksandr Kalenik
215931daac LibWeb/WebGL: Make Context::activate() non-virtual
This method is only relevant for AccelGfx so no reason to keep it
virtual.
2024-01-21 16:09:54 +01:00
Nico Weber
475cef8afd PDFViewer: Remove an unneeded indirection
No behavior change.
2024-01-21 09:32:22 -05:00
Nico Weber
d9267a388d PDFViewer: Add Debug menu entries for disabling clipping 2024-01-21 09:32:22 -05:00
Sam Atkins
9703510682 NotificationServer: Manually calculate the text label height
The layout system can't currently answer the question "what height does
this Label want to be, if it has a certain width available?" Instead it
relies on counting newlines, which doesn't work in a lot of cases. This
made the notification windows look and behave in a funky way when their
text wraps onto multiple lines.

This patch uses TextLayout to measure how many lines we need, and then
manually sets the Label and Window heights to match. It's a bit hacky,
hence the FIXME, but it does make things behave the way they are
supposed to.
2024-01-21 09:32:10 -05:00
Sam Atkins
84e8bf3421 NotificationServer: Convert the notification window contents to GML 2024-01-21 09:32:10 -05:00
Sam Atkins
e4c7b9817b GMLCompiler: Sort enum_properties alphabetically and remove duplicate 2024-01-21 09:32:10 -05:00
Sam Atkins
3df3a85235 LibGfx+Userland: Move FontWeight enum into its own file
FontDatabase.h with its includes add up to quite a lot of code. In the
next commit, compiled GML files are going to need to access the
FontWeight enum, so let's allow them to do that without pulling in lots
of other things.

Also, change users to include FontWeight.h instead of FontDatabase.h
where appropriate.
2024-01-21 09:32:10 -05:00
Tim Ledbetter
9b3f9c46b9 ls: Show T in long mode if sticky bit is set for non-executable files 2024-01-21 08:49:33 -05:00
Tim Ledbetter
0266a32580 ls: Show S in long mode if SUID/SGID bit is set for non-executable files 2024-01-21 08:49:33 -05:00
Tim Ledbetter
ad89aea1fe WidgetGallery: Remove quotes around GML boolean values
These declarations were previously being ignored, leading to some
buttons being erroneously enabled.
2024-01-21 08:38:18 -05:00
Tim Ledbetter
d06f1cbb9c DisplaySettings: Disable custom color scheme combobox by default
Previously, the GML property declaration that does this was being
ignored, as the value was in quotes.
2024-01-21 08:38:18 -05:00
Tim Ledbetter
fd8e8e7f31 DisplaySettings: Remove redundant text_alignment property from GML
Previously, this was causing an error to be shown on the debug console,
as `CenterMiddle` is not a valid value for this property.
2024-01-21 08:38:18 -05:00
Nico Weber
176e9db6cd PDFViewer: Move debug actions from toolbar into a menu
This makes it easier to add more entries. Also, debug toggles
don't need to be quite as visible as they were on the toolbar :^)
2024-01-21 08:22:27 -05:00
Andreas Kling
1041dbb007 LibWeb: Don't lose track of inline margins when collapsing whitespace
When iterating inline level chunks for a piece of text like " hello ",
we will get three separate items from InlineLevelIterator:

- Text " "
- Text "hello"
- Text " "

If the first item also had some leading margin (e.g margin-left: 10px)
we would lose that information when deciding that the whitespace is
collapsible.

This patch fixes the issue by accumulating the amount of leading margin
present in any collapsed whitespace items, and then adding them to the
next non-whitespace item in IFC.

It's a wee bit hackish, but so is the rest of the leading/trailing
margin mechanism.

This makes the header menu on https://www.gimp.org/ look proper. :^)
2024-01-20 23:29:51 +01:00
Aliaksandr Kalenik
c1161111a7 LibWeb: Stop assuming navigable's existance in FrameBox
If the loading of iframe's navigable has not finished by the time
FrameBox layout occurs, we should not crash.

Fixes https://github.com/SerenityOS/serenity/issues/22874
2024-01-20 20:34:30 +00:00
Andreas Kling
b2bc57ff89 LibWeb: Remove unused LineBox::absolute_rect() and related things 2024-01-20 18:26:14 +01:00
Aliaksandr Kalenik
271c9d1ae9 LibWeb: Use platform's OpenGL in WebGL when it is available
This change makes WebGL to use LibGL only in SerenityOS, and the
platform's OpenGL driver in Ladybird if it is available.

This is implemented by introducing wrapper class between WebGL and
OpenGL calls. This way it will also be possible to provide more
complete support in Ladybird even if we don't yet have all needed
calls implemented in LibGL.

For now, the wrapper class makes all GL calls virtual. However, we
can get rid of this and implement it at compile time in case of
performance problems.
2024-01-20 18:21:56 +01:00
Aliaksandr Kalenik
c6289fad49 LibWeb: Make sure painter's context is active before executing commands
In the upcoming changes, the AccelGfx context will be used for WebGL, so
we can no longer assume that the WebContent process has a single global
context.
2024-01-20 18:21:56 +01:00
Aliaksandr Kalenik
aac439edb1 LibAccelGfx: Add method to make context active
In the upcoming changes, the AccelGfx context will be used for WebGL, so
we can no longer assume that the WebContent process has a single global
context.
2024-01-20 18:21:56 +01:00
Bastian Neumann
7cd489d6aa LibWeb: Remove early continue in size parsing
Step 5 of parsing was always skipped because step 4 continues.

Running step 5 causes some of the denominators to be 0 and causes
divide by zero error in CSSPixelFraction.

SVG Image with height of 0 will cause divide by zero error when
calculating intrinsic aspect ratio of SVGDecoderImageData.

We also get a divide by zero error in AlignContent::SpaceBetween of the
FlexFormatingContext.

During auto track stretching in GridFormatingContext there is a
possibility for count_of_auto_max_sizing_tracks to stay 0.
2024-01-20 15:22:25 +01:00
Bastiaan van der Plaat
e2bc606eeb LibWeb: Add MouseEvent JavaScript constructor 2024-01-20 08:57:37 +01:00
Bastiaan van der Plaat
9aadc6c8c9 LibWeb: Add missing EventModifierInit fields and getModifierState 2024-01-20 08:57:37 +01:00
Bastiaan van der Plaat
ba8704243e LibWeb: Add short type to IDL generator 2024-01-20 08:57:37 +01:00
Aliaksandr Kalenik
02d5ed44cb LibWeb: Stub Range::get_client_rects()
Fixes "Application error: a client-side exception has occurred (see
the browser console for more information)." on https://kotlinlang.org/
2024-01-20 08:56:52 +01:00
Nico Weber
a0462f495c LibPDF+MacPDF: Clip text, and add a debug option for disabling it 2024-01-20 08:56:03 +01:00
Nico Weber
90fdf738a1 LibPDF: Alphabetize clip_ fields in RenderingPreferences
No behavior change.
2024-01-20 08:56:03 +01:00
Nico Weber
66f8259a0b LibPDF: Move ClipRAII to .h file
No behavior change.
2024-01-20 08:56:03 +01:00
Bastiaan van der Plaat
a681429dff LibWeb: Remove DOM element deprecated_get_attribute() 2024-01-19 13:12:54 -07:00
Bastiaan van der Plaat
c477f90df7 LibWeb: Remove DOM element deprecated_tag_name() 2024-01-19 13:12:54 -07:00
Kemal Zebari
02d8aaa2e8 nohup: Use return code 127 for errors caught by serenity_main()
For any errors that occur during the runtime of nohup, POSIX uses
a 127 return code.
2024-01-19 12:16:56 -07:00
Sam Atkins
8bb459e0ec HackStudio: Remove unused spawn.h include 2024-01-19 12:16:21 -07:00
Sam Atkins
ae297e4405 HackStudio: Use Core::Process API to run template post-create programs 2024-01-19 12:16:21 -07:00
Sam Atkins
5205634ed4 HackStudio: Use Core::Process API to check for make 2024-01-19 12:16:21 -07:00
Sam Atkins
071f7fd818 LibCore+JSSpecCompiler: Add option for Process::spawn() to use spawnp()
Add a boolean to ProcessSpawnOptions, `search_for_executable_in_path`,
which when true, calls into posix_spawnp() instead of posix_spawn().
This defaults to false to maintain the existing behavior.

The `path` field is renamed to `executable` because having two fields
refer to "path" and mean different things seemed unnecessarily
confusing.
2024-01-19 12:16:21 -07:00
Bastiaan van der Plaat
48983a43b1 LibWeb: Add basic input range user interactivity 2024-01-19 19:36:28 +01:00
Bastiaan van der Plaat
ad07397c2d LibWeb: Return input range default value when invalid value 2024-01-19 19:36:28 +01:00
Bastiaan van der Plaat
c45ba50349 LibWeb: Refactor input color internal element updates to separate method 2024-01-19 19:36:28 +01:00
Bastiaan van der Plaat
5ba8a5ba13 LibWeb: Fix bug where input range thumb is not centered 2024-01-19 19:36:28 +01:00
Mr.UNIX
2440a2f83f TerminalSettings: Port to GML Compiler 2024-01-19 17:05:53 +01:00
Mr.UNIX
f6c32ea45e GMLCompiler: Add enum initializer for background_role 2024-01-19 17:05:53 +01:00
Mr.UNIX
64e79a618b GMLCompiler: Add enum initializer for orientation 2024-01-19 17:05:53 +01:00
Mr.UNIX
0a1a081d8a GMLCompiler: Add OpacitySlider header to class file mappings 2024-01-19 17:05:53 +01:00
Mr.UNIX
3b73064497 TerminalSettings: Split TerminalSettingsWidget into different files 2024-01-19 17:05:53 +01:00
Sanil
ca2aaaeac2 KeyboardSettings: Port to GML compiler 2024-01-19 17:03:30 +01:00
Lucas CHOLLET
c2c7365494 LibGfx/TIFF: Accept images with a single strip and no RowsPerStrip tag
This tag is required by the specification, but some encoders (at least
Krita) don't write it for images with a single strip.

The test file was generated by opening deflate.tiff in Krita and saving
it with the DEFLATE compression.
2024-01-19 14:13:44 +01:00
Lucas CHOLLET
284e785053 LibGfx/TIFF: Accept the PixarDeflate compression tag
I would have liked to avoid adding a deprecated tag but this is the one
currently in use in Krita.
2024-01-19 14:13:44 +01:00
kleines Filmröllchen
3afbf66295 LoginServer: Use new GML compiler 2024-01-19 10:50:15 +00:00