Commit graph

30989 commits

Author SHA1 Message Date
Sam Atkins
1d5d27aa22 LibWeb: Include custom properties in CSS dump 2021-12-09 21:30:31 +01:00
Andreas Kling
c268d0fa13 LibWeb: Make CSS::Screen forward its ref count to DOM::Window 2021-12-09 21:28:52 +01:00
Andreas Kling
7fc770cfac LibWeb: Make DOM::NamedNodeMap forward its ref count to DOM::Element
This allows JS to keep an element alive by retaining a reference to
element.attributes
2021-12-09 21:28:52 +01:00
Andreas Kling
d368b08698 LibWeb: Make DOMImplementation forward its ref count to DOM::Document
This allows document.implementation to keep the underlying document
alive for as long as we need it (for example, if someone holds on to a
DOMImplementation JS wrapper after the document is GC'd.)
2021-12-09 21:28:52 +01:00
Andreas Kling
e1287a9a45 LibWeb: Use RefCountForwarder for NavigationTiming::PerformanceTiming
This object already forwarded its ref count to DOM::Window. This patch
simply adopts the new RefCountForwarder base to achieve the same thing.
2021-12-09 21:28:52 +01:00
Andreas Kling
c9a35e104b AK: Add RefCountForwarder<T>
This is a convenience template that implements reference count
forwarding. This means that an object forwards ref() and unref() to
another object.

We can use this when two ref-counted objects need to keep each other
alive. This situation poses two problems:

- Using 2x RefPtr would cause a ref cycle and leak both objects.
- Using 2x WeakPtr would allow one of them to be destroyed early.

With RefCountForwarder, only one of the objects has a ref count. The
object with the ref count points to the forwarding object by using a
non-counting smart pointer (OwnPtr or NonnullOwnPtr). Thus, both objects
are kept alive by the same ref count, and they can safely point to each
other without worrying about disjoint lifetimes.
2021-12-09 21:28:52 +01:00
Andreas Kling
fed6a76990 LibJS: Add Handle::operator->() 2021-12-09 21:28:52 +01:00
Nathan Ell
a1580a1d00 dos2unix: Swap to official signature validation
In the initial port of dos2unix, there was a miss in the validation
of the files. Let's switch to the original author's official
signed verification of the source :^)
2021-12-09 09:48:43 +01:00
Ben Wiederhake
aa5f130c84 Inspector: Remove unused includes
Found while working on something else.
2021-12-08 17:18:37 -08:00
Lady Gegga
183b47733a Base: Add Ancient Greek Numbers to font Katica Regular 10
10140-1018E https://www.unicode.org/charts/PDF/U10140.pdf
2021-12-08 17:17:51 -08:00
Lady Gegga
9ae7efb0bd Base: Add Zanabazar Square characters to font Katica Regular 10
11A00-11A47 https://www.unicode.org/charts/PDF/U11A00.pdf
2021-12-08 17:17:51 -08:00
James Puleo
dd25dfbc20 js: Improve usage of TRY when executing a file program 2021-12-08 17:17:35 -08:00
Linus Groh
859b810db1 LibJS/Tests: Enable two more skipped tests which now pass
Only two skipped tests remaining overall :^)
2021-12-08 20:08:26 +00:00
Linus Groh
f1dafabbb9 LibJS: Simplify TemporalInstantString
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/271d71c
2021-12-08 19:57:19 +00:00
Luke Wilde
4f3c283f24 LibJS: Move calendar validation out of parse_temporal_calendar_string
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7207a1c
2021-12-08 19:11:50 +00:00
Luke Wilde
80dcddacea LibJS: Simplify return in parse_temporal_date_time_string
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/1f7e486
2021-12-08 19:11:50 +00:00
Luke Wilde
6244969ae2 LibJS: Remove duplicated spec step in parse_iso_date_time
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/516bf24
2021-12-08 19:11:50 +00:00
Ben Wiederhake
9f91f610e2 test-crypto: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
13cba5f8b4 Spreadsheet: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
7967a8bd8c LibTLS: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
f3e496d995 LibSQL: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
f59f7674c8 LibHTTP: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
d78365f785 LibGemini: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
18ae5ede88 LibCrypto+Tests: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
643ec03608 LibCore: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake
768b70cc4d AK+Tests: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Roberto Bampi
70660a79af Base: Add archive icons and use them for compressed files
Both 16x16 and 32x32 variants have been added.
2021-12-08 17:59:00 +01:00
Timothy Flynn
1e68e7f129 LibJS: Implement Intl.DateTimeFormat.prototype.formatToParts 2021-12-08 11:29:36 +00:00
Timothy Flynn
adaf5985a4 LibJS: Implement (most of) Intl.DateTimeFormat.prototype.format
There are a few FIXMEs that will need to be addressed, but this
implements most of the prototype method. The FIXMEs are mostly related
to range formatting, which has been entirely ignored so far. But other
than that, the following will need to be addressed:

* Determining flexible day periods must be made locale-aware.
* DST will need to be determined and acted upon.
* Time zones other than UTC and calendars other than Gregorian are
  ignored.
* Some of our results differ from other engines as they have some
  format patterns we do not. For example, they seem to have a lonely
  {dayPeriod} pattern, whereas our closest pattern is
  "{hour} {dayPeriod}".
2021-12-08 11:29:36 +00:00
Timothy Flynn
d010ba10c3 LibJS: Cache the data locale used by Intl.DateTimeFormat
Unlike the locale, the data locale has Unicode locale extensions removed
(e.g. the data locale for "en-US-u-ca-gregory" is just "en-US"). Cache
the data locale for LibUnicode lookups during formatting.
2021-12-08 11:29:36 +00:00
Timothy Flynn
4cc8cf9233 LibJS: Add an accessor for the %Date.now% instrinsic property 2021-12-08 11:29:36 +00:00
Timothy Flynn
baf3f3bd6e LibJS: Implement Date's Week Day AO 2021-12-08 11:29:36 +00:00
Timothy Flynn
e56be34148 LibJS: Implement Date's TimeClip AO 2021-12-08 11:29:36 +00:00
Timothy Flynn
b76e44f66f LibUnicode: Parse and generate time zone names in long and short form 2021-12-08 11:29:36 +00:00
Timothy Flynn
2bbf8aa24c LibUnicode: Generate era, month, weekday and day period calendar symbols
The parsing in parse_calendar_symbols() might be a bit more verbose than
it really needs to be, but it is to ensure the symbols are generated in
a known order that we can control with enumerations.
2021-12-08 11:29:36 +00:00
Timothy Flynn
26f9666191 LibJS: Do not override hour, minute, and second format field lengths
This was an oversight in e42d954743.

These fields should always follow the locale preference in the CLDR.
Overriding these fields would permit formats like "h:mm:ss" to result in
strings like "1:2:3" instead of "1:02:03".
2021-12-08 11:29:36 +00:00
Timothy Flynn
9f7c727720 LibJS+LibUnicode: Generate missing patterns with fractionalSecondDigits
TR-35's Matching Skeleton algorithm dictates how user requests including
fractional second digits should be handled when the CLDR format pattern
does not include that field. When the format pattern contains {second},
but does not contain {fractionalSecondDigits}, generate a second pattern
which appends "{decimal}{fractionalSecondDigits}" to the {second} field.
2021-12-08 11:29:36 +00:00
Timothy Flynn
6ace4000bf LibJS+LibUnicode: Supply field type in CalendarPattern's for-each method
Some callers will want different behavior depending on what field is
being provided to the callback.
2021-12-08 11:29:36 +00:00
Timothy Flynn
80ea6e664d LibUnicode: Do not set day period format length for {ampm} segments
TR-35 does define lengths for {ampm}, but they are unused by ECMA-402.
To the contrary, defining the day_period length for this segment will
prevent BasicFormatMatcher from ever selecting a pattern that contains
this segment. Instead, ECMA-402 will only use the short length for
{ampm} segments.
2021-12-08 11:29:36 +00:00
Andreas Kling
78252d7777 Ports: Add SHA256 checksum to dos2unix port 2021-12-08 10:48:39 +01:00
Andreas Kling
fa879168f5 LibJS: Mark Function object's private environment during GC 2021-12-08 10:29:54 +01:00
Andreas Kling
f25899ca34 LibJS: Mark entire private environment chains during GC 2021-12-08 10:29:54 +01:00
Andreas Kling
4790f9a628 LibJS: Make sure private environments are marked during GC 2021-12-08 10:29:54 +01:00
Andreas Kling
212319b25e LibJS: Only allocate space for Object private elements if needed
Most JavaScript objects don't have private elements, so this reduces the
size of typical JS::Object instances by two pointers.
2021-12-08 10:29:54 +01:00
Nathan Ell
444a7eb929 dos2unix: Introduce dos2unix port
Port the ubiquitous dos2unix tool to Serenity. Dos2Unix is a suite of
tools for converting file line endings, from dos/mac to unix and unix
to dos/mac.
2021-12-08 09:20:04 +01:00
Tim Schumacher
5c511de4cc AK: Zero-pad automatically if formatting with precision 2021-12-07 20:13:59 -08:00
Lady Gegga
aad9d0aa51 Base: Add some Chinese characters to Katica Regular 10
7530, 7531, 7532, 7533, 7534, 7536, 7684, 81EA, 81EB, 548C,
548B, 4E04, 4E05, 4E09, 4E0A, 4E0B, 4E0C, 7518, 754C, 753D,
753C, 753A, 6743, 4E14, 4E17, 65E5, 65E6, 65E7, 975E, 5211,
5E76, 5E75, 5E77, 5E72, 5E73
https://www.unicode.org/charts/PDF/U4E00.pdf
2021-12-07 17:05:57 -08:00
Lady Gegga
d3fe5fc1b2 Base: Adjust some Chinese characters in Katica Regular 10
4E8C, 4E00
2021-12-07 17:05:57 -08:00
Lady Gegga
4d088763bd Base: Add some Enclosed CJK Letters and Months to Katica Regular 10
3220, 3221, 3222
https://www.unicode.org/charts/PDF/U3200.pdf
2021-12-07 17:05:57 -08:00
Lady Gegga
3296e54479 Base: Add some CJK Symbols and Punctuations to Katica Regular 10
3001, 3002, 303E, 303F
https://www.unicode.org/charts/PDF/U3000.pdf
2021-12-07 17:05:57 -08:00