Commit graph

8205 commits

Author SHA1 Message Date
Timothy Flynn
a027ccad75 LibTimeZone+Userland: Rename current_time_zone to system_time_zone
This renames the current implementation of current_time_zone to
system_time_zone to more clearly indicate what it is. Then reimplements
current_time_zone to return whatever was set up by tzset, falling back
to UTC if something went awry, for convenience.
2022-01-25 18:39:36 +00:00
Timothy Flynn
024f869f09 LibC: Ensure tzname and related fields are intialized
If a program never invokes tzset, the tzname variable should have system
dependent default values.
2022-01-25 18:39:36 +00:00
Timothy Flynn
cd0e5ccd3f LibC: Revert localtime_r to use time zone information set by tzset
Now that tzset actually detects time zones, parties interested in time
zone offsets should invoke tzset.
2022-01-25 18:39:36 +00:00
Timothy Flynn
11f1f04a4c LibC: Invoke tzset from time functions required to update time zone info
From POSIX:

    the ctime(), localtime(), mktime(), strftime(), and strftime_l()
    functions are required to set timezone information as if by calling
    tzset()

ctime is excluded here because it invokes localtime, so there's no need
to invoke tzset twice.
2022-01-25 18:39:36 +00:00
Timothy Flynn
b1ea585149 LibC: Implement tzset with time zone awareness in accordance with POSIX 2022-01-25 18:39:36 +00:00
Timothy Flynn
6095500263 LibC: Define the POSIX TZNAME_MAX limit
POSIX defines this as the "Maximum number of bytes supported for the
name of a timezone (not of the TZ variable)." It must have a minimum
value of _POSIX_TZNAME_MAX (6). The longest time zone name in the TZDB
is about 40 chars, so 64 is chosen here for a little wiggle room, and
to round up to a power of 2.
2022-01-25 18:39:36 +00:00
Timothy Flynn
7103012c7d LibTimeZone: Add an API to retrieve both daylight and standard offsets
This API will also include the formatted name of the time zone, with
respect for DST (e.g. EST vs EDT for America/New_York).
2022-01-25 18:39:36 +00:00
Idan Horowitz
67ce9e28a5 AK: Standardize the behaviour of GenericLexer::consume_until overloads
Before this commit all consume_until overloads aside from the Predicate
one would consume (and ignore) the stop char/string, while the
Predicate overload would not, in order to keep behaviour consistent,
the other overloads no longer consume the stop char/string as well.
2022-01-25 13:41:09 +03:30
Idan Horowitz
d49d2c7ec4 AK: Add a consume_until(StringView) overload to GenericLexer
This allows us to skip a strlen call.
2022-01-25 13:41:09 +03:30
Andreas Kling
d1cea57246 LibThreading: Invoke BackgroundAction completions on origin event loop
We now capture the origin thread's current event loop when setting up
a BackgroundAction and then invoke the on_complete callback on that same
event loop.
2022-01-25 09:13:40 +01:00
Andreas Kling
3bab93c5e7 LibCore: Make Core::s_main_event_loop actually global
This was accidentally per-TU, as it was declared "static" in the header.
2022-01-25 09:13:40 +01:00
Linus Groh
96db8a061b LibJS: Correct FormatTimeZoneOffsetString arg in CreateTemporalTimeZone
This is an editorial change in the Temporal spec (accidentally marked
normative).

See: https://github.com/tc39/proposal-temporal/commit/3039c98
2022-01-25 00:06:49 +00:00
Sam Atkins
fa3c61cf5a LibPDF: Make Filter::decode() return ErrorOr 2022-01-24 22:36:09 +01:00
Sam Atkins
c388a879d7 AK+Userland: Make AK::decode_base64 return ErrorOr 2022-01-24 22:36:09 +01:00
Sam Atkins
f590cd1850 AK+Userland: Make AK::decode_hex() return ErrorOr
This lets us propagate the reason why it failed up to the caller. :^)
2022-01-24 22:36:09 +01:00
Sam Atkins
45cf40653a Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOr
Apologies for the enormous commit, but I don't see a way to split this
up nicely. In the vast majority of cases it's a simple change. A few
extra places can use TRY instead of manual error checking though. :^)
2022-01-24 22:36:09 +01:00
Linus Groh
140f1d9e55 LibJS/Tests: Enable Number.isInteger() test that now passes 2022-01-24 20:39:01 +00:00
Linus Groh
73a43e7cba LibJS: Update ShadowRealm AO parameter declaration notations
This is an editorial change in the ShadowRealm spec.

