summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2023-05-12LibWeb: Implement the legacy extracting an encoding AOTimothy Flynn
2023-05-12LibWeb: Implement the CORS settings attribute credentials mode AOTimothy Flynn
2023-05-12LibGfx: VERIFY() error is finite when splitting bezier curvesMacDue
If this value somehow becomes nan/inf the painter will keep splitting the path till the process OOMs, a simple crash would be preferable.
2023-05-12LibWeb: Use .to_px_or_zero() in tentative_height_for_replaced_element()MacDue
If just .to_px() is used the height can end up as the float `inf` or `nan`. This caused an OOM when loading Polygon as this `inf` would become a `nan` and propagate to the SVG painting, which then attempts to draw a path with nan control points, which would make the Gfx::Painter infinitely split the path till it OOM'd.
2023-05-11HexEditor: Add list of recently opened filesCaoimhe
2023-05-11LibWeb: Resolve grid items preferred width in GFCAliaksandr Kalenik
Previously, the width and height of grid items were set to match the size of the grid area they belonged to. With this change, if a grid item has preferred width or height specified to not "auto" value it will be resolved using grid area as containing block and used instead.
2023-05-11LibWeb: Parse calc() function in grid sizesAliaksandr Kalenik
Adds missing part of grid size parsing function to handle calc().
2023-05-11LibWeb: Use LengthPercentage in CSS::GridSizeAliaksandr Kalenik
Using LengthPercentage instead of Length and Percentage separately is going to allow GridSize to store calc() values. It also allows to simplify some parts of layout code.
2023-05-11errno: Remove usage of DeprecatedStringSam Atkins
2023-05-11errno: Look up errors by name as well as numberSam Atkins
eg, `errno enotsup` now shows the description and number for ENOTSUP.
2023-05-11errno: Include error code names in outputSam Atkins
And align the output nicely while we're at it. :^)
2023-05-10LibWeb: Fix percentage min/max sizes on flex items with intrinsic ratioAndreas Kling
We were resolving percentage values against the containing block size in the wrong axis.
2023-05-10LibWeb: Don't resolve CSS property values for unconnected elementsAndreas Kling
While it's possible to getComputedStyle() on an unconnected element, the resulting object is not supposed to have any values, since we can't resolve style without a document root anyway. This fixes a crash on https://bandcamp.com
2023-05-10LibWeb: Handle CSS "color: currentcolor"Andreas Kling
Per CSS-COLOR-4, when `color` is `currentcolor`, it should resolve to the inherited value.
2023-05-10Chess+GameSettings: Optionally highlight the king when in checkTim Ledbetter
When either king is in check, its square is now highlighted with a red background. This behavior can be toggled in GameSettings.
2023-05-10LibWeb: Adjust flex item main size through aspect ratio if neededAndreas Kling
If there are min or max size constraints in the cross axis for a flex item that has a desired aspect ratio, we may need to adjust the main size *after* applying the cross size constraints. All the steps to achieving this aren't mentioned in the spec, but it seems that all other browsers behave this way, so we should too.
2023-05-10Help: Fix link to Contents pageJames Liu
2023-05-10LibWeb: Implement more of "Resolve Intrinsic Track Sizes" in GFCAliaksandr Kalenik
Implements some parts of "Resolve Intrinsic Track Sizes" algorithm from spec to make it more spec compliant.
2023-05-10LibWeb: Split run_track_sizing into smaller method in GFCAliaksandr Kalenik
Splits run_track_sizing into following methods: - initialize_track_sizes (12.4. Initialize Track Sizes) - resolve_intrinsic_track_sizes (12.5. Resolve Intrinsic Track Sizes) - maximize_tracks (12.6. Maximize Tracks) - expand_flexible_tracks (12.7 Expand Flexible Tracks) - stretch_auto_tracks (12.8. Stretch auto Tracks)
2023-05-09LibWeb: Use size_t instead of int when appropriate in GFCAliaksandr Kalenik
size_t should be used instead of int in loop counter and to store rows/columns positions because they can't be negative values. This allows to remove some static casts to int.
2023-05-09LibWeb: Refactor tracks initialization in GFC to reduce code duplicationAliaksandr Kalenik
This change moves code that was duplicated for rows and columns into separate function.
2023-05-09LibWeb: Move gap tracks initialization into separate method in GFCAliaksandr Kalenik
2023-05-09LibWeb: Move grid items placement algorithm into separate method in GFCAliaksandr Kalenik
Let's follow pattern of other formatting context where steps of layout are separated into method.
2023-05-09LibGfx/WebP: Do not add alpha channel for animated images without alphaNico Weber
In practice, it looks like e.g. the animaged webp file on https://mathiasbynens.be/demo/animated-webp has the header flag set, because 2 of the frames have alpha, but they're composited on top of the final bitmap, but the final bitmap isn't transparent there. So that image still gets a useless alpha channel. Oh well.
2023-05-09ClipboardHistory: Replace Core::BufferedFile use with InputBufferedFileTimothy Flynn
Core::BufferedFile was renamed to InputBufferedFile in 8c34959b.
2023-05-09LibWeb: Improve handling of min/max constraint violations on imagesAndreas Kling
Instead of bailing after resolving one violated constraint, we have to continue down the list of remaining constraints. We now also call the constraint solver for all replaced elements with "auto" for both width and height. Co-authored-by: 0GreenClover0 <clovers02123@gmail.com>
2023-05-09LibWeb: Remove dead code in compute_width_for_replaced_element()Andreas Kling
2023-05-09LibGfx/PortableFormat: Use `FixedArray::unchecked_at`Lucas CHOLLET
This allows us to drop from 7% to 5% passed on `add_pixels` when using `image` to do conversions from JPEG to PPM.
2023-05-09LibGfx/PortableFormat: Write to the output stream row by rowLucas CHOLLET
This is done by adding an intermediate buffer and flush it at the end of every row. This makes the `add_pixels` method to drop from 50% to 7% in profiles.
2023-05-09LibGfx/PortableFormat+image: Make `encode` take a StreamLucas CHOLLET
As we directly write to the stream, we don't need to store a copy of the entire image in memory. However, writing to a stream is heavier on the CPU than to a ByteBuffer. This commit unfortunately makes `add_pixels` two times slower.
2023-05-09AK: Add `OutputBufferedStream`Lucas CHOLLET
This class, in a similar fashion to what has been done with `InputBufferedStream`, postpones write to the stream until an internal buffer is full. This patch also adds the `OutputBufferedFile` alias.
2023-05-09AK: Add the `Input` word to input-only buffered streamsLucas CHOLLET
This concerns both `BufferedSeekable` and `BufferedFile`.
2023-05-09image: Initialize `strip_color_profile` with a default valueLucas CHOLLET
2023-05-09LibWeb: Initial offset in reverse flex layout moved to opposite sideEmil Militzer
This change moves the initial offset for justify-content: center to the opposite side if the flex layout is in the reverse direction.
2023-05-09LibWeb: Broadcast the viewport rect to clients immediately after layoutAndreas Kling
This lets elements figure out if they're visible within the viewport or not, so they take appropriate action. Fixes the issues with animations not starting until the viewport was resized or scrolled.
2023-05-09LibWeb: Move image viewport awareness from ImageBox to ImagePaintableAndreas Kling
Images being aware of being visible inside the viewport is a painting concern, not a layout concern.
2023-05-09LibGfx/JPEG: Add support for 12 bits JPEGsLucas CHOLLET
This is done by two distinct things: - Allowing 12 bits AC and DC coefficients - Adjusting coefficients in the IDCT While this patch allows to display them we still don't correctly do the color transformation and ultimately only truncating coefficients to 8 bits.
2023-05-09LibGfx/JPEG: Add support for `SOF1` imagesLucas CHOLLET
More precisely, it allows the decoder to try `SOF1` images. There are still some sub-kind of this kind of JPEG that we don't support. In a nutshell `SOF1` images allow more Huffman and quantization tables, 12 bits precision and arithmetic encoding. This patch only brings support for the "more tables" part. Please note that `SOF2` images are also allowed to have more tables, so we gave the decoder the ability to handle these in the same time.
2023-05-09LibWeb: Align `GridFormattingContext::run_track_sizing()` with the specAliaksandr Kalenik
1. Stop using -1 to indicate infinity value of growth limit. Just use INFINITY for that. 2. More complete implementation of "Expand Flexible Tracks" step. 3. Return AvailableSize from get_free_space: spec says that this function can return indefinite size and it is ok.
2023-05-09LibGfx/WebP: Add two missing closing quotes for spec commentsNico Weber
2023-05-09LibGfx/WebP: Move lossy decoder to its own fileNico Weber
Pure code move (except of removing `static` on the two public functions in the new header), not behavior change. There isn't a lot of lossy decoder yet, but it'll make implementing it more convenient. No behavior change.
2023-05-09LibGfx/WebP: Give VP8 decoding functions same interface as VP8L onesNico Weber
Namely: * Store compressed data in VP8Header * Make the functions just take ReadonlyBytes instead of a Chunk Having a function that takes a header and does decoding of the data after the header isn't really necessary for VP8. For VP8L, it's needed because the ALPH chunk stores VP8L data without the VP8L header. But it's nice to make the functions consistent, and it's kind of a nice structure. No behavior change.
2023-05-09LibGfx/WebP: Tell decode_webp_chunk_VP8() if it needs an alpha channelNico Weber
decode_webp_chunk_VP8() itself will only ever decode RGB data from a lossy webp stream, but a separate ALPH chunk could add alpha data later on. Let the function know if that will happen, so that it can return a bitmap with an alpha channel if appropriate. Since lossy decoding isn't implemented yet, no behavior change. But it makes it a bit easier to implement lossy decoding in the future.
2023-05-09LibGfx/WebP: Remove pointless decode_webp_chunk_VP8L() functionNico Weber
The one caller checked the chunk type, so the VERIFY() for that did nothing. The VERIFY() for vp8l data only being in files that start with VP8L or VP8X chunks wasn't completely useless, but also not very useful. Remove the now-unused context parameter of decode_webp_image_data().
2023-05-09LibGfx/WebP: Remove context.error() now that it is a no-opNico Weber
Also remove `context` from many function parameter lists where the parameter is now no longer needed.
2023-05-09LibGfx/WebP: Redo error handlingNico Weber
Most places used to call `context.error()` to report an error, which would set the context's state to `Error` and then return an `Error::from_string_literal()`. This is somewhat elegant, but it doesn't work: Some functions this code calls returns ErrorOr<>s that aren't created by `context.error()`, and for these we wouldn't enter the error state. Instead, manually check error-ness at the leaf entry functions of the class: 1. Add a set_error() helper for functions returning bool 2. In the two functions returning ErrorOr<>, awkwardly check the error manually. If this becomes a very common pattern, maybe we can add a `TRY_WITH_HANDLER(expr, error_lambda)` which would invoke a lambda on error. We could use that here to set the error code. No real behavior change (except we enter the error state more often when something goes wrong).
2023-05-09LibGfx/WebP: Change ImageData optional-nessNico Weber
Instead of ImageData having an Optional<Chunk> for the image data, have it have a Chunk, and give the context an Optional<ImageData>. This allows sharing a single code path for checking that either the main image or an animation frame has a main image data chunk, and that an alpha chunk is only present with a lossy main image data chunk. No behavior change.
2023-05-09LibGfx/WebP: Minor cosmetical changes in WebPLoaderLossless.hNico Weber
Add a comment, remove a parameter name that doesn't add anything, and remove a weird newline in WebPLoader.cpp too. No behavior change.
2023-05-09AK: Remove `must_set()` from `JsonArray`Kemal Zebari
Due to 582c55a, both `must_set()` and `set()` should be providing the same behavior. Not only is that a reason to remove `must_set()`, but it also performs erroneous behavior since it inserts an element at a specified index instead of modifying an element at that index.
2023-05-09Userland: Show "Ladybird" instead of "Browser" in titles, menus, etcAndreas Kling
While the binary is still called "Browser" for now, let's make it clear that we're converging on a single name for this application.