Commit graph

13249 commits

Author SHA1 Message Date
Xavier Defrang
30f58de800 LibCore: Restore support for multiple symbolic classes
Reverts recent change introduced to support implicit symbolic permission
which broke the parser when multiple classes are specified.
The state machine must assume it's dealing with classes until an
operation character is consumed.
2022-01-24 07:50:32 +00:00
Michel Hermier
395d9a2702 sort: Port to LibMain 2022-01-24 05:38:30 +00:00
Michel Hermier
176de579f2 shuf: Port to LibMain 2022-01-24 05:38:30 +00:00
Michel Hermier
4e02b204ef rev: Port to LibMain 2022-01-24 05:38:30 +00:00
Rummskartoffel
4eb5fdcfe0 UserspaceEmulator: Support ioctls TCSETSF and TCSETSW 2022-01-24 03:02:35 +00:00
Andreas Kling
1b15144e78 LibWeb: Make sure painted CSS borders are snapped to integer pixels
This is a bit of a hack to get box content to stop bleeding 1px outside
the border sometimes. We will need to come up with a more general
solution for this problem eventually.
2022-01-24 02:36:33 +01:00
Andreas Kling
9201f626c1 LibWeb: Use BFC root relative coordinates when flowing around floats
While IFC flows text into a block container, floating objects are
anchored at the BFC root, not necessarily the local block container.

Because of this, we have to use root-relative coordinates when checking
how much space is available in between left and right floated objects.
2022-01-24 02:16:13 +01:00
Andreas Kling
54beb7433e LibWeb: Place block-level boxes vertically before formatting them inside
Block placement is now divided into a vertical and horizontal step. The
vertical step runs before formatting boxes internally. The horizontal
step still runs after (since we may need the final width value.)

This solves a long-standing architectural problem where IFC didn't know
its origin Y position within the BFC root box. This is required for
figuring out how to flow around floating objects. (Floating objects are
always relative to the BFC root.)
2022-01-24 02:09:17 +01:00
Andreas Kling
bb6af641d4 LibWeb: Unify placement of replaced and non-replaced elements in BFC
Seems like we can share the code for these.
2022-01-24 02:09:17 +01:00
Andreas Kling
9a48368280 LibWeb: Simplify code that compute initial child positions in BFC 2022-01-24 02:09:17 +01:00
Andreas Kling
d58f60c953 LibWeb: Unify code for assigning vertical box model metrics in BFC
We were doing the exact same thing for both replaced and non-replaced
elements, so let's share the code. :^)
2022-01-24 02:09:17 +01:00
Andreas Kling
00bd17034d LibWeb: Make IFC aware that its parent is always a BFC
This simplifies some code and allows us to use tighter types for the
parent context everywhere.
2022-01-24 02:09:17 +01:00
Andreas Kling
83a6e698a0 LibWeb: Move rect-in-coordinate-space helper to Layout::Box 2022-01-24 02:09:17 +01:00
Andreas Kling
29589378ff LibWeb: Remove unused InlineFormattingContext::available_width_at_line() 2022-01-24 02:09:17 +01:00
Andreas Kling
6ca90b8d57 LibWeb: Take full border box into account when vertically placing floats 2022-01-24 02:09:17 +01:00
Tom
6565ec59fa DisplaySettings: Show display's manufacturer and size instead of device
Rather than displaying the path of the framebuffer, try and display
the manufacturer name and the size of the display. If no EDID data is
available, fall back to showing the device path.
2022-01-23 22:45:21 +00:00
Tom
869c20b05d Meta+LibEDID: Download and generate the PNP ID database
This downloads the UEFI's published PNP ID database and generates a
lookup table for use in LibEDID. The lookup table isn't optimized at
all, but this can be easily done at a later point if needed.
2022-01-23 22:45:21 +00:00
Tom
ab1075e296 DisplaySettings: Show DPI for selected resolution
This uses the EDID provided by the connected display to show the pixel
density of a selected resolution.
2022-01-23 22:45:21 +00:00
Tom
49c902d581 LibEDID: Add API for conveniently querying EDID from framebuffer device 2022-01-23 22:45:21 +00:00
Tom
03c45b1865 Kernel: Add ioctl to get the EDID from a framebuffer 2022-01-23 22:45:21 +00:00
Tom
8184870f93 LibEDID: Add a library to parse EDID blobs
This library can be used (for the most part) by kernel drivers as well
as user mode. For this reason FixedPoint is used rather than floating
point, but kept to a minimum.
2022-01-23 22:45:21 +00:00
Tobias Christiansen
92e337de21 LibGUI: Fix typo in TextEditor 2022-01-23 22:12:05 +00:00
Tobias Christiansen
9a28c8dc74 LibGUI: Fix broken text rendering in TextEditor
This patch reintroduces the translation previously mistakenly removed
when adding support for different underline-styles.

Thanks for reporting the bug, kennethmyhra!
2022-01-23 22:12:05 +00:00
Timothy Flynn
9684ae460c RequestServer: Unveil /etc/timezone for date-time usage 2022-01-23 20:57:01 +00:00
Rummskartoffel
5f639493f0 gunzip: Don't truncate output filename when input file suffix is omitted
Before this commit, `$ gunzip abcd` would incorrectly uncompress
`abcd.gz` to `a` instead of to `abcd`.
2022-01-23 20:52:16 +00:00
Lenny Maiorani
3143c4b1df LibSoftGPU: Add const to Clipper where possible 2022-01-23 20:42:07 +00:00
Lenny Maiorani
0da3a2ddde LibSoftGPU: Switch to using east const in Clipper.[h,cpp] 2022-01-23 20:42:07 +00:00
mnlrsn
66216d3af6 LibSQL: Add simple REGEXP match
The implementation of LIKE uses regexes under the hood, and this
implementation of REGEXP takes the same approach. It employs
PosixExtended from LibRegex with case insensitive and Unicode flags
set. The implementation of LIKE is based on SQLlite specs, but SQLlite
does not offer directions for a built-in regex functionality, so this
one uses LibRegex.
2022-01-23 22:34:53 +03:30
Idan Horowitz
ace36681ff LibJS+LibIMAP: Use the new Optional<U>(Optional<T>) constructor
These look much nicer than these repeated ternaries :^)
2022-01-23 18:53:42 +02:00
David Lindbom
fb06d494f0 find: Fix crash on missing arguments
Fixes #12075
2022-01-23 16:29:06 +01:00
mjz19910
61cf1c066e LibJS: Remove VM::call() 2022-01-23 15:24:45 +00:00
mjz19910
1ef633472b Everywhere: Convert VM::call() to JS::call() 2022-01-23 15:24:45 +00:00
mjz19910
d436746c95 LibJS: Add some overloads for JS::call() and JS::call_impl()
Overloads added:
- JS::call for FunctionObject&
- JS::call_impl for FunctionObject&
2022-01-23 15:24:45 +00:00
kleines Filmröllchen
df6b9cdb0c LibCore+LibC: Enforce the global event loop ban in code
It's a bad idea to have a global event loop in a client application as
that will cause an initialization-order fiasco in ASAN. Therefore, LibC
now has a flag "s_global_initializers_ran" which is false until _entry
in crt0 runs, which in turn only gets called after all the global
initializers were actually executed. The EventLoop constructor checks
the flag and crashes the program if it is being called as a global
constructor. A note next to the VERIFY_NOT_REACHED() informs the
developer of these things and how we usually instantiate event loops.

