Commit graph

16853 commits

Author SHA1 Message Date
Linus Groh
26fc01eecb LibWeb/CSS: Fix incorrect calc(<percentage> - <value>) computations
When swapping both values to perform the actual calculation, we need to
consider that `A + B == B + A`, but `A - B != B - A`, so turn it into
`-B + A`.

Co-Authored-By: Sam Atkins <atkinssj@serenityos.org>
2022-06-30 12:11:57 +01:00
MacDue
5b9d7bb335 FileSystemAccessServer: Call window stealing functions sync
These functions were changed to synchronous in #13870 but
the async_ versions were still being called. This led to
frequent crashes when loading local files in Browser.
2022-06-30 11:15:24 +01:00
Tim Schumacher
6d4d6c3e2a LibC: Implement wcswidth 2022-06-30 11:57:49 +02:00
Tim Schumacher
9497cc6c97 LibC: Stub out brk and sbrk 2022-06-30 11:57:49 +02:00
Tim Schumacher
e2036ca2ca LibELF: Store the full file path in DynamicObject
Otherwise, our `dirname` call on the parent object will always be empty
when trying to resolve dependencies.
2022-06-30 11:57:10 +02:00
Lennon Donaghy
fbb8893513 PixelPaint: Omit file extension in tab/editor titles
This commit removes the file extension in the presented title of images,
and fixes an issue with the previous commit wherein "save as" on an
image would always append ".pp" as an extension, even when the filename
already included this extension.
2022-06-30 11:54:29 +02:00
Lennon Donaghy
7919b4368e PixelPaint: Use image title as default filename for "save as"
When creating a new image, a title can be entered. This title was not
used when saving the file however, so naming it was pointless, as the
title used would be whatever was entered during the first save.

This commit makes it so that the default text in the "save as" dialogue
is whatever was entered previously when the image was created.
2022-06-30 11:54:29 +02:00
FrHun
307d113594 Spreadsheet: Make conditional-formatting condition-list scrollable 2022-06-30 11:53:50 +02:00
FrHun
fddd2bf6ff LibGUI: Add min_content_size debug property to AbstractScrollableWidget
This helps with debugging subclasses of AbstractScrollableWidget
2022-06-30 11:53:50 +02:00
FrHun
247e3ef6e7 LibGUI: Add custom layout change handling to ScrollableContainerWidget 2022-06-30 11:53:50 +02:00
FrHun
d0a418540e LibGUI: Fix flickering scrollbars in AbstractScrollableWidget
The new min_content_size value is to be set by the subclasses, it is
then used to determine if the scrollbars should be shown after a
resize, but before the content size will be calculated by the following
layout pass.
2022-06-30 11:53:50 +02:00
FrHun
6f9777d35b LibGUI: Add layout change propagation to Widget
This function is intended to propagate layout changes upwards in the
widget hierarchy. Widgets that can know what to do with this
information without causing a full layout invalidation (i.e. just
because one of their child widgets changed layout/size, doesn't
necessairily mean that they have to change their layout/size) can
override this and prevent a full relayout and redraw.
2022-06-30 11:53:50 +02:00
FrHun
f59c167bb0 Applications+Games+LibGUI: Fix layout problems 2022-06-30 11:51:25 +02:00
FrHun
c2d344bd8c ThemeEditor: Fix layout for new layout system 2022-06-30 11:51:25 +02:00
FrHun
93112458b8 Spreadsheet: Use new layout system 2022-06-30 11:51:25 +02:00
FrHun
39c8590720 LibGUI: Change Label standard preferred height to opportunistic grow
The default size for label is always a compromise, no matter what value
is chosen, some layouts will require local manual overrides.
Having the preferred size be opportunistic_grow in both directions seems
like it's currently the option that works without modification in most
cases.
2022-06-30 11:51:25 +02:00
MacDue
104642507a LibWeb: Fix box-shadows on elements smaller than the blur diameter
This commit adds some finagling and shrinking of the corner bitmap
to handle drawing shadows on elements where the shadow radius >
half the width or height of the element. Previously things would
go horribly wrong when this happend.

There could still be some edge cases, but things seem to be working
fairly well now.
2022-06-30 11:16:22 +02:00
MacDue
97e2e40e4c LibWeb: Fix off-by-one shadow position on non-integer positioned boxes
This fixes a issue due to the background/border painting using
.to_rounded<int>() to get an IntRect, but shadow painting was using
enclosing_int_rect().

enclosing_int_rect() uses some floors/ceils and does not always match
.to_rounded<int>().
2022-06-30 11:16:22 +02:00
MacDue
cb010fd1f8 LibWeb+LibGfx: Fix 'halo' effect around the fringes of shadows
This now allows passing a 'fill_color' to the blur, any fully
transparent pixels will be replaced with this color (with the alpha
set to 0).

For box-shadows, if this color is set to the same as the shadow,
the issues around the fringes are fixed. This also fixes some places
where dark shadows appeared light / the wrong color.
2022-06-30 11:16:22 +02:00
MacDue
eb3bbb1ddf LibWeb: Switch to using StackBlurFilter for shadow painting
With this change the blur no longer dominates the profile. On my PC
it is down to 27% (which is the same as the AA ellipse painting).

The box-shadow.html test page now also feels more responsive.
2022-06-30 11:16:22 +02:00
MacDue
7f8cf81f7a LibGfx: Add StackBlurFilter, an efficient almost gaussian blur
This adds an implementation of StackBlur which is a very efficient
blur that closely approximates a gaussian blur. It has a number of
benefits over the existing FastBoxBlurFilter:

1. It's faster (~half the pixel lookups of a single box blur pass)
2. It only requires a single pass over image to produce good results
  - (Rather than the 3 the box blur requires)
