summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2023-04-13LibJS: Add spec comments to WeakMapPrototypeLinus Groh
2023-04-13LibJS: Add spec comments to WeakMapConstructorLinus Groh
2023-04-13LibJS: Add spec comments to TypedArrayPrototypeLinus Groh
2023-04-13LibJS: Add spec comments to TypedArrayConstructorLinus Groh
2023-04-13LibJS: Add spec comments to SymbolPrototypeLinus Groh
2023-04-13LibJS: Add spec comments to SymbolConstructorLinus Groh
2023-04-13LibJS: Add spec comments to StringConstructorLinus Groh
2023-04-13LibJS: Add spec comments to SetPrototypeLinus Groh
2023-04-13LibJS: Add spec comments to SetConstructorLinus Groh
2023-04-13LibWeb: Reimplement CalculatedStyleValue as a calculation node treeSam Atkins
VALUES-4 defines the internal representation of `calc()` as a tree of calculation nodes. ( https://www.w3.org/TR/css-values-4/#calc-internal ) VALUES-3 lacked any definition here, so we had our own ad-hoc implementation based around the spec grammar. This commit replaces that with CalculationNodes representing each possible node in the tree. There are no intended functional changes, though we do now support nested calc() which previously did not work. For example: `width: calc( 42 * calc(3 + 7) );` I have added an example of this to our test page. A couple of the layout tests that used `calc()` now return values that are 0.5px different from before. There's no visual difference, so I have updated the tests to use the new results.
2023-04-13LibWeb: Expose type and raw values of basic CSS typesSam Atkins
This makes it possible to do arithmetic on them without having to resolve to their canonical unit, which often requires context information that is not available until the last minute. For example, a Length cannot be resolved to px without knowing the font size, parent element's size, etc. Only Length currently requires such context, but treating all these types the same means that code that manipulates them does not need to know or care if a new unit gets added that does require contextual information.
2023-04-13LibWeb: Simplify CalculatedStyleValue types to match CSS-VALUES-4 :^)Sam Atkins
Level 4 drops the limitations of what types can be a denominator, which means `<calc-number-sum>`, `<calc-number-product>` and `<calc-number-value>` all go away.
2023-04-13LibWeb: Move StyleValue::absolutized() back where it belongsSam Atkins
I accidentally moved this when moving the CalculatedStyleValue methods, and didn't notice because it was hidden in the middle. Oops!
2023-04-13HackStudio: Set_cursor even if the file is already openiyush
Upon opening already opened file, the cursor was previously not set to the correct line and column. With this patch, it should be correctly set. Fixes a bug where ctrl+clicking a function declaration would not jump to the line if the file containing the function is already open.
2023-04-13LibWeb/Streams: Fix inconsistent uses of realm() and vm()Linus Groh
This is not documented yet, but the preferred style is getting both upfront instead of inlining various kinds of calls in places that use the realm and vm.
2023-04-13LibWeb/URL: Make URL::search_params() return a NonnullGCPtrLinus Groh
2023-04-13LibWeb/URL: Add spec links and commentsLinus Groh
2023-04-12LibAudio: Use `read_until_filled` to fill a buffer from a StreamTim Schumacher
This has the advantage of recognizing when the Stream reaches EOF and avoids an endless loop.
2023-04-12LibCompress: Error on truncated uncompressed DEFLATE blocksTim Schumacher
2023-04-12Everywhere: Fix a few typosNico Weber
Some even user-visible!
2023-04-12Starfield: Rename starfield_window to starfield_widgetCubic Love
Linus says it should be a widget and not a window!
2023-04-12Base: Add icons for the Gradient screensaverCubic Love
Add 32px and 16px application icons for the Gradient screensaver
2023-04-12Demos: Rename GradientScreensaver to GradientCubic Love
This brings the name in-line with the naming convention used by the other screensavers 'Starfield' and 'Tubes'.
2023-04-12LibGfx/WebP: Don't assert when size in header is smaller than headerNico Weber
read_webp_first_chunk() sensibly assumes that if decode_webp_header() succeeds, there are at least sizeof(WebPFileHeader) bytes available. But if the file size in the header was less than the size of the header, decode_webp_header() would truncate the data to less than that and happily report success. Now it no longer does that. Found by clusterfuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57843&sort=-opened&can=1&q=proj%3Aserenity
2023-04-12LibGfx/ICC: Use mix() in CurveTagData::evaluate()Nico Weber
No behavior change. (Well, technically mix() uses the other simple implementation of lerp and the two have slightly different behavior if the arguments are of very different magnitude and in various corner cases. But in practice, for ICC profiles, it shouldn't matter. For a few profiles I tested, it didn't have a measurable effect.)
2023-04-12LibWasm: Replace usages of the Endian bytes accessorTim Schumacher
2023-04-12LibCompress: Replace usages of the Endian bytes accessorTim Schumacher
2023-04-12Shell: Add `map_fixed` to the pledges for command autocompletionTim Schumacher
2023-04-12LibTLS: Remove outdated comment about ECCFabian Dellwing
PR #18166 introduced the ability to parse ECC certificates. If we now fail here the reason is mostlikely something new and we should prevent this rabbit hole from happening.
2023-04-12LibTLS: Streamline certificate loadingFabian Dellwing
Some refactoring of our root ca loading process: - Remove duplicate code - Remove duplicate calls to `parse_root_ca` - Load user imported certificates in Browser/RequestServer
2023-04-12LibTLS: Dont also include the OID when printing the RDN short namestelar7
2023-04-12Applications: Use thousands separator for numbers shown in status barTim Ledbetter
TextEditor, HackStudio and SQLStudio now print the current line and column number, as well as the number of currently selected words, with thousands separators. TextEditor also uses thousands seperators for the current word and character count.
2023-04-12LibVideo: Don't shadow `m_playing` in ResumingStateHandler classesZaggy1024
StartingStateHandler and SeekingStateHandler were declaring their own `bool m_playing` fields (from previous code where there was no base class). In the case of SeekingStateHandler, this only made the logging wrong. For StartingStateHandler, however, this meant that it was not using the boolean passed as a parameter to the constructor to define the state that would be transitioned to after the Starting state finished. This meant that when the Stopping state replaced itself with the Starting state, playback would not resume when Starting state exits.
2023-04-12LibWeb: Don't try to paint SVG elements transformed to zero sizeMacDue
Otherwise, the Gfx::Painter will get choked up on NaNs and start infinitely splitting paths till it OOMs.
2023-04-12LibWeb: Allow floating point values when parsing SVG viewboxesMacDue
2023-04-12LibWeb: Always use quirks mode when parsing SVG width/height attributesMacDue
This is a bit if a hack, but without this unitless values for these attributes fail to parse with <!DOCTYPE html>.
2023-04-12LibWeb: Use (transformed) path bounding quad for SVG path hit testingMacDue
This is needed for hit testing the directional arrows on the Street View office tour, and generally makes SVG hit testing more precise. Note: The rough bounding box is hit test first, so this should not be a load more overhead.
2023-04-12LibWeb: Apply CSS scaling to SVG elementsMacDue
Not sure why this was not done before, not now it works easily :^)
2023-04-12LibWeb: Apply SVG transform to path when painting (SVG) elementsMacDue
This also combines the viewbox mapping into the same transform and reuses some code by using Path::copy_transformed() rather than manually mapping each segment of the path.
2023-04-12LibWeb: Remove SVG sizing hack and fix viewbox scalingMacDue
Previously, if you had an SVG with a viewbox and a definite width and height, then all SVGGeometryBox boxes within that SVG would have a width and height set to the size of the parent SVG. This broke hit testing for SVG paths, and didn't make much sense. It seems like the SVG sizing hack was patching over the incorrect logic in viewbox_scaling() and the incorrect path sizing (which was never reached). Before this change the view box scaling was: element_dimension / viewbox_dimension Which only seemed to work because of the SVG sizing hack that made all paths the size of the containing SVG. After this change SVGGeometryBoxes are (in most cases) sized correctly based on their bounding boxes, which allows hit testing to function, and the view box scaling is updated now to: containing_SVG_dimension / viewbox_dimension Which works with one less hack :^) This now also handles centering the viewbox within the parent SVG element and applying any tranforms to the bounding box. This still a bit ad-hoc, but much more closely matches other browsers now.
2023-04-12LibWeb: Parse the `transform` attribute when set on SVGGraphicsElementsMacDue
This uses the new attribute parser functionality, and then resolves the transform list into a single Gfx::AffineTransform. This also adds a .get_transform() function which resolves the final transform, by applying all parent transforms.
2023-04-12LibWeb: Parse and apply `fill-opacity` attribute to SVG pathsMacDue
This is needed to fix the rendering of the Street View directional controls (which have paths with various levels of opacity set by this attribute).
2023-04-12LibWeb: Add SVG transform parsingMacDue
This parses SVG transforms using the syntax from CSS Transforms Module Level 1. Note: This looks very similar to CSS tranforms, but the syntax is not compatible. For example, SVG rotate() is rotate(<a> <x> <y>) where all parameters are unitless numbers whereas CSS rotate() is rotate(<angle> unit) along with separate rotateX/Y/Z(). (At the same time AttributeParser is updated to use GenericLexer which makes for easier string matching). There is work needed for error handling (which AttributeParser does not deal with very gracefully right now).
2023-04-12LibGfx: Add AffineTransform::skew_radians()MacDue
2023-04-12LibGfx: Optimize Painter::draw_scaled_bitmap_with_transform()MacDue
This now applies clipping to the destination bounding box before painting, which cuts out a load of clipped computation and allows using the faster set_physical_pixel() method. Alongside this it also combines the source_transform and inverse_transform outside the hot loop (which might cut things down a little). The `destination_quad.contains()` check is also removed in favour of just checking if the mapped point is inside the source rect, which takes less work to compute than checking the bounding box. This takes this method down from 98% of the time to 10% of the time when painting Google Street View (with no obvious issues).
2023-04-12AK: Don't store parts of URLs percent decodedMacDue
As noted in serval comments doing this goes against the WC3 spec, and breaks parsing then re-serializing URLs that contain percent encoded data, that was not encoded using the same character set as the serializer. For example, previously if you had a URL like: https:://foo.com/what%2F%2F (the path is what + '//' percent encoded) Creating URL("https:://foo.com/what%2F%2F").serialize() would return: https://foo.com/what// Which is incorrect and not the same as the URL we passed. This is because the re-serializing uses the PercentEncodeSet::Path which does not include '/'. Only doing the percent encoding in the setters fixes this, which is required to navigate to Google Street View (which includes a percent encoded URL in its URL). Seems to fix #13477 too
2023-04-12LibWeb: Make SC hit testing more closely follow reverse paint orderMacDue
Previously, we would hit test positioned elements, then stacking contexts with z-index 0, as two seperate steps. This did not really follow the reverse paint order, where positioned elements and stacking contexts with z-index 0 are painted during the same tree transversal. This commit updates for_each_in_subtree_of_type_within_same_stacking_context_in_reverse() to return the stacking contexts it comes across too, but not recurse into them. This more closely follows the paint order. This fixes examples such as: <div id="a" style="width: 10px; height: 10px"> <div id="b" style="position: absolute; width: 10px; height: 10px"> <div style="position: absolute; width: 10px; height: 10px; z-index: 0" > <div id="c" style="width: 100%; height: 100%; background-color:red;" onclick="alert('You Win!')"> </div> </div> </div> </div> Where previously the onclick on #c would never fire as hit testing always stopped at #b. This is reduced from Google Street View, which becomes interactable after this commit.
2023-04-12LibWeb: Create a video document for `video/` MIME types on navigationLuke Wilde
2023-04-12LibWeb: Add ReadableStreamByteController interfaceMatthew Olsson
2023-04-12LibWeb: Add ReadableStreamBYOBRequest interfaceMatthew Olsson