See: https://github.com/tc39/proposal-shadowrealm/commit/f5013fe
2022-01-24 20:17:07 +00:00
Linus Groh
e20efaa083 LibJS: Let WrappedFunction inherit target name and length
This is a normative change in the ShadowRealm spec.

See: https://github.com/tc39/proposal-shadowrealm/commit/b73a1dc
2022-01-24 20:17:07 +00:00
Linus Groh
886d6c62f9 LibJS: Implement the SetFunctionLength AO 2022-01-24 20:17:07 +00:00
Linus Groh
5b04c49762 LibJS: Implement the SetFunctionName AO 2022-01-24 20:17:07 +00:00
davidot
6fa600fce3 LibJS: Fix the execution context for the bytecode interpreter
Because we now push an execution context when creating the "normal"
interpreter without valid environments we have to check for that case
as well when running the bytecode interpreter.
2022-01-24 19:55:50 +00:00
Tom
a821aa5f50 LibEDID: Fix handling extension maps
We weren't properly iterating the extension blocks and thought we
encountered an unexpected extension map block, when we really should
have just skipped over it.
2022-01-24 19:29:06 +00:00
Tom
18fc54fc34 LibEDID: Fix calculating height and refresh rate for interlaced modes
The vertical values need to be multiplied with 2 for interlaced modes.
2022-01-24 19:29:06 +00:00
Sam Atkins
de3225a28b LibProtocol: Overload Request::stream_into() to accept a Core::Stream
The code is actually identical to the other stream_into() function.
2022-01-24 17:10:01 +01:00
Andreas Kling
0b997b9d35 LibWeb: Resolve a FIXME when determining target of an event handler
For body and frameset events that aren't part of the special handling
sets, just let them through to the element.
2022-01-24 17:09:22 +01:00
Sam Atkins
ae99cbe534 LibWeb: Treat SVG fill/stroke/stroke-width attributes as CSS properties
Rather than having separate systems for the attributes and their CSS
equivalents, we can treat the attributes as presentational hints and
convert them to CSS properties. This means they can be inherited, as
they should. :^)

As noted, the `fill` and `stroke` attributes do not fully match the
`fill` and `stroke` properties. The CSS spec is still an early draft and
not entirely helpful, so we can just pretend they are the same for now.
2022-01-24 17:04:00 +01:00
Sam Atkins
2664b8ae7f LibWeb: Add none as a valid identifier for fill and stroke 2022-01-24 17:04:00 +01:00
Andreas Kling
12932d187e LibWeb: Teach StyleComputer about "Automatic Box Type Transformation"
CSS has rules about automatic blockification or inlinification of boxes
in certain circumstances.

This patch implements automatic blockification of absolutely positioned
and floating elements. This makes the smile appear on ACID2. :^)
2022-01-24 14:44:46 +01:00
Kenneth Myhra
c10abd6be2 LibCore: Add mkfifo() syscall wrapper 2022-01-24 14:01:58 +03:30
Kenneth Myhra
9fe1ebebdc LibCore: Add mknod() syscall wrapper 2022-01-24 14:01:58 +03:30
Kenneth Myhra
38472d7e02 LibC: Add POSIX spec link for unistd mknod() API 2022-01-24 14:01:58 +03:30
Xavier Defrang
070d70848f LibCore: Improve handling of parsing errors in FilePermissionsMask 2022-01-24 07:50:32 +00:00
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
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
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
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