summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2023-05-05LibXML: Notify the listener about the root node as wellAli Mohammad Pur
We previously did not notify the listener about entering the root node, which caused the following snippet to produce the wrong output: a = new DOMParser a.parseFromString("<x/>", "text/xml").documentElement // != null
2023-05-05Piano: Allow per-track controls (again)kleines Filmröllchen
This makes Piano exactly as usable as when I started the large refactor some years ago, which *sounds* like I'm a terrible person but now it (1) looks nicer and (2) has a flexible backend that can already deal with aribtrary kinds of processors on any track.
2023-05-05Piano: Use size_t for track countkleines Filmröllchen
2023-05-05sed: Implement in-place file editingkleines Filmröllchen
This implements the '-i' flag in the GNU version, without suffix support.
2023-05-05sed: Correctly unveil all pathskleines Filmröllchen
- The veil was never closed. - unveil() only works with absolute paths. - Files from the regular input list weren't unveiled.
2023-05-04PixelPaint: Make gradient tool hardness slider width match other inputsMacDue
2023-05-04PixelPaint: Correct variable names in GradientTool.cppMacDue
Previously these variables were all prefixed `size_`, but used for the opacity value.
2023-05-04LibCompress: Remove special casing for looping DEFLATE seekbacksTim Schumacher
The `copy_from_seekback` method already handles this exactly as DEFLATE expects, but it is slightly more optimized.
2023-05-04LibWeb: Use JS::SafeFunction for module fetching callbacksAndreas Kling
This fixes another GC crash seen on https://shopify.com/ Found it by collecting garbage after every 500th heap allocation.
2023-05-04LibWeb: Add an initial implementation of SVG `<radialGradient>`MacDue
This follows on from the SVG linear gradients. It supports the same features (xlink:href, gradientUnits, gradientTransform). With this commit I have now implemented all web gradients :^) (Though we are still missing a few parameters for SVG gradients, e.g. spreadMethod).
2023-05-04LibWeb: Move some common SVG gradient functions into SVGGradientElementMacDue
These functions will also be used by SVG radial gradients.
2023-05-04LibWeb: Don't inherit SVG color stops if current gradient has stopsMacDue
The previous behaviour was incorrect, the template's stops should only be used if the current gradient does not have any stops.
2023-05-04LibWeb: Add tag and attribute names for SVG linear gradientsMacDue
2023-05-04LibGfx: Implement PaintStyle for SVG radial gradientsMacDue
This also slightly refactors things to share more implementation with the SVG linear gradients, and improve accuracy (which fixes some banding issues).
2023-05-04LibWeb: Mark SVG::NumberPercentage accessors as constMacDue
2023-05-04LibWeb: Remove general SVGFormattingContext FIXMEMacDue
Since this FIXME was added the SVGFormattingContext has got a fair bit more spec compliant. The other more specific FIXMEs in this file should be more useful.
2023-05-04LibWeb: Pause HTMLMediaElement when its document becomes inactiveTimothy Flynn
For example, when navigating to another page, this ensures any media resource will not continue playing.
2023-05-04LibWeb: Add an interface to be notified of Document state changesTimothy Flynn
Some HTML elements, e.g. HTMLMediaElement, need to take action when the document becomes inactive.
2023-05-04LibWeb: Implement steps for removing an HTMLMediaElement from a documentTimothy Flynn
2023-05-04LibWeb: Implement the EventTarget constructorLuke Wilde
This is typically used as `class A extends EventTarget`. It's usage can be found on websites such as https://loadout.tf/ This has the quirk that we don't do set the EventTarget prototype for HTML::Window, as it would cause a null deref on startup. However, given it wasn't doing this before, I don't think it should cause any issues.
2023-05-04LibGL: Implement support for the `GL_RGB5_A1` internal image formatJelle Raaijmakers
We already support this in all other logic and in LibSoftGPU, I just forgot to add this constant to this list.
2023-05-04ICC: Verify curve types have valid typesNico Weber
LutAToBTagData::from_bytes() and LutBToATagData::from_bytes() already reject curves for which this isn't true with an error. Ensure potential future callers of the constructors get it right too.
2023-05-04ICC: Prepare for eventually implementing conversions for LUT profilesNico Weber
No behavior change yet (except for more detailed "not yet implemented" messages), but it prepares for eventually implementing some of this.
2023-05-04LibWeb: Honor fill, stroke and stroke-width attribute on SVGSVGElementAndreas Kling
These are presentational hints and are handled by SVGGraphicsElement (a superclass of SVGSVGElement) so we just need to call up to it. :^)
2023-05-04LibWeb: Don't divide by 0 in DOMMatrix::invert_self()Nico Weber
We'd only check is_invertible() after calling inverse(), which would do a divide-by-0 for non-invertible matrices. Less ambitious version of #18593.
2023-05-04LibWeb: Make module maps GC-allocatedAndreas Kling
This allows them to mark JS modules, and fixes a crash seen on https://shopify.com/
2023-05-04LibWeb: Narrow width of boxes that create BFC to avoid overlap of floatAliaksandr Kalenik
https://www.w3.org/TR/CSS22/visuren.html#floats says that when a box establishes BFC it should not overlap with floats. The way to avoid overlaps is up to implementor. This change implements avoiding overlap by narrowing width of a box because it seems like what other engines do (in the scenarios I tested).
2023-05-04LibWeb: Calculate y of a box before resolving width in BFCAliaksandr Kalenik
Calculating width of a box in BFC requires having resolved y to be able to check if a box overlaps with any floating boxes. This change makes compute_width() to be called after finding y position. That also required to move resolving of vertical metrics in the beginning of a box layout process to have vertical margins resolved before finding y position.
2023-05-03AK: Have `JsonArray::set()` change values instead of inserting valuesKemal Zebari
Resolves #18618. 8134dcc changed `JsonArray::set()` to insert elements at an index instead of changing existing elements in-place. Since no behavior such as `Vector::try_at()` exists yet, it returns nothing.
2023-05-03LibWeb: Implement the "The html element fills the viewport quirk"Andreas Kling
Fixes #18037.
2023-05-03LibWeb: Take floats into account when measuring automatic width of IFCAndreas Kling
When there are floats present inside an IFC, we must coordinate with the parent BFC to calculate the automatic width of the IFC's block box. This is because the IFC is not directly aware of floats. Only the BFC knows enough about them to account for them in automatic sizing.
2023-05-03LibWeb: Implement more box type transformation edge casesAndreas Kling
In particular, we now blockify layout internal boxes (e.g table parts) by turning them into `block flow`. This fixes a crash when viewing our GitHub repo :^)
2023-05-03ICC: Implement TRC inversion in from_pcs for point curvesNico Weber
This allows converting to a color space that uses a non-parametric curve, for example: Build/lagom/image -o foo.png \ --convert-to-color-profile .../profiles/sRGB-v2-micro.icc \ input.jpg ...where profiles/sRGB-v2-micro.icc is from https://github.com/saucecontrol/Compact-ICC-Profiles/ (Parametric curves are new in ICC v4, which means all v2 profiles use point curves.)
2023-05-03ICC+image: Add conversion between color spaces for images :^)Nico Weber
For now, only for color spaces that are supported by Profile::to_pcs() and Profile::from_pcs(), which currently means that all matrix profiles (but not LUT profiles) in the source color space work, and that matrix profiles with parametric curves in the destination color space work. This adds Profile::convert_image(Bitmap, source_profile), and adds a `--convert-to-color-profile file.icc` flag to `image`. It only takes a file path, so to use it with the built-in sRGB profile, you have to write it to a file first: % Build/lagom/icc -n sRGB --reencode-to serenity-sRGB.icc `image` by default writes the source image's color profile to the output image, and most image viewers display images looking at the profile. For example, take `Seven_Coloured_Pencils_(rg-switch_sRGB).jpg` from https://commons.wikimedia.org/wiki/User:Colin/BrowserTest. It looks normal in image viewers because they apply the unusual profile embedded in the profile. But if you run % Build/lagom/image -o huh.png --strip-color-profile \ 'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg' and then look at huh.png, you can see how the image's colors look like when interpreted as sRGB (which is the color space PNG data is in if the PNG doesn't store an embedded profile). If you now run % Build/lagom/image -o wow.png \ --convert-to-color-profile serenity-sRGB.icc --strip-color-profile \ 'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg' this will convert that image to sRGB, but then not write the profile to the output image (verify with `Build/lagom/icc wow.png`). It will look correct in image viewers, since they display PNGs without an embedded color profile as sRGB. (This works because 'Seven_Coloured_Pencils_(rg-switch_sRGB).jpeg' contains a matrix profile, and Serenity's built-in sRGB profile uses a matrix profile with a parametric curve.)
2023-05-03LibWeb: Exclude table-wrapper margins from table available widthAliaksandr Kalenik
Table should not take up more width than is available inside wrapper after margins are taken in account.
2023-05-03LibWeb: Use appropriate containing block width to get width of tableAliaksandr Kalenik
This solves the issue that previously width table-wrapper containing block were used in the places were containing block of table-root should be used.
2023-05-03LibWeb: Don't crash on unresolvable line-height: calc() valueAndreas Kling
Instead, log the calc() value we failed to resolve, so we can debug it.
2023-05-03LibWeb: Show formatting context roots in layout tree dumpsAndreas Kling
This patch does three things: - Factors out the code that determines whether a box will create a new formatting context for its children (and which type of context) - Uses that code to mark all formatting context roots in layout tree dumps. This makes it much easier to follow along with layout since you can now see exactly where control is transferred to a new formatting context. - Rebaselines all existing layout tests, since the output format has changed slightly.
2023-05-03AudioServer: Dequeue all buffers when clearing a ClientAudioStreamJoel Petersson
Previously we would exit the dequeuing loop after just one buffer had been dequeued due to some bogus logic. This would manifest when stopping and starting a track in SoundPlayer, where a few miliseconds of 'old' audio would play when restarting the playback. This commit makes sure we clear the entire queue.
2023-05-03SoundPlayer: Clear client buffer when playback is stoppedJoel Petersson
Previously we would not clear the client buffer of the ConnectionToServer when playback was stopped. This would cause old samples to be buffered and played when playback was restarted. With this commit we now perform this clearing of the client buffer correctly.
2023-05-03profile: Prevent crash when -p is supplied a non-integer valuePrestonLTaylor
Instead of crashing we give a helpful warning message to the user. This also removes a fixme! :^)
2023-05-03profile: Add -a to warning message when -e, -d, -w xor -f is not setPrestonLTaylor
-a and -p both require only one of the flags. We will inform the user of this for both -a and -p <PID>.
2023-05-03LibWeb: Implement "create navigation params from a srcdoc resource"Aliaksandr Kalenik
Implements: https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-from-a-srcdoc-resource This is supporting function for populating document in session history entry. This function populates navigation params response with HTML text passed in document resource.
2023-05-03LibWeb: Implement "create navigation params by fetching"Aliaksandr Kalenik
Implements: https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-by-fetching This is supporting function for population of document in a session history entry. This function populates response in navigation params by fetching url in navigation params and handling redirects if required.
2023-05-03LibWeb: Implement "attempt to populate the history entry's document"Aliaksandr Kalenik
Implements: https://html.spec.whatwg.org/multipage/browsing-the-web.html#attempt-to-populate-the-history-entry's-document This is going to be a replacement for `FrameLoader::load()` after switching to navigables. Brief description of `populate_session_history_entry_document`: - If navigation params have url with fetch scheme then DOM document will be populated by fetching url and parsing response. This is going to be a replacement for `FrameLoader::load(AK::URL&)`. - If url in navigation params is abort:srcdoc then DOM document will be populated by parsing HTML text passed in document resource. This is going to be a replacement for `FrameLoader::load_html()`
2023-05-03LibWeb: Move document loading into separate fileAliaksandr Kalenik
In upcoming navigables refactor new function that uses fetch instead of ResourceLoader to load document content is going to be introduced: https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-by-fetching `parse_document()` need to be separated from FrameLoader to reuse code responsible for parsing HTTP response into DOM document.
2023-05-03LibWeb: Reuse ReferrerType from Fetch in HTML::DocumentStateAliaksandr Kalenik
2023-05-03LibWeb: Add fetch_controller property in HTML::NavigationParamsAliaksandr Kalenik
2023-05-03LibWeb: Add navigable property in NavigationParamsAliaksandr Kalenik
2023-05-03LibWeb: Change id to be optional in HTML::NavigationParamsAliaksandr Kalenik