3. It only needs to allocate a buffer of `blur_radius * 2 + 1` colors
  - These easily fits on the stack for any reasonable radius

For a detailed explanation of the algorithm check out this link:
https://observablehq.com/@jobleonard/mario-klingemans-stackblur
2022-06-30 11:16:22 +02:00
Luke Wilde
1e36224321 LibWeb: Print unhandled rejections the same way as unhandled exceptions 2022-06-29 21:21:50 +01:00
Luke Wilde
62491cda0b LibWeb: Use CSO if running script is null in HostPromiseRejectionTracker 2022-06-29 21:21:50 +01:00
Luke Wilde
1d5b03ce17 LibWeb: Store PromiseRejectionEvent::m_reason in a JS::Handle 2022-06-29 21:21:50 +01:00
Luke Wilde
17a26853e1 LibWeb: Move ClassicScript::m_settings_object into the Script base
All Scripts have an associated settings object.
https://html.spec.whatwg.org/multipage/webappapis.html#settings-object
2022-06-29 21:21:50 +01:00
Luke Wilde
3fe66bddf4 LibWeb: Implement WindowEventHandlers 2022-06-29 21:21:50 +01:00
Luke Wilde
ebf2184636 LibWeb: Only make certain <body> and <frameset> events apply to Window
Previously we forwarded all event handler attributes to Window from
these two elements, however, we are only supposed to forward blur,
error, focus, load, resize and scroll.
2022-06-29 21:21:50 +01:00
FrHun
a50a48f6b4 Terminal: Repair resizing
Because the content widget gets modified when resizing, the usual way of
calculating the min_size won't work for the Terminal window. So the
automatic min_size calculation will be disabled for now.
2022-06-29 19:11:13 +01:00
FrHun
5d25956790 LibGUI: Add ability to calculate min_size of Window from content widget 2022-06-29 19:11:13 +01:00
Obinna Ikeh
104330d1a0 LibJS: Add tests cases for %TypedArray%.prototype.toSorted function 2022-06-29 13:36:54 +01:00
Obinna Ikeh
4dbb2c2d44 LibJS: Add %TypedArray%.prototype.toSorted
This change implements typed array prototype toSorted function.

It also introduces two new TypedArray functions
2022-06-29 13:36:54 +01:00
Obinna Ikeh
ee9353702c LibJS: Implement element comparison function for typed arrays 2022-06-29 13:36:54 +01:00
Linus Groh
ca85e157e8 LibJS: Use null-prototype objects in a few more places in Temporal
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/334479f
2022-06-29 07:35:42 +01:00
Linus Groh
3720f4bd8f LibJS: Fix production for time zone name in time zone strings
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/caf013a
- https://github.com/tc39/proposal-temporal/commit/fb7cfa6
2022-06-29 07:35:42 +01:00
Linus Groh
f5669a1373 LibJS: Mark CreateTemporalDate as infallible in DifferenceISODateTime
This is an editorial change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/af2dc2f
- https://github.com/tc39/proposal-temporal/commit/2e9ee68
2022-06-29 07:35:42 +01:00
Linus Groh
abb3f327ad LibJS: Mark BalanceDuration as infallible in DifferenceISODateTime
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/5fefc2f
2022-06-29 07:35:42 +01:00
Linus Groh
cee54d2725 LibJS: Replace one use of BalanceISODate with CreateISODateRecord
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7a7ddb7
2022-06-29 07:35:42 +01:00
Linus Groh
6eab1f0212 LibJS: Assert DifferenceISODateTime is called with valid datetime values
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/143b2e2
2022-06-29 07:35:42 +01:00
Linus Groh
4ba1018273 LibJS: Replace guaranteed zero [[Days]] field with constant zero
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/68f2802
2022-06-29 07:35:42 +01:00
Linus Groh
11a6702cef LibJS: Assert [[Days]] is zero for the balanced time in DifferenceTime
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/be982fb
2022-06-29 07:35:42 +01:00
Olivier De Cannière
dbad617351 LibGUI: Close EmojiDialog on active window change
This patch makes EmojiDialog be closed whenever the focus moves away
from it just like the CommandPalette.
2022-06-29 03:29:02 +00:00
Andrew Dykema
2a7b3ca4b8 Calender: Add ability to set the time of day for an event 2022-06-29 03:27:59 +00:00
Linus Groh
cc4bb59a7e Playground: Rename the application to GMLPlayground
Just "Playground" is too generic and doesn't match the general rule of
"application name equals display name minus spaces".
2022-06-28 21:10:10 +01:00
Tim Schumacher
93488d6d5a pls: Implement support for --preserve-env 2022-06-28 19:09:23 +01:00
Tim Schumacher
38677f63c6 pls: Don't rely on getenv to find TERM
This allows us to skip storing the actual backing data in a separate
`Vector`, as we know that we are working with `environ`-backed storage
here.

Also, while the logic is currently very similar to what `getenv` does
internally, this allows us to eventually implement custom environment
variable filters while remaining linear in run time.
2022-06-28 19:09:23 +01:00
FrHun
00df1c9532 LibGUI: Use new layout system in InputBox 2022-06-28 17:52:42 +01:00
FrHun
1d6d074536 LibGUI: Use new layout system in FilePickerDialog 2022-06-28 17:52:42 +01:00
FrHun
a6ec2b9d0a LibGUI+Applications: Use the new layout system in the settings screens 2022-06-28 17:52:42 +01:00
FrHun
3978960481 LibGUI: Implement new layout system for Scrollbar 2022-06-28 17:52:42 +01:00
FrHun
19fac58e49 LibGUI: Use new layout system for basic widgets 2022-06-28 17:52:42 +01:00