The upshot of this is that global event loops will cause a crash before
any undefined behavior is hit.
2022-01-23 15:21:10 +01:00
kleines Filmröllchen
888faa3c9f LibCore: Fix signal handling race condition in EventLoop
The event loop is responsible for handling POSIX signals while it's
running. The signal handler adds the signals to a wake pipe which is
then read after the select'ing code in wait_for_event. Problems happen,
however, when another signal comes in after the select wake: the signal
will interrupt the next syscall, the `read` from the wake pipe, and the
resulting EINTR in wait_for_event causes the program to crash. This is
undesirable. Instead, we want to retry reading as long as we're
interrupted.
2022-01-23 15:21:10 +01:00
kleines Filmröllchen
a501b9c7df LibCore: Create wake pipe on each thread
After the previous change, the wake pipe was only being created on the
main thread by the main event loop. This change utilizes a flag to
always initialize the wake pipe on other threads. Because the pipe is
quite expensive (it will count towards the file descriptor limit, for
instance), we do the initialization "lazily": Only when an event loop is
constructed and it notices that there hasn't been a wake pipe created on
its thread, it will create the pipe. Conversely, this means that there
are no pipes on threads that never use an event loop.
2022-01-23 15:21:10 +01:00
kleines Filmröllchen
69c1910037 LibCore: Allow EventLoops to run on multiple threads safely
The event loop system was previously very singletony to the point that
there's only a single event loop stack per process and only one event
loop (the topmost) can run at a time. This commit simply makes the event
loop stack and related structures thread-local so that each thread has
an isolated event loop system.

Some things are kept at a global level and synchronized with the new
MutexProtected: The main event loop needs to still be obtainable from
anywhere, as it closes down the application when it exits. The ID
allocator is global as IDs should not be shared even between threads.
And for the inspector server connection, the same as for the main loop
holds.

Note that currently, the wake pipe is only created by the main thread,
so notifications don't work on other threads.

This removes the temporary mutex fix for notifiers, introduced in
0631d3fed5 .
2022-01-23 15:21:10 +01:00
kleines Filmröllchen
3d6e08156d LibThreading: Introduce MutexProtected generic synchronization primitive
MutexProtected mirrors the identically-named Kernel primitive and can be
used to synchronize access to any object that might not be thread safe
on its own. Synchronization is done with a simple mutex, so access to a
MutexProtected object is potentially blocking.

Mutex now has an internal nesting variable which is there to harden it
against lock-unlock ordering issues (e.g. double unlocking).
2022-01-23 15:21:10 +01:00
Timothy Flynn
d365559839 ClockSettings: Add a GUI application to set the system time zone
This application can be expanded with other clock-related options. For
an initial iteration, it has just an option to change the time zone.
2022-01-23 12:48:26 +00:00
Timothy Flynn
6057a2ca30 timezone: Add a command line utility to set the system time zone 2022-01-23 12:48:26 +00:00
Timothy Flynn
2bdc3aec42 LibC: Use LibTimeZone to offset localtime() for the system time zone 2022-01-23 12:48:26 +00:00
Timothy Flynn
7f1404b870 LibTimeZone: Use /etc/timezone as the basis for the system time zone
This changes LibTimeZone to read the current time zone from the file
/etc/timezone rather than using tzset/tzname. Instead, in a subsequent
commit, LibC's time methods will be changed to used LibTimeZone to
retrieve the system time zone.

Also add an API to set the system time zone. This method is only allowed
when running within Serenity.
2022-01-23 12:48:26 +00:00
Timothy Flynn
bcf4ec9c61 Userland: Add promises to programs that will read /etc/timezone
This will require unveiling /etc/timezone itself for reading, as well as
the rpath pledge promise.
2022-01-23 12:48:26 +00:00
Timothy Flynn
da27937144 LibTimeZone: Add an API to retrieve a list of all known IANA time zones 2022-01-23 12:48:26 +00:00
Timothy Flynn
0a4430fc41 LibJS+LibTimeZone+LibUnicode: Remove direct linkage to LibTimeZone
This is no longer needed now that LibTimeZone is included within LibC.
Remove the direct linkage so that others do not mistakenly copy-paste
the CMakeLists text elsewhere.
2022-01-23 12:48:26 +00:00
Timothy Flynn
6988403d59 DynamicLoader+LibC+LibTimeZone: Include LibTimeZone sources in LibC
LibTimeZone will be needed directly within LibC for functions such as
localtime(). This change adds LibTimeZone directly within LibC, so that
LibTimeZone isn't its own .so library anymore.

LibTimeZone itself is compiled as an object library to make it easier to
give it generator-specific compilation flags.
2022-01-23 12:48:26 +00:00
Tobias Christiansen
3b877c889b LibWeb: Consider TextDecorationStyle when rendering text
For now only Wavy is additionally supported, but the infrastructure is
there.
2022-01-23 15:48:27 +03:30
Tobias Christiansen
69aac6ecd7 LibWeb: Add new property 'text-decoration-style'
This patch makes the property 'text-decoration-style' known throughout
all the places in LibWeb that care.
2022-01-23 15:48:27 +03:30
Tobias Christiansen
5348c67ba4 LibGUI: Expand underline support for Spans in TextEditor
To achieve this, some of the lambdas got shifted around and the new
attributes are respected.
2022-01-23 15:48:27 +03:30
Tobias Christiansen
ece59948c3 LibGfx: Expand TextAttributes with more information about underlining
This adds a seperate Color to be used for underlines as well as support
for different underline styles.
2022-01-23 15:48:27 +03:30
Tobias Christiansen
0277118cb4 LibGfx: Add Painter::draw_triangle_wave()
This patch adds support for drawing triangular waves.
For now those can only be horizontal, but as they are intended for
underlining text, it's an okay way to handle this.
2022-01-23 15:48:27 +03:30
Nico Weber
fd7de68d07 LibHTTP+AK: Rename CNETWORKJOB_DEBUG to NETWORKJOB_DEBUG 2022-01-23 00:45:22 +00:00
Nico Weber
a17b2248f2 LibHTTP+AK: Rename CHTTPJOB_DEBUG to HTTPJOB_DEBUG 2022-01-23 00:45:22 +00:00
Liav A
24efc74318 LibCore: Print the actual errno if sysbeep failed 2022-01-23 00:40:54 +00:00
Liav A
4da7b543c6 SystemServer: Create /dev/devctl and create devices based on its events
We first create the /dev/devctl based on the information from the SysFS.
Then, we create block devices and character devices based on the events
we read from that device.
2022-01-23 00:38:02 +00:00
Liav A
eaad77b286 SystemServer: Rename devfs => devtmpfs
We used to have a static devfs, but now it's called devtmpfs which is
completely dynamic.
2022-01-23 00:38:02 +00:00
Andreas Kling
b60e19fd34 LibWeb: Make LineBuilder assign height to empty line boxes
This ensures that <br> produces empty line boxes with the line-height
property as their height.
2022-01-23 01:36:13 +01:00
thankyouverycool
918dfa51a2 WindowServer: Paint menu checkboxes as such instead of as frames
Fixes disabled checkboxes appearing enabled in menus.
2022-01-23 00:30:00 +00:00
Rummskartoffel
c93dfe8097 TextEditor: Fix crash on startup when file specified cannot be opened
Due to a bug introduced in f674102, TE would attempt to access the value
of an ErrorOr that didn't hold one, hitting an assertion.
2022-01-23 00:27:41 +00:00
Andreas Kling
f5c5efa067 LibWeb: Allow CSS floating objects to flow across multiple lines
If we run out of horizontal space when placing floating objects,
we now perform a "break" and continue with a new line of floats
below the bottommost margin edge of the current line.

This is definitely not 100% to-spec yet, but a huge improvement
on ACID1 already. :^)
2022-01-23 01:22:41 +01:00
Andreas Kling
0ea438e45b LibWeb: Put BFC floating object state into a struct
This patch adds a BFC::FloatSideData struct so we can contain left and
right floating object layout state in a struct. This is preparation for
adding more per-side state.
2022-01-23 01:22:41 +01:00
Andreas Kling
70a56d21dc LibWeb: Don't do horizontal inline line layout twice for last line
After pruning empty last line boxes, we now avoid re-running the
horizontal fragment positioning step, since that would be wasted work.
2022-01-23 01:22:41 +01:00
Andreas Kling
b1fd801436 LibWeb: Pass correct state to TextNode::compute_text_for_rendering()
This is poorly factored. TextNode needs to know whether the most
recently inserted fragment on the current line was empty or ended in
whitespace. This is used when deciding what to do with leading
whitespace in text nodes.

Let's keep this working for now, but we should eventually sort this out
and make text chunk iteration not depend on this information.
2022-01-23 01:22:41 +01:00
Andreas Kling
36e2799131 LibWeb: Make InlineLevelIterator::m_container a Layout::BlockContainer&
This is always a block container (the IFC's containing block.)
2022-01-23 01:22:41 +01:00
Andreas Kling
9f39ad8929 LibWeb: Ignore some collapsible whitespace when building lines
When collapsing whitespace, we can skip over all-whitespace chunks at
the start of each line, and immediately following fragments that
themselves end in whitespace.
2022-01-23 01:22:41 +01:00
Andreas Kling
766d816db3 LibWeb: Remove old Layout::Node::split_into_lines() API
Now that we build lines incrementally, we no longer need the atomic line
splitting API.

The new InlineLevelIterator and LineBuilder setup does have some
regressions from the old behavior, but we can deal with them as we go.
2022-01-23 01:22:41 +01:00
Andreas Kling
ba49dc82e0 LibWeb: Align inline-level boxes to the baseline of the line box
Vertical inline alignment is still very unsophisticated, but let's at
least put everything within each line on the same baseline.
2022-01-23 01:22:41 +01:00
Andreas Kling
2b631cde45 LibWeb: Avoid creating an empty first line box in block containers 2022-01-23 01:22:41 +01:00
Andreas Kling
251b2f49a2 LibWeb: Make LineBuilder respect LayoutMode::OnlyRequiredLineBreaks
In this layout mode, we should only break when forced (e.g by an
explicit <br> tag.) This is used when determining intrinsic sizes.)
2022-01-23 01:22:41 +01:00
Andreas Kling
78f2ddfc14 LibWeb: Make InlineLevelIterator ignore list item marker boxes
Marker boxes are managed explicitly by the corresponding list item box.
2022-01-23 01:22:41 +01:00
Andreas Kling
d3adc94ce8 LibWeb: Dimension inline-block boxes before deciding about line breaks
We won't know if we need to break before the inline-block box until
after we've dimensioned it.
2022-01-23 01:22:41 +01:00
Andreas Kling
67b3f769fb LibWeb: Teach InlineLevelIterator to skip across inline-block elements
We don't want to descend into inline-block containers when iterating
inline-level items, since that would make the inline-level children of
the inline-block bubble up to the containing block of the inline-block.
2022-01-23 01:22:41 +01:00
Andreas Kling
ce8043c6c2 LibWeb: Use LineBuilder in IFC to layout line boxes incrementally
This resolves a long-standing architectural problem in LibWeb that made
it unable to place CSS floating objects correctly due to not having
final vertical position information when computing the amount of
available horizontal space for each line.
2022-01-23 01:22:41 +01:00
Andreas Kling
00bde9ca51 LibWeb: Add Layout::LineBuilder class for incremental line box layout
This class will be used to place items on lines incrementally instead of
the current two-phase approach.
2022-01-23 01:22:41 +01:00
Andreas Kling
ae301d2b02 LibWeb: Remove duplicate type checks in SelectorEngine
After confirming the rule types, we can use static_cast instead of
verify_cast to avoid some extra work.
2022-01-23 01:22:41 +01:00
Andreas Kling
77650fe886 LibWeb: Remove duplicate checks in for_each_effective_style_rule()
After confirming the rule types, we can use static_cast instead of
verify_cast to avoid some extra work.
2022-01-23 01:22:41 +01:00
Andreas Kling
39b2046c42 LibWeb: Move available_space_for_line() into InlineFormattingContext 2022-01-23 01:22:41 +01:00
Andreas Kling
1f603c54ff LibWeb: Add inline-level iterator that enumerates items for line layout
This patch adds a new mechanism that allows InlineFormattingContext to
build line boxes incrementally instead of all-in-one go.

Incremental build will eventually allow much better support for CSS
floating objects.
2022-01-23 01:22:41 +01:00
Andreas Kling
9358f108c4 LibWeb: Add TreeNode<T>::next_in_pre_order(T* stay_within) variant
This is a scoped variant of the pre-order traversal helper that aborts
when attempting to leave the `stay_within` node.
2022-01-23 01:22:41 +01:00
Linus Groh
1ce6c49f5e LibJS: Make CreateTemporalDuration infallible in PlainYearMonthPrototype
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/05793a8
2022-01-23 00:22:10 +00:00
Linus Groh
e16821f460 LibJS: Avoid ambiguity in TimeZone production
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/87a6b0d
2022-01-23 00:22:10 +00:00
Linus Groh
0e3def1d0b LibJS: Don't parse/re-format offset in parse_temporal_time_zone_string()
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6abe146
2022-01-23 00:22:10 +00:00
Linus Groh
31283b5e64 LibJS: Pass valid offset string directly to CreateTemporalTimeZone
This is an editorial change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/75490b9
- https://github.com/tc39/proposal-temporal/commit/8b70e4b
2022-01-23 00:22:10 +00:00
Linus Groh
6d744eb4a7 LibJS: Use consistent name for offset strings
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/17f8cdb
2022-01-23 00:22:10 +00:00
dayarthvader
67b7bbe1f6 ping: Handle optional field in the IPv4 header 2022-01-22 22:11:21 +00:00
Idan Horowitz
bb340f1272 markdown-check: Ignore absolute icon paths
We have no good way to handle these yet, and there's no point in
forcing everyone to skip their pre-commit checks.
2022-01-22 21:40:09 +02:00
Federico Guerinoni
e37af0b073 umount: Port to LibMain 2022-01-22 13:31:52 +02:00
Federico Guerinoni
2291ef6c3c LibCore: Add syscall wrapper for umount() 2022-01-22 13:31:52 +02:00
Emanuele Torre
191566fc97 LibJS: Avoid potential signed integer overflow in CyclicModule.cpp
`auto count = 0;` will declare `count` as a `signed int`.

We don't want that since `count` is used to count the occurence of an
element in an `AK::Vector` that can have up to `SIZE_MAX` elements;
`SIZE_MAX` can overflow a `signed int` more than 4 billion times.
2022-01-22 10:38:41 +01:00
Lenny Maiorani
065525aba0 LibSoftGPU: Configure stats overlay period
Problem:
- The statistics overlay period is hardcoded to 500 ms. This time is
  very short and can result in the values being very "jumpy".

Solution:
- Increasing this value can result in more steady values which is
  useful when trying to evaluate the performance impact of a change. A
  new config value is offered in `Config.h` to let the developer
  change to any value desired.
2022-01-22 08:57:31 +03:30
Nico Weber
3831e5fcff Utilities+Lagom: Remove test-crypto
After 4d5ffd364a, Tests/{LibCrypto,LibTLS} test the same things
and test-crypto has been redundant since then.
2022-01-22 01:44:05 +00:00
Nico Weber
d670c13a3b LibWeb: Make attribute hidden have an effect; hide some other elements
This moves LibWeb to using the list of hidden elements from the spec.

Concretely, the following things are now explicitly marked
`display: none` in addition to before:

- elements with the `hidden` attribute
- area
- base
- basefont
- datalist
- param
- rp

The spec also wants `noframes` and `noembed` to be `display: none`,
but since support for frames and embeds doesn't exist yet, these
are omitted for now.

With this, everyone's favorite website http://45.33.8.238/ no longer
displays spans with attribute hidden. (Whitespace handling still
looks a bit off though.)
2022-01-22 01:28:42 +00:00
Nico Weber
a9c80ba33c LibHTTP: Move more happy-path logging behind CHTTPJOB_DEBUG 2022-01-22 01:28:01 +00:00
Nico Weber
46ffc98ebc LibHTTP: Move more happy-path logging behind HTTPSJOB_DEBUG 2022-01-22 01:28:01 +00:00
Nico Weber
6d532649d4 RequestServer+AK: Move happy-path logging behind REQUESTSERVER_DEBUG
vdbgln() was responsible for ~10% of samples on pv's flamegraph for
RequestServer (under request_did_finish) when loading github.com in
Browser and recording a whole-system profile. This makes that almost
completely disappear.
2022-01-22 01:28:01 +00:00
davidot
0e56dac51e js: Display a warning if multiple files are given
Also instead of making a frankenstein path with all the paths combined
just take the first one, this is needed for resolving modules.
2022-01-22 01:21:18 +00:00
davidot
2d4b345bb1 Spreadsheet: Enable dynamic import of javascript modules
This has some risks as it can (attempt to) load arbitrary files on the
filesystem but for now it can only load local files which do go through
normal file operations. But let's enable it for now to see what we can
do with it.
2022-01-22 01:21:18 +00:00
davidot
986ad3ccf0 LibJS: Use HostImportModuleDynamically in ShadowRealmImportValue
Now that module loading is implemented this just works :^).

Since ShadowRealm explicitly passed a null ScriptOrModule we attempt to
get the top most ScriptOrModule in HostImportModuleDynamically.
This won't work in general as the web specifies other behavior but for
LibJS there must always be an active script to call
HostImportModuleDynamically.
2022-01-22 01:21:18 +00:00
davidot
91b3e5b31f LibJS: Implement the ImportMeta MetaProperty
This "standard" implementation of this is to do nothing.
2022-01-22 01:21:18 +00:00
davidot
7cbf4b90e8 LibJS: Implement ImportCall and HostImportModuleDynamically
This allows us to load modules from scripts.
This can be dangerous as it can load arbitrary files. Because of that it
fails and throws by default. Currently, only js and JavaScriptTestRunner
enable the default hook.

This also adds tests to test-js which test module code. Because we
form a spec perspective can't "enter" a module this is the easiest way
to run tests without having to modify test-js to have special cases for
modules.
To specify modules in test-js we use the extension '.mjs' this is to
ensure the files are not executed. We do still want to lint these files
so the prettier scripts have changed to look for '.mjs' files as well.
2022-01-22 01:21:18 +00:00
davidot
023968a489 LibJS: Implement evaluation of im- and exports statements 2022-01-22 01:21:18 +00:00
davidot
779e677467 LibJS: Implement HostResolveImportedModule for LibJS
This loads modules with relative paths from the referencing module.
In this commit the only way to run a module is via the interpreter
which can link and evaluate a module (and all its dependencies).
2022-01-22 01:21:18 +00:00
davidot
1b8ccf9a66 LibJS: Implement Module linking and evaluating 2022-01-22 01:21:18 +00:00
davidot
be9d478d92 LibJS: Add host layering point related to modules to VM
Also make HostResolveImportedModule fail on the browser to prevent
module loading for now.
2022-01-22 01:21:18 +00:00
davidot
55366703d0 LibJS: Add Module Namespace Exotic Object 2022-01-22 01:21:18 +00:00
davidot
0cdbc03de0 LibJS: Add ModuleEnvironment 2022-01-22 01:21:18 +00:00
davidot
12c2f30c54 LibJS: Add filename tracking to Script and Module
This will allow us to resolve modules dynamically loaded from a script.
2022-01-22 01:21:18 +00:00
davidot
57c5a59cab LibJS: Add ScriptOrModule to execution context and track it everywhere 2022-01-22 01:21:18 +00:00
davidot
99edf5b25a LibJS: Track whether a program has a top level await statement 2022-01-22 01:21:18 +00:00
davidot
aca427fc8c LibJS: Make parsing import and export entries follow the spec
The big changes are:
- Allow strings as Module{Export, Import}Name
- Properly track declarations in default export statements

However, the spec is a little strange in that it allows function and
class declarations without a name in default export statements.
This is quite hard to fully implement without rewriting more of the
parser so for now this behavior is emulated by faking things with
function and class expressions. See the comments in
parse_export_statement for details on the hacks and where it goes wrong.
2022-01-22 01:21:18 +00:00
Luke Wilde
631bbcd00a LibJS: Refactor interpreter to use Script and Source Text Modules
This also refactors interpreter creation to follow
InitializeHostDefinedRealm, but I couldn't fit it in the title :^)

This allows us to follow the spec much more closely rather than being
completely ad-hoc with just the parse node instead of having all the
surrounding data such as the realm of the parse node.

The interpreter creation refactor creates the global execution context
once and doesn't take it off the stack. This allows LibWeb to take the
global execution context and manually handle it, following the HTML
spec. The HTML spec calls this the "realm execution context" of the
environment settings object.

It also allows us to specify the globalThis type, as it can be
different from the global object type. For example, on the web, Window
global objects use a WindowProxy global this value to enforce the same
origin policy on operations like [[GetOwnProperty]].

Finally, it allows us to directly call Program::execute in perform_eval
and perform_shadow_realm_eval as this moves
global_declaration_instantiation into Interpreter::run
(ScriptEvaluation) as per the spec.

Note that this doesn't evalulate Source Text Modules yet or refactor
the bytecode interpreter, that's work for future us :^)

This patch was originally build by Luke for the environment settings
object change but was also needed for modules. So I (davidot) have
modified it with the new completion changes and setup for that.

Co-authored-by: davidot <davidot@serenityos.org>
2022-01-22 01:21:18 +00:00
davidot
232a8432b7 LibJS: Move binding_class_declaration_evaluation out of ClassDeclaration 2022-01-22 01:21:18 +00:00
davidot
39b134e8c1 LibJS: Move async_block_start out of ECMAScriptFunctionObject 2022-01-22 01:21:18 +00:00
Ali Mohammad Pur
cd83325c7c LibRegex: Preserve capture groups and matches across ForkReplace
This makes the (flawed) ForkStay inserted as a loop header unnecessary,
and finally fixes LibRegex rewriting weird loops in weird ways.
2022-01-22 00:35:49 +00:00
Ali Mohammad Pur
bc20e4f71d LibRegex: Add some more information to Compare::Reference debug output 2022-01-22 00:35:49 +00:00
Ali Mohammad Pur
97dde09170 LibRegex: Allow ClearCaptureGroup to create new groups
Instead of leaking all capture groups and selectively clearing some,
simply avoid leaking things and only "define" the ones that need to
exist.
This *actually* implements the capture groups ECMA262 quirk.
Also adds the test removed in the previous commit (to avoid messing up
test runs across bisects).
2022-01-22 00:35:49 +00:00
Ali Mohammad Pur
704e0654b3 Revert "LibRegex: Implement an ECMA262 Regex quirk with negative loo..."
This partially reverts commit c11be92e23.
That commit fixes one thing and breaks many more, a next commit will
implement this quirk in a more sane way.
2022-01-22 00:35:49 +00:00
Maciej
e0d3a8f6ce LibGfx: Fix stylistic issues in BitmapFont
* Apply some clang-tidy suggestions
* Convert to east-const
2022-01-22 00:26:23 +00:00
Maciej
b6d6cc5de4 LibGUI: Use Font::glyph_or_emoji_width() in TextEditor
This fixes selection of text containing emoji when variable-width font
is set.
2022-01-22 00:26:23 +00:00
Maciej
8542d1da5a LibGfx: Always scale emojis to fit font height 2022-01-22 00:26:23 +00:00
kleines Filmröllchen
7a92842017 LibCore: Populate the read buffer of Core::Stream::BufferedHelper
Previously, we weren't ever populating the read buffer in read(), which
was making the BufferedHelper useless, how silly :^). This introduces
a buffer refill when we have run out of buffered samples, restoring
FlacLoader performance from the new low of 200% (directly before this
commit) to the old level of ~1400%.
2022-01-22 01:13:42 +03:30
kleines Filmröllchen
8a92573732 LibAudio: Convert FlacLoader to use new Core::Stream APIs :^)
For this change to work "easily", Loader can't take const ByteBuffer's
anymore, which is fine for now.
2022-01-22 01:13:42 +03:30
kleines Filmröllchen
4f48a086b7 LibAudio: Add LOADER_TRY to auto-convert Error to LoaderError 2022-01-22 01:13:42 +03:30
kleines Filmröllchen
9702f2010f LibAudio: Add Error conversion constructor for LoaderError
This will become necessary shortly when we quickly want to promote an
AK::Error to an Audio::LoaderError.
2022-01-22 01:13:42 +03:30
kleines Filmröllchen
d786142eca LibCore: Introduce MemoryStream
MemoryStream is the Core::Stream API's streamlike access to a chunk of
memory, mimicking AK::DuplexMemoryStream. The implementation is very
similar, except that no APIs except the SeekableStream operations
currently exist. This will be fine for the first users and can be
expanded upon later.
2022-01-22 01:13:42 +03:30
kleines Filmröllchen
caeb8fc691 LibCore: Introduce BigEndianInputBitStream
BigEndianInputBitStream is the Core::Stream API's bitwise input stream
for big endian input data. The functionality and bitwise read API is
almost unchanged from AK::BitStream, except that this bit stream only
supports big endian operations.

As the behavior for mixing big endian and little endian reads on
AK::BitStream is unknown (and untested), it was never done anyways. So
this was a good opportunity to split up big endian and little endian
reading.

Another API improvement from AK::BitStream is the ability to specify
the return type of the bit read function. Always needing to static_cast
the result of BitStream::read_bits_big_endian into the desired type is
adding a lot of avoidable noise to the users (primarily FlacLoader).
2022-01-22 01:13:42 +03:30
Dylan Katz
3919a1dcc0 Browser: Load icons at start of program
Previously, Browser loaded icons from the disk every time an icon
was set. In addition to making more calls to the disk and decoding
more images, this makes error propagation impossible. This change
moves all icon loading to the start of the program.
2022-01-21 22:14:13 +01:00
Dylan Katz
a2a93727db LibGUI: Allow Button::set_icon to accept a bitmap without a move
Previously, Button::set_icon required moving the bitmap into the
button, preventing the same bitmap from being used by multiple
buttons at once. While this works for buttons that are created once,
any button that is dynamically added would require the same bitmap to
be loaded every single time. In addition to being ineffecient, this
also makes error checking more difficult.

With this change, a bitmap can be loaded once, and passed to multiple
buttons.
2022-01-21 22:14:13 +01:00
Jean-Baptiste Boric
12a6ec9292 LibCore: Parse classless symbolic notation 2022-01-21 22:10:23 +01:00
Jean-Baptiste Boric
736af8c7da groups: Do not attempt to open /etc/groups 2022-01-21 22:10:23 +01:00
Jean-Baptiste Boric
7fe7eab308 pwd: Add missing rpath pledge 2022-01-21 22:10:23 +01:00
Timothy Flynn
9cd93944b8 LibJS: Change test conditions to pass in all time zones
Mostly slapping "timeZone: UTC" on DateTimeFormat tests (we have other
tests for specific time zones). Also pick dates that are not on DST
boundaries in some time zones where that matters.
2022-01-21 19:14:38 +00:00
Kenneth Myhra
1fb8408aa2 LibCore: Do not leak FILE pointer in Group::add_group()
By using a ScopeGuard we make sure that we always close the FILE, also
on early returns.
2022-01-21 18:34:24 +01:00
Kenneth Myhra
6df3fdd83f LibCore: Use generic AK_OS_BSD_GENERIC to hide Group::add_group()
This hides the method Group::add_group() on both MacOS and OpenBSD since
the function putgrent(), which is essential for add_group() to work, is
not available on these OSes.
2022-01-21 18:34:24 +01:00
Idan Horowitz
0adee378fd Kernel: Stop using LibKeyboard's CharacterMap in HIDManagement
This was easily done, as the Kernel and Userland don't actually share
any of the APIs exposed by it, so instead the Kernel APIs were moved to
the Kernel, and the Userland APIs stayed in LibKeyboard.

This has multiple advantages:
 * The non OOM-fallible String is not longer used for storing the
   character map name in the Kernel
 * The kernel no longer has to link to the userland LibKeyboard code
 * A lot of #ifdef KERNEL cruft can be removed from LibKeyboard
2022-01-21 18:25:44 +01:00
Ali Mohammad Pur
78d1093dab Shell: Make Juxtaposition autocompletion smarter
Now something like `"$HOME"/` autocompletes correctly.
Note that only the first element of lists is used to autocomplete
things.
2022-01-21 18:58:28 +03:30
Ali Mohammad Pur
2e333b3571 Shell: Make SimpleVariable::hit_test_position not hit irrelevant offsets
Without this, any offset would be accepted as being part of the
SimpleVariable.
Fixes #11976 (by making it no longer crash).
2022-01-21 18:58:28 +03:30
Ali Mohammad Pur
9eccd4c56e LibRegex: Allow the pattern to match the zero-length end of the string
...only if Multiline is not enabled.
Fixes #11940.
2022-01-21 18:14:08 +03:30
Ali Mohammad Pur
c11be92e23 LibRegex: Implement an ECMA262 Regex quirk with negative lookarounds
This implements the quirk defined by "Note 3" in section "Canonicalize"
(https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch).

Crosses off another quirk from #6042.
2022-01-21 18:14:08 +03:30
Ali Mohammad Pur
bfe8f312f3 LibRegex: Correct jump offset to the start of the loop block
Previously we were jumping to the new end of the previous block (created
by the newly inserted ForkStay), correct the offset to jump to the
correct block as shown in the comments.
Fixes #12033.
2022-01-21 18:14:08 +03:30
sin-ack
3de51a4b99 LibCore: Make sockets close-on-exec by default
This mirrors the previous default in Core::LocalSocket, and is the safer
default anyway. This prevents fds from living on in other processes when
exec() is called in certain programs such as Assistant.

Fixes #12029.
2022-01-21 15:21:52 +01:00
Luke Wilde
483ab7fe26 LibGL: Fix incorrect GL_DECAL constant value
The constant value for GL_DECAL is 0x2101 instead of 0x2102.
This was tripping up Half-Life when making the water texture
transparent when under water. The Half-Life port uses its own OpenGL
header, meaning this error wasn't hidden by us.
2022-01-21 15:21:25 +01:00
Rummskartoffel
5b2c973cc3 UserspaceEmulator: Correctly fail in execve when binary is inaccessible
Previously, Emulator::virt$execve would not report ENOENT and EACCES
when the binary to be executed was nonexistent or not executable. This
broke the execp family of functions, which rely on ENOENT being reported
in order to know that they should continue searching $PATH.
2022-01-21 14:45:04 +02:00
Rummskartoffel
d2f99c200f UserspaceEmulator: Fix execve messing up command lines with "--"
Emulator::virt$execve would construct command lines such as
`/bin/UserspaceEmulator echo -- hello` instead of
`/bin/UserspaceEmulator -- echo hello`, which naturally caused problems.
This commit moves the "--" to the correct place.
2022-01-21 14:45:04 +02:00
Maciej
2cda579b07 Taskbar: Remove QuickLaunch entries if corresponding file was deleted 2022-01-21 13:44:36 +01:00
Maciej
0252c1f8fa Taskbar: Support arbitrary *files* as QuickLaunch entries 2022-01-21 13:44:36 +01:00
Maciej
07cf2218cb LibDesktop: Add Launcher::ensure_connection()
This can be use force connection at startup and not to leave 'unix'
pledge all the time.
2022-01-21 13:44:36 +01:00
Maciej
3022baddc2 Taskbar: Support arbitrary executables as QuickLaunch entries 2022-01-21 13:44:36 +01:00
Maciej
2e8e959896 Taskbar: Abstract out quick launch entries
... into QuickLaunchEntry class. It will be used to implement adding
plain executables to the taskbar. For now, it adds TRY() error handling
to app launching :^)
2022-01-21 13:44:36 +01:00
Maciej
ccb8374434 LibCore: Add Core::System wrapper for disown() 2022-01-21 13:44:36 +01:00
Maciej
0badfd7b32 LibCore: Handle null lines in ConfigFile
Fixes nullptr dereference when trying to read binary files.
2022-01-21 13:44:36 +01:00
Morten Larsen
f71584b917 LibJS: Increase margin in check for stack space limit
test-js crashes with a segmentation fault when running on macOS on Arm.
Increasing the margin in the test in did_reach_stack_space_limit() to
32 * KiB makes the tests pass. To simplify the code, this is applied
independently of platform, and the previous test for use of an address
sanitizer is removed.
2022-01-21 13:37:27 +02:00
David Lindbom
2ed4e47300 zip: Add unveil and pledge promises 2022-01-21 02:00:53 +01:00
David Lindbom
9d7a862509 cal: Add unveil and pledge promises 2022-01-21 02:00:53 +01:00
David Lindbom
5c74e66f85 aplay: Add unveil and pledge promises 2022-01-21 02:00:53 +01:00
mjz19910
2cf02c6f38 adjtime: Port to LibMain 2022-01-21 01:52:22 +01:00
mjz19910
14a267347c LibCore: Add ArgsParser::add_option for Optional double 2022-01-21 01:52:22 +01:00
mjz19910
a9fb34ca6f LibCore: Add ErrorOr wrapper for adjtime 2022-01-21 01:52:22 +01:00
Luke Wilde
5ac57db5e9 LibWeb: Don't match the node querySelector(All) was called on
In querySelector(All)'s use of "Match a Selector Against a Tree", it
passes in the node the function was called on as the "optional scoping
root", which causes it and the nodes which aren't descendants of it 
to be excluded from the list of possible nodes to match against.
For us, this is the equivalent of using the non-inclusive variant of
`for_each_in_subtree_of_type`.

This was tripping up the node re-ordering logic of d3 and would cause
it to try and reinsert nodes into their parent, causing an exception
to be thrown.

Note that this should be shadow-including, but we don't currently have
shadow-including tree traversal as per https://dom.spec.whatwg.org/#concept-shadow-including-tree-order

https://drafts.csswg.org/selectors-4/#match-a-selector-against-a-tree
https://dom.spec.whatwg.org/#scope-match-a-selectors-string
2022-01-20 22:18:07 +00:00
Idan Horowitz
29cb7316d0 LibJS: Implement ECMA-402 compliant TypedArray.prototype.toLocaleString 2022-01-20 12:50:37 +00:00
sin-ack
ab36fb7a23 LibCore: Use Core::System and Error::from_syscall in Stream classes
This makes what caused a failure more obvious.
The use of Core::System additionally allows us to remove a lot of
boilerplate code from Stream classes.
2022-01-20 10:40:51 +01:00
sin-ack
301f4c469f LibCore: Implement Core::System::lseek 2022-01-20 10:40:51 +01:00
sin-ack
4d2e3de94c LibCore: Don't manually close the fd when connection fails in sockets
This is wrong because we have already set the fd in the
PosixSocketHelper, and the destructor of the respective Socket class
will close the fd for us. With the manual closing of the fd, we attempt
to close the same fd twice which results in a crash.

Thanks to stelar7 for noticing this bug.
2022-01-20 10:40:51 +01:00
Mustafa Quraish
ee74aafdca FileSystemAccessClient: Remove old API returning file descriptors :^)
Since all users of the old API are now removed, this commit removes all
the methods that returned raw file descriptors, in favor of returning
`ErrorOr<NonnullRefPtr<Core::File>`.
2022-01-20 10:39:12 +01:00
Mustafa Quraish
bba32de857 SpreadSheet: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
ca2c7dced5 3DFileViewer: Use FileSystemAccessClient::try_* APIs
This commit also removed the redundant `filename` parameter from
`GLContextWidget::load_file`, since the filename is already stored
within the file itself.
2022-01-20 10:39:12 +01:00
Mustafa Quraish
abb16683c9 ThemeEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
f674102447 TextEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
effb19f996 PDFViewer: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
1c3e93c6e0 PixelPaint: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
aae96af812 HexEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
0c98e553e8 FileSystemAccessClient: Add try_* variants returning Core::File
The current implementation is a bit of a hack since we also want to keep
around the previous variants for now, but will be cleaned up later once
all applications have been ported to the new API.
2022-01-20 10:39:12 +01:00
Sam Atkins
94f2508519 CrashReporter: Don't crash when investigating a HackStudio crash
Previously when opening a crash report for HackStudio, the
`unveil("/bin/HackStudio", "rx")` call was failing because of the
earlier `unveil(executable_path.characters(), "r")` call requesting only
"r" permissions for it. This patch handles this specific case, so you
can crash HackStudio to your heart's content. :^)

Also, we were unveiling the executable path twice, once manually and
once implicitly as part of the coredump's libraries, so we now check for
the latter and avoid it.

Thanks to Daniel for noticing what was right in front of me and I didn't
see!

Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
2022-01-20 10:38:10 +01:00
Dmitry Petrov
1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Dmitry Petrov
d61cc47055 Kernel: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Jelle Raaijmakers
a8655fbf52 LibGL+LibSoftGPU: Clean up some for loops 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
12d7b4e9ac LibGL: Rename GLMat.cpp to GLMatrix.cpp 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
08826d60ad LibGL: Transpose matrix in glGetDoublev and glGetFloatv
We were returning row-major matrices when OpenGL clients are expecting
column-major instead.
2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
16255d161e LibGL: Use 4 hex characters for error code constants in gl.h 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
c846ed0a2c LibGL: Report GL errors to debug console 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
c5abef86db LibGL: Stub GL_BACK implementation for glPolygonMode
This prevents overwriting the front face mode when providing `GL_BACK`
as a parameter.
2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
453f62c935 LibGL+LibSoftGPU: Implement GL_POLYGON_OFFSET_FILL capability 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
991cbc56a2 LibGL: Implement glColor4b 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
29dc17b7b9 LibGL: Correct values for GL_BGR and GL_BGRA 2022-01-20 10:35:01 +01:00
Undefine
9a28ef7aa9 SystemMonitor: Show unknown in PCI devices
In case when the PCI class, device or vendor is unknown, show
that it is unknown instead of just putting the ID
2022-01-19 21:47:40 -08:00
Sam Atkins
b34950a825 LibWeb: Add Formatters for Length, Percentage and LengthPercentage 2022-01-20 00:04:10 +01:00
Sam Atkins
bfcbab0dcf LibWeb: Remove reference_for_percent parameter from Length::resolved()
Despite looking like it was still needed, it was only used for passing
to other calls to Length::resolved() recursively. This makes the
various `foo.resolved().resolved()` calls a lot less awkward.
(Though, still quite awkward.)

I think we'd need to separate calculated lengths out to properly tidy
these calls up, but one yak at a time. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
cff44831a8 LibWeb: Remove Length::Type::Percentage :^)
All `<percentage>`s in the CSS grammar are now represented by the
`Percentage` class, and `<length-percentage>` by `LengthPercentage`.
2022-01-20 00:04:10 +01:00
Sam Atkins
5e9a6302e5 LibWeb: Convert opacity property from Length to Percentage 2022-01-20 00:04:10 +01:00
Sam Atkins
dc681913e8 LibWeb: Convert width/height and min-/max- versions to LengthPercentage
A lot of this is quite ugly, but it should only be so until I remove
Length::Type::Percentage entirely. (Which should happen later in this
PR, otherwise, yell at me!) For now, a lot of things have to be
resolved twice, first from a LengthPercentage to a Length, and then
from a Length to a pixel one.
2022-01-20 00:04:10 +01:00
Sam Atkins
cb0cce5cdc LibWeb: Convert flex-basis to LengthPercentage
The flexbox logic confuses me so regressions are possible, though our
test page looks the same as before so it should be fine.

Renamed FlexBasis::Length -> LengthPercentage too, for clarity.
2022-01-20 00:04:10 +01:00
Sam Atkins
784ba2ec42 LibWeb: Convert background-position to LengthPercentage
Not much needed changing this time, hurrah! :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
0162ca912b LibWeb: Handle percentage font sizes 2022-01-20 00:04:10 +01:00
Sam Atkins
c8409cd58d LibWeb: Remove Node::m_font_size
This was only ever used in order to set the m_font_size for another
Node, so it can just go. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
e60d51b8eb LibWeb: Handle percentage and number line-heights
This does undo the changes in 88c32836d8,
which accounted for our bitmap fonts being a different size than the
`font-size` property requests. I think this would be better handled
inside Length::to_px(), which would then apply to all font-size-relative
lengths (eg, em and rem) instead of only for the line-height property.
2022-01-20 00:04:10 +01:00
Sam Atkins
1f8cd029a5 LibWeb: Add missing "auto" identifiers for min-width/height
Both of these have "auto" as their initial value, so the only reason
they work currently is that "auto" is implicitly a Length.
2022-01-20 00:04:10 +01:00
Sam Atkins
f602249ae9 LibWeb: Convert background-size from Length to LengthPercentage
Checking these for `auto` is awkward, but separating that will come
later. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
f75e796909 LibWeb: Convert border-radii from Length to LengthPercentage :^)
The visit_lengths() code is a bit awkward but we'll clean that up later.
2022-01-20 00:04:10 +01:00
Sam Atkins
2a3abf09ff LibWeb: Remove BorderRadiusStyleValue::to_length() hack
Layout::Node still treats border radii as having a single value instead
of horizontal and vertical, but one less hack is nice, and helps with
conversion to LengthPercentage. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
a26cec3805 LibWeb: Convert stroke-width to LengthPercentage
This is a guinea pig. So far so good?
2022-01-20 00:04:10 +01:00