summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-11-20LibGUI: Add SettingsWindow classSam Atkins
The FooSettings apps have quite a lot of boilerplate just around creating a tabbed window with the same styling and the same row of buttons along the bottom. So, let's extract that out into a class we can reuse! :^) You create a SettingsWindow instead of a regular Window, passing a title and a flag to determine if a "Defaults" button is shown. Then call add_tab() to add tabs to it. Tabs are widgets extending SettingsWindow::Tab, which has methods for saving and resetting the values.
2021-11-20LibWeb: Use the sandboxed image ImageDecoder when loading faviconsAndreas Kling
2021-11-20LibWeb: Use the sandboxed ImageDecoder when creating image documentsAndreas Kling
An image document is the synthetic DOM::Document we create to wrap an image when you open the URL of an image directly in a web view. The path that creates these documents will now also call out to the separate ImageDecoder process for the actual decoding work.
2021-11-20LibWeb: Move ImageDecoder client connection singleton to its own fileAndreas Kling
This will allow us to use it in more places around LibWeb.
2021-11-20Meta+LibUnicode: Provide code point names through libraryBen Wiederhake
2021-11-19LibWeb: Add spec comments to CSS TokenizerSam Atkins
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-19LibWeb: Convert CSS Token::m_value from StringBuilder to FlyStringSam Atkins
Again, this value does not change once we have finished creating the Token, so it can be more lightweight.
2021-11-19LibWeb: Convert CSS Token::m_unit from StringBuilder to FlyStringSam Atkins
This value doesn't change once it's assigned to the Token, so it can be more lightweight than a StringBuilder.
2021-11-19LibWeb: Break friendship between CSS Token and Parser :^(Sam Atkins
The Parser no longer needs to mess with Token's internals, since we have getter functions that are safer.
2021-11-19LibWeb: Verify that the Tokenizer doesn't produce Dimensions from %Sam Atkins
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-19LibWeb: Use number value from CSS TokensSam Atkins
This lets us get rid of `try_parse_float()`, and simplifies the various places we were calling it before.
2021-11-19LibWeb: Return numeric values from Token value gettersSam Atkins
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-19LibWeb: Convert numeric tokens to numbers in CSS TokenizerSam Atkins
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-19LibJS: Treat relativeTo parameters as PlainDate or ZonedDateTimeLinus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/c822e14
2021-11-19LibJS: Update spec comments in format_time_zone_offset_string()Linus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/60c753a
2021-11-19LibJS: Allow string as parameter in Temporal's round() / total()Linus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/1f0c586
2021-11-19LibWeb+LibHTTP: Support multiple Set-Cookie response headersTheFightingCatfish
2021-11-18LibWeb: Move BrowsingContext into HTML/Andreas Kling
Browsing contexts are defined by the HTML specification, so let's move them into the HTML directory. :^)
2021-11-18LibGfx: Remove ImageDecoderPlugin::bitmap() in favor of frame(index)Andreas Kling
To encourage proper support for multi-frame images throughout the system, get rid of the single-frame convenience bitmap() API.
2021-11-18LibWeb: Delete CSSLoaderSam Atkins
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-18LibWeb: Make HTMLLinkElement responsible for its own loadingSam Atkins
This is the last use of CSSLoader, which can now be deleted.
2021-11-18LibWeb: Remove `for_first_not_loaded_import_rule()` :^)Sam Atkins
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-18LibWeb: Remove redundant `@import`-handling code from CSSLoaderSam Atkins
Now that `@import` rules load themselves, we don't want to also load them here.
2021-11-18LibWeb: Make `@import` rules functional again :^)Sam Atkins
The changes in commit d462a6720afe721b6821ce14d5b7802d1890b61f 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-18LibRegex: Avoid rewriting `a+` as `a*` as part of atomic rewritingAli Mohammad Pur
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-18LibConfig: Add list methods for groups and keysfaxe1008
Use the methods exposed by ConfigServer to list groups and keys.
2021-11-17LibJS: Fix incorrect use of "modulo" in get_iso_parts_from_epoch()Linus Groh
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-17LibJS: Disallow Temporal.Duration input values to be non-integersLinus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/8c85450
2021-11-17LibWeb: Implement `background-repeat: round` :^)Sam Atkins
2021-11-17LibWeb: Implement `background-repeat: space`Sam Atkins
2021-11-17LibWeb: Implement background-size :^)Sam Atkins
This is including the `cover` and `contain` modes.
2021-11-17LibWeb: Implement background-position and background-origin :^)Sam Atkins
2021-11-17LibWeb: Stop consuming too many tokens when parsing background-positionSam Atkins
This was causing inputs like `0% 0%` to think only one value was provided.
2021-11-17LibWeb: Manually tile background imagesSam Atkins
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-17LibWeb: Implement background-clip :^)Sam Atkins
We now pass in the Layout Node so that we can read the BoxModelMetrics. Renamed a couple of variables too for clarity.
2021-11-17LibWeb: Store all background properties in BackgroundLayerDataSam Atkins
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-17LibWeb: Remove background_image from NodeWithStyleSam Atkins
We now entirely use the background-layers to check images.
2021-11-17LibWeb: Remove background-repeat/image fields and gettersSam Atkins
These aren't needed now that we render using background_layers instead. The one casualty is the resolved style for background-repeat, but that was incorrect anyway.
2021-11-17LibWeb: Paint backgrounds with multiple layers :^)Sam Atkins
2021-11-17LibWeb: Store background layers in ComputedValuesSam Atkins
Instead of storing these as individual `background-foo` properties, we combine them together into layers, since that is how they will be painted. It also makes it more convenient to pass them around.
2021-11-17LibWeb: Stop 'no-repeat' from expanding the background areaSam Atkins
Previously, a `background-repeat` value of `no-repeat` in a direction would cause the image to be drawn at exactly that size. This was fine if the image was smaller than the element, but if it was larger, it would draw outside its bounds. Now, it behaves itself. :^)
2021-11-17LibWeb: Handle multiple backgrounds in StyleComputerSam Atkins
This actually involves doing *less*, because we now just pass the StyleValueLists through instead of needing to grab their first layer's value. :^)
2021-11-17LibWeb: Bring BackgroundStyleValue::to_string() to specSam Atkins
This now outputs valid CSS representing the background, instead of confusing debug info. We can't guarantee that all the longhands have the same number of values, since while that's always the case when parsing, we also create BackgroundStyleValues when producing the resolved style, which just combines the longhands together.
2021-11-17LibWeb: Parse multiple backgrounds :^)Sam Atkins
Like the `background-foo` longhand properties (except `background-color`), `background` allows multiple layers to be defined, separated by commas. A layer does not necessarily contain something to actually draw! This parses as a `BackgroundStyleValue`, holding a `StyleValueList` for each property. This is mostly to make expansion into longhands simpler - if we had a list of `BackgroundStyleValue`s instead, one per layer, then we would have to break it up per-property anyway when computing styles.
2021-11-17LibWeb: Parse comma-separated lists for most background propertiesSam Atkins
We now can parse lists of values for these properties: - `background-attachment` - `background-clip` - `background-image` - `background-origin` - `background-position` - `background-repeat` - `background-size` This uses two new Parser methods: `parse_simple_comma_separated_value_list()` for the simple case when each value is parsed from a single token; and `parse_comma_separated_value_list()` which takes a lambda for when parsing each value is more involved. This also means that any unconsumed tokens at the end will make the parsing fail as it should, where previously we just ignored them.
2021-11-17LibWeb: Prevent copying CSS TokenStreamSam Atkins
This was leading to confusing bugs where I was accidentally passing it by value and then wondering why tokens weren't getting consumed!
2021-11-17LibWeb: Remove CSS Parser method overloads with no TokenStream parameterSam Atkins
These are just clutter. Only one was ever used, in one place, and is easily replaced by just passing `m_token_stream` to it.
2021-11-17LibWeb: Remove ParsingContext parameter from private CSS Parser methodsSam Atkins
This was only needed when they were all static.
2021-11-17LibWeb: Make CSS Parser methods non-staticSam Atkins
Past me thought making as much static as possible was a good idea, but it just makes things more verbose, and awkward if anything isn't also static.
2021-11-17LibWeb: Add NodeWithStyleAndBoxModelMetrics to Forward.hSam Atkins