Commit graph

30259 commits

Author SHA1 Message Date
Sam Atkins 85e5586a27 LibWeb: Add spec comments to CSS Tokenizer
Some of the code has been slightly rearranged to match the spec order,
but otherwise I've tried not to mess with it.
2021-11-19 22:35:05 +01:00
Sam Atkins 9403cc42f9 LibWeb: Convert CSS Token::m_value from StringBuilder to FlyString
Again, this value does not change once we have finished creating the
Token, so it can be more lightweight.
2021-11-19 22:35:05 +01:00
Sam Atkins 75e7c2c5c0 LibWeb: Convert CSS Token::m_unit from StringBuilder to FlyString
This value doesn't change once it's assigned to the Token, so it can be
more lightweight than a StringBuilder.
2021-11-19 22:35:05 +01:00
Sam Atkins 9286aa77bc LibWeb: Break friendship between CSS Token and Parser :^(
The Parser no longer needs to mess with Token's internals, since we have
getter functions that are safer.
2021-11-19 22:35:05 +01:00
Sam Atkins d37f62fd54 LibWeb: Verify that the Tokenizer doesn't produce Dimensions from %
If `12.34%` ever produces a Dimension token instead of a Percentage,
then something has gone wrong and we want to know about it!
2021-11-19 22:35:05 +01:00
Sam Atkins 522faa1554 LibWeb: Use number value from CSS Tokens
This lets us get rid of `try_parse_float()`, and simplifies the various
places we were calling it before.
2021-11-19 22:35:05 +01:00
Sam Atkins 1d2276f0e7 LibWeb: Return numeric values from Token value getters
This saves user code from having to parse the numbers, as we already did
that while Tokenizing. :^)

As a bonus, we now round extremely large integers to the closest
available value, like the spec tells us to.
2021-11-19 22:35:05 +01:00
Sam Atkins f6869797a7 LibWeb: Convert numeric tokens to numbers in CSS Tokenizer
The spec wants us to produce numeric values as the Tokenizer sees them,
rather than waiting until the parse stage. This is a first step towards
that.
2021-11-19 22:35:05 +01:00
thislooksfun d2ef8b29e8 CI: Prevent false errors if a commit message contains CRLF
Previously if a commit message contained any carriage returns it would
correctly fail the 'contains CRLF line breaks' test, but it would also
report 'Commit message lines are too long' and 'Commit title ends in a
period', even if neither is true.
2021-11-19 22:30:11 +02:00
Linus Groh 8d6d39e07c LibJS: Treat relativeTo parameters as PlainDate or ZonedDateTime
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/c822e14
2021-11-19 19:59:13 +00:00
Linus Groh 2ecb47c985 LibJS: Update spec comments in format_time_zone_offset_string()
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/60c753a
2021-11-19 19:29:18 +00:00
Linus Groh d0c29c9735 LibJS: Allow string as parameter in Temporal's round() / total()
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/1f0c586
2021-11-19 11:06:53 +00:00
Timothy Flynn 93ee922027 LibUnicode: Support locales-without-script aliases for ECMA-402
As noted by ECMA-402, if a supported locale contains all of a language,
script, and region subtag, then the implementation must also support the
locale without the script subtag. The most complicated example of this
is the zh-TW locale.

The list of locales in the CLDR database does not include zh-TW or its
maximized zh-Hant-TW variant. Instead, it inlcudes the zh-Hant locale.
However, zh-Hant-TW is listed in the default-content locale list in the
cldr-core package. This defines an alias from zh-Hant-TW to zh-Hant. We
must then also support the zh-Hant-TW alias without the script subtag:
zh-TW. This transitively maps zh-TW to zh-Hant, which is a case quite
heavily tested by test262.
2021-11-19 11:45:35 +01:00
Timothy Flynn 4b535ce1c8 LibUnicode: Stop passing the cldr-core package to UnicodeNumberFormat
This is no longer needed now that this generator isn't parsing the
default-content locales.
2021-11-19 11:45:35 +01:00
Timothy Flynn a13fa15a30 LibUnicode: Generate default-content locales as aliases
Previously, we were just copying the locale data into default-content
locales (for example, copying the "en" data into "en-US"). Instead, we
can just define the default-content locales as aliases to their main
locales.
2021-11-19 11:45:35 +01:00
Timothy Flynn 9d1519e21c LibUnicode: Move GenerateUnicodeData's Alias struct to generator header
This will be used for locale aliases as well. Also rename the "property"
field in this struct to "name", as it no longer is only used for
property aliases.
2021-11-19 11:45:35 +01:00
Lady Gegga 186e1b7624 Base: Add Runic characters to font Katica Regular 10
16A0–16FF https://unicode.org/charts/PDF/U16A0.pdf
Also align(move 1px up) Shavian short letters & ligatures(10464-1047F)
2021-11-19 11:30:57 +01:00
TheFightingCatfish 57541f433b LibWeb+LibHTTP: Support multiple Set-Cookie response headers 2021-11-19 13:54:35 +03:30
Pankaj Raghav 0e873464ed Hexdump: Add verbose option
Verbose option overrides the default coalescing
behaviour by displaying the complete output.
2021-11-19 12:17:57 +03:30
Pankaj Raghav d72158045c Hexdump: Allow identical lines to coalesce
Coalesce feature is enabled by default when using
the program. Any number of lines identical to the preceding line
will be replaced by a single asterik.
2021-11-19 12:17:57 +03:30
Andreas Kling e08d213830 Kernel: Use DistinctNumeric for filesystem ID's
This patch adds the FileSystemID type, which is a distinct u32.
This prevents accidental conversion from arbitrary integers.
2021-11-18 21:11:30 +01:00
Andreas Kling 7c57961c61 LibWeb: Move BrowsingContext into HTML/
Browsing contexts are defined by the HTML specification, so let's move
them into the HTML directory. :^)
2021-11-18 21:11:30 +01:00
Andreas Kling 2b866e3c9b LibGfx: Remove ImageDecoderPlugin::bitmap() in favor of frame(index)
To encourage proper support for multi-frame images throughout the
system, get rid of the single-frame convenience bitmap() API.
2021-11-18 21:11:30 +01:00
Andreas Kling 750f1d580a Fuzzers: Use ImageDecoderPlugin::frame() in image decoder fuzzers
Let's work towards getting rid of the first-frame-only bitmap() API.
2021-11-18 21:11:30 +01:00
Andreas Kling 578a576a98 Kernel: Make VirtualRangeAllocator setup functions propagate errors
If an internal allocation failure occurs while setting up a new VRA,
we'll now propagate the error to our caller instead of panicking.
2021-11-18 21:11:30 +01:00
Andreas Kling 0f22ba5bf2 AK: Make RedBlackTree::try_insert() return ErrorOr<void> instead of bool 2021-11-18 21:11:30 +01:00
Andreas Kling b285323d91 Kernel: Propagate Vector append failures from Inode::apply_flock() 2021-11-18 21:11:30 +01:00
Sam Atkins d106f20a73 LibWeb: Delete CSSLoader
All CSS loading is now done by the relevant classes:
- CSSImportRule, which loads its linked stylesheet
- HTMLStyleElement, which "loads" its contents
- HTMLLinkElement, which loads its linked stylesheet
2021-11-18 21:11:19 +01:00
Sam Atkins 60867703c0 LibWeb: Make HTMLLinkElement responsible for its own loading
This is the last use of CSSLoader, which can now be deleted.
2021-11-18 21:11:19 +01:00
Sam Atkins 6fc1810190 LibWeb: Remove for_first_not_loaded_import_rule() :^)
This was only used for making sure `@import` rules got loaded, and since
they handle that themselves now, we can get rid of all this code!
2021-11-18 21:11:19 +01:00
Sam Atkins 9d72815deb LibWeb: Remove redundant @import-handling code from CSSLoader
Now that `@import` rules load themselves, we don't want to also load
them here.
2021-11-18 21:11:19 +01:00
Sam Atkins 738e682ae0 LibWeb: Make @import rules functional again :^)
The changes in commit d462a6720a meant
that `CSSLoader::load_next_import_if_needed()` was no longer being
called, so no `@import` rules were loading.

The spec does not seem to mention when that loading should take place,
but WebKit does this at parse time, as each rule is added to the style
sheet. If it works for them, it's probably not that bad. :^)

So, that's what we now do here. The `CSSImportRule` creates a fetch
request when it is constructed, so each one is responsible for its own
contents.
2021-11-18 21:11:19 +01:00
Jelle Raaijmakers ce6fd38e5d Ports: Remove ScummVM's SVG patch
No longer necessary now that we have a better `acosf` implementation.
2021-11-18 21:10:30 +01:00
Jelle Raaijmakers dfbdd035da AK: Implement acos<T> correctly
This is a naive implementation based on the symmetry with `asin`.

Before, I'm not really sure what we were doing, but it was returning
wildly incorrect results.
2021-11-18 21:10:30 +01:00
Lady Gegga 9ea5a00e24 Base: Add Shavian characters to font Katica Regular 10
10450–1047F https://unicode.org/charts/PDF/U10450.pdf
2021-11-18 13:25:21 +01:00
Ali Mohammad Pur 387df06385 LibRegex: Avoid rewriting a+ as a* as part of atomic rewriting
The initial `ForkStay` is only needed if the looping block has a
following block, if there's no following block or the following block
does not attempt to match anything, we should not insert the ForkStay,
otherwise we would be rewriting `a+` as `a*` by allowing the 'end' to be
executed.
Fixes #10952.
2021-11-18 09:09:22 +01:00
faxe1008 f10036b7c5 LibConfig: Add list methods for groups and keys
Use the methods exposed by ConfigServer to list groups and keys.
2021-11-18 09:08:51 +01:00
faxe1008 116d89eec6 ConfigServer: Add methods to list groups and keys
Applications that make use of LibConfig anyway have now a way of listing
the groups and keys without resorting to using Core::ConfigFile
directly.
2021-11-18 09:08:51 +01:00
Lady Gegga 2266b4acdb Base: Add Deseret characters to font Katica Regular 10
10400-1044F https://www.unicode.org/charts/PDF/U10400.pdf
Adjust 1750
2021-11-18 09:08:18 +01:00
Linus Groh eaa3329573 LibJS: Fix incorrect use of "modulo" in get_iso_parts_from_epoch()
This would return incorrect results for negative inputs. It still does
to some extent, remainder() in step 2 might need to be replaced with
modulo (I opened an issue in tc39/proposal-temporal about that).
2021-11-17 22:31:28 +00:00
Linus Groh ec1e1f4f12 LibJS: Disallow Temporal.Duration input values to be non-integers
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/8c85450
2021-11-17 22:20:59 +00:00
Sam Atkins 92708746c8 LibWeb: Implement background-repeat: round :^) 2021-11-17 22:20:01 +01:00
Sam Atkins 493435c655 LibWeb: Implement background-repeat: space 2021-11-17 22:20:01 +01:00
Sam Atkins 3d1ee5b2de LibWeb: Implement background-size :^)
This is including the `cover` and `contain` modes.
2021-11-17 22:20:01 +01:00
Sam Atkins 80642b4f9d LibWeb: Implement background-position and background-origin :^) 2021-11-17 22:20:01 +01:00
Sam Atkins 16d9ae0f88 LibWeb: Stop consuming too many tokens when parsing background-position
This was causing inputs like `0% 0%` to think only one value was
provided.
2021-11-17 22:20:01 +01:00
Sam Atkins 7089681f68 LibWeb: Manually tile background images
This reimplements image tiling instead of using `Painter::blit_tiled()`,
so that we will be able to handle CSS's more complicated repetition
rules. (Like `background-repeat: space`) Otherwise this does the same as
before. :^)
2021-11-17 22:20:01 +01:00
Sam Atkins 6234e3fcb3 LibWeb: Implement background-clip :^)
We now pass in the Layout Node so that we can read the BoxModelMetrics.
Renamed a couple of variables too for clarity.
2021-11-17 22:20:01 +01:00
Sam Atkins aa43bee0d1 LibWeb: Store all background properties in BackgroundLayerData
All of this is now passed along to `paint_background()`. :^)

(As always, "all" excludes the background-color since that's not a layer
property.)
2021-11-17 22:20:01 +01:00
Sam Atkins 3d127472ba LibWeb: Remove background_image from NodeWithStyle
We now entirely use the background-layers to check images.
2021-11-17 22:20:01 +01:00