Linus Groh
f8f074f8a9
LibJS: Convert to_temporal_rounding_increment() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
65d26dd25e
LibJS: Convert to_show_calendar_option() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
509d13cf67
LibJS: Convert to_temporal_rounding_mode() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
9f03647f1f
LibJS: Convert to_temporal_overflow() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
b1e7e62657
LibJS: Convert get_string_or_number_option() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
8d6ac267dc
LibJS: Convert Temporal::get_option() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
08dd1c3e2d
LibJS: Convert get_options_object() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
f2b5ddd167
LibJS: Convert iterable_to_list_of_type() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
683e31e1ff
LibJS: Convert to_integer_throw_on_infinity() to ThrowCompletionOr
2021-09-16 22:34:24 +01:00
Linus Groh
fea27143e9
LibJS: Initialize value in ThrowCompletionOr<void> default constructor
...
Otherwise, TRY() will crash when calling release_value() on the empty
m_value Optional.
2021-09-16 22:34:24 +01:00
Tobias Christiansen
f8ea730f29
LibWeb: Flexbox: Add default value for AlignItems
...
Previously there was no default value and wrapping broke when the
container didn't have a align-items specified.
2021-09-16 22:51:15 +02:00
Sam Atkins
6c992e5dce
LibGfx: Don't try to paint 0px-wide lines
...
In some cases, we were infinite-looping when asked to paint something
with a thickness of '0', so now every Painter method that takes a
thickness, does a check for a thickness <= 0 and bails early. After all,
you can't draw something that's 0px wide. :^)
2021-09-16 22:30:33 +02:00
Sam Atkins
3964b81d2b
LibWeb: Add for CSS fill/stroke/stroke-color
properties for SVG
...
In the spec, `fill` and `stroke` are supposed to be a shorthands for
various properties. But since the spec is still a working draft, and
neither Firefox or Chrome support the `fill-color` or `stroke-color`
properties, we'll stick with `fill` and `stroke` as simple colors for
now.
Also, note that SVG expects things in "user units", and we are assuming
that 1px = 1 user unit for now.
2021-09-16 22:30:33 +02:00
Marcus Nilsson
eec411c508
LibGUI: Add a AutoScroll timer to AbstractScrollableWidget
...
This commit adds a timer to AbstractScrollableWidget that can be used
when implementing automatic scrolling. By overriding
on_automatic_scrolling_timer_fired() we can calculate the scrolling
delta when dragging objects, and redraw as needed. A helper function,
automatic_scroll_delta_from_position() gives us a delta that
we can use to calculate speed and direction. By default
m_autoscroll_threshold is 20 pixels from the edge, and gives a linear
change in scroll delta.
2021-09-16 22:29:21 +02:00
Marcus Nilsson
522119ab95
LibGUI: Implement is_min() & is_max() helpers to AbstractSlider
2021-09-16 22:29:21 +02:00
Ali Mohammad Pur
c7a99aafac
LibJS: Use ScopePusher to correctly push the scope in for statements
...
We were previously pushing a scope but forgetting to actually set it as
the current scope.
2021-09-16 21:51:45 +02:00
Andreas Kling
63a0ebcc90
js: Add a simple loadJSON(path) built-in to load JSON from a file
...
This is very handy when you want to load data from /proc, for example.
2021-09-16 21:49:50 +02:00
Brian Gianforcaro
677f227774
LibX86: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
b9c53a096a
LibVT: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
744de5ec69
LibThreading: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
bff33c67ab
LibThreading: Neither Mutex or MutexLocker should be movable / copyable
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
fdea5e1628
LibRegex: Pass RegexStringView and Vector<RegexStringView> by reference
...
Flagged by pvs-studio, it looks like these were intended to be passed by
reference originally, but it was missed. This avoids excessive argument
copy when searching / matching in the regex API.
Before:
Command: /usr/Tests/LibRegex/Regex --bench
Average time: 5998.29 ms (median: 5991, stddev: 102.18)
After:
Command: /usr/Tests/LibRegex/Regex --bench
Average time: 5623.2 ms (median: 5623, stddev: 86.25)
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
507effce5b
LibPDF: Use move to avoid unnecessary ref/unref of network device RefPtr
...
Flagged by pvs-studio as a potential perf optimization.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
0db46eecdc
LibIPC: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
e2d154c74d
LibJS: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
fda48d7a6b
LibGfx: Use move to avoid unnecessary ref/unref of network device RefPtr
...
Flagged by pvs-studio as a potential perf optimization.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
f327f54399
LibGfx: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
a7364eef3c
LibGUI: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
07b314e843
Kernel+LibC: Pack SC_stat_params struct tighter
...
Flagged by pvs-studio, ordering the members from largest to smallest
allows us to save a few bytes in the size of the struct.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
be15bd3c86
Kernel+LibC: Pack SC_mount_params struct tighter
...
Flagged by pvs-studio, ordering the members from largest to smallest
allows us to save a few bytes in the size of the struct.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
dcb327a83b
Kernel+LibC: Pack SC_setsockopt_params struct tighter
...
Flagged by pvs-studio, ordering the members from largest to smallest
allows us to save a few bytes in the size of the struct.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
9956607283
Kernel+LibC: Pack SC_accept4_params struct tighter
...
Flagged by pvs-studio, ordering the members from largest to smallest
allows us to save a few bytes in the size of the struct.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
b45ca5d56e
Kernel+LibC: Pack SC_inode_watcher_add_watch_params struct better
...
Flagged by pvs-studio, ordering the members from largest to smallest
allows us to save a few bytes in the size of the struct.
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
dba5710efa
LibCrypto: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
5dbc72a158
LibELF: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
889ade06fe
LibWeb: Use explicit move to avoid unnecessary RefPtr ref / unref
2021-09-16 17:17:13 +02:00
Brian Gianforcaro
2b57018196
LibWeb: Use default instead of an empty constructor/destructor
...
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-16 17:17:13 +02:00
Karol Kosek
d1e1096bc0
LibGfx: Enumerate metric theme roles
...
This change does practically nothing except that you no longer have to
put new roles there, as they are now automatically read from the enum
list.
2021-09-16 16:52:55 +02:00
Karol Kosek
6f4333fca7
LibGfx: Add support for enumerating by Metric and Path roles
...
For Theme Editor.
2021-09-16 16:52:55 +02:00
Ali Mohammad Pur
f4d3c54c12
LibTLS: Close the underlying socket on EOF
...
This is 23febbed41
but without the bug
that makes the CI hang :^)
2021-09-16 16:42:51 +02:00
Tim Schumacher
a1617faf44
LibC: Implement mbsinit and mbrtowc
2021-09-16 16:42:40 +02:00
Tim Schumacher
405f3d0aa3
LibC: Implement btowc()
2021-09-16 16:42:40 +02:00
Tim Schumacher
e4fa9c917e
LibC: Stub out a bunch of wchar functions
2021-09-16 16:42:40 +02:00
Tim Schumacher
230df61aef
LibC: Define ptrdiff_t limits
2021-09-16 16:42:40 +02:00
Tim Schumacher
328818af97
LibC: Provide a dummy mbstate_t in wchar.h
...
POSIX just says that mbstate_t should be an "object type other than an
array type" that can hold the conversion state for converting between
(multi-byte) characters and wide characters.
Since no other information regarding the contents is given, this
apparently means that we should add whatever we need once we start
implementing that conversion.
2021-09-16 16:42:40 +02:00
Tim Schumacher
8f9af4a582
LibC: Implement CODESET for langinfo
2021-09-16 16:42:40 +02:00
Idan Horowitz
5ea1810ada
LibJS: Convert PlainMonthDay AOs to ThrowCompletionOr
2021-09-16 13:53:37 +01:00
Idan Horowitz
229a5ce149
LibJS: Convert PlainTime AOs to ThrowCompletionOr
2021-09-16 13:53:37 +01:00
Idan Horowitz
c57a78423d
LibJS: Convert PlainYearMonth AOs to ThrowCompletionOr
2021-09-16 13:53:37 +01:00
Idan Horowitz
cc00a726a8
LibJS: Convert TimeZone AOs to ThrowCompletionOr
2021-09-16 13:53:37 +01:00