summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-07Base: Add ratio tests to media-query test pageSam Atkins
Note that only the first test actually functions currently. Single-number ratios instead get parsed as a `<number>`, and will do until the parser gets smarter. (The alternative, where all single-numbers get parsed as `<ratio>`, does make the tests succeed, but numbers are more common than ratios so I have given numbers preference for now.) Also simplified the styling and text a bit. Now, red = fail, green = success. No more "unstyled = fail" stuff.
2022-03-07LibWeb: Add Ratio type to MediaFeatureValueSam Atkins
As noted, the Parser can't handle the `<number>` syntax for this - it gets parsed instead by the `<number>` branch. We can't actually resolve the ambiguity without making the Parser aware of what type each media-feature is, but I will get to that soon. :^)
2022-03-07LibWeb: Introduce and parse CSS Ratio typeSam Atkins
This is only used by media-queries, so for now we can skip adding/parsing a StyleValue for these.
2022-03-07LibWeb: Correct "color" media-feature valueSam Atkins
This is bits per color channel, not bits per pixel, so 32 was a little over-optimistic. :^)
2022-03-07Documentation: Improve VS Code settingsdotjpg3141
- Set commit message length to 72 according to CONTRIBUTING.md - Format trailing new lines according to check-newlines-at-eof.py
2022-03-07LibGfx: Reimplement `Vector::length()` as a loopJelle Raaijmakers
This more generic loop supports arbitrary values of `N` and also gets rid of that strange single argument `AK::hypot` invocation.
2022-03-07LibGfx+LibSoftGPU: Add and use `Vector.xy()`Jelle Raaijmakers
Also use `.xyz()` where appropriate.
2022-03-07LibSoftGPU: Use `lroundf` instead of `roundf` in rasterization rectJelle Raaijmakers
Casting a `float` to `int` might still inadvertently floor the value, while `lroundf` will return a properly rounded `long`.
2022-03-07LibSoftGPU: Use `float` instead of `int` for triangle screen coordsJelle Raaijmakers
This replaces the fixed point subpixel precision logic. GLQuake now effectively renders artifact-free. Previously white/gray pixels would sometimes be visible at triangle edges, caused by slightly misaligned triangle edges as a result of converting the vertex window coordinates to `int`. These artifacts were reduced by the introduction of subpixel precision, but not completely eliminated. Some interesting changes in this commit: * Applying the top-left rule for our counter-clockwise vertices is now done with simpler conditions: every vertex that has a Y coordinate lower than or equal to the previous vertex' Y coordinate is counted as a top or left edge. A float epsilon is used to emulate a switch between `> 0` and `>= 0` comparisons. * Fog depth calculation into a `f32x4` is now done once per triangle instead of once per fragment, and only if fog is enabled. * The `one_over_area` value was previously calculated as `1.0f / area`, where `area` was an `int`. This resulted in a lower quality reciprocal value whereas we can now retain floating point precision. The effect of this can be seen in Tux Racer, where the ice reflection is noticeably smoother.
2022-03-07LibPDF: Allow newlines between xref table and "trailer" keywordMatthew Olsson
2022-03-07LibPDF: Fix "incorrect" matrix multiplication in RendererMatthew Olsson
Incorrect is in quotes because the spec (both 1.7 and 2.0) specify this multiplication as it was originally! However, flipping the order of operations here makes the text in all of my test cases render in the correct position. The CTM is a transformation matrix between the text coordinate system and the device coordinate system. However, being on the right-side of the multiplication means that the CTM scale parameters don't have any influence on the translation component of the left-side matrix. This oddity is what originally led to me just trying this change to see if it worked.
2022-03-07LibPDF: Implement marked renderer operations as nopsMatthew Olsson
2022-03-07LibPDF: Fix bad hex string parsing logicMatthew Olsson
2022-03-07LibPDF: Remove useless hex string substring callMatthew Olsson
2022-03-07LibPDF: Support all Dest typesMatthew Olsson
2022-03-07LibPDF: Propagate errors in Renderer/PDFViewerMatthew Olsson
2022-03-07LibPDF: Propagate ColorSpace errorsMatthew Olsson
2022-03-07LibPDF: Propagate errors in Parser and DocumentMatthew Olsson
2022-03-07LibPDF: Fix the zoom-related text scaling issueMatthew Olsson
Previously, text spacing on a page would only look correct on very zoomed-in pages. When the page was zoomed out, the spacing between characters was very large. The cause for this was incorrect initial values for the Tc (character spacing) and Tw (word spacing) text parameters. The initial values were too large, but they were only about 3-5 pixels, which is why the error was only observable for smaller pages. The text placement still isn't perfect, but it is _much_ better!
2022-03-07LibPDF: Remove unused function in ParserMatthew Olsson
2022-03-07AK: Add test for unbounded HashTable capacity leakAndreas Kling
2022-03-07AK: Automatically shrink HashTable when removing entriesAndreas Kling
If the utilization of a HashTable (size vs capacity) goes below 20%, we'll now shrink the table down to capacity = (size * 2). This fixes an issue where tables would grow infinitely when inserting and removing keys repeatedly. Basically, we would accumulate deleted buckets with nothing reclaiming them, and eventually deciding that we needed to grow the table (because we grow if used+deleted > limit!) I found this because HashTable iteration was taking a suspicious amount of time in Core::EventLoop::get_next_timer_expiration(). Turns out the timer table kept growing in capacity over time. That made iteration slower and slower since HashTable iterators visit every bucket.
2022-03-07AK: Remove return value from HashTable::remove() and HashMap::remove()Andreas Kling
This was only used by remove_all_matching(), where it's no longer used.
2022-03-07AK: Simplify HashTable::remove_all_matching()Andreas Kling
Just walk the table from start to finish, deleting buckets as we go. This removes the need for remove() to return an iterator, which is preventing me from implementing hash table auto-shrinking.
2022-03-07LibWeb: Support more CSS image-rendering valuesAndreas Kling
This patch adds support for "crisp-edges", "high-quality" and "smooth" for the CSS image-rendering property. "crisp-edges" maps to nearest-neighbor scaling for <canvas> and <img> elements, while "high-quality" and "smooth" both use bilinear blending.
2022-03-06LibWeb: Implement the remaining LocationObject internal methodsLinus Groh
2022-03-06LibWeb: Implement the CrossOriginOwnPropertyKeys AOLinus Groh
2022-03-06LibWeb: Implement the CrossOriginSet AOLinus Groh
2022-03-06LibWeb: Implement the CrossOriginGet AOLinus Groh
2022-03-06LibWeb: Implement the CrossOriginGetOwnPropertyHelper AOLinus Groh
2022-03-06LibWeb: Implement the IsPlatformObjectSameOrigin AOLinus Groh
2022-03-06LibWeb: Implement the CrossOriginPropertyFallback AOLinus Groh
2022-03-06LibWeb: Implement the CrossOriginProperties AOLinus Groh
2022-03-06LibWeb: Implement the [[CrossOriginPropertyDescriptorMap]] internal slotLinus Groh
2022-03-06LibWeb: Implement the 'Relevant realm/{settings,global} object' conceptsLinus Groh
2022-03-06LibWeb: Implement the 'Current {settings,global} object' conceptsLinus Groh
2022-03-06LibWeb: Add border style for iframe to default UA stylesheetLinus Groh
Wouldn't be the true <iframe> experience if you didn't have to get rid of the default inset border :^)
2022-03-06LibWeb: Implement missing text-decoration stylesKarol Kosek
This commit will draw appropriate line styles for the Double, Dashed and Dotted values.
2022-03-06LibWeb: Compute `text-decoration-thickness` valuesKarol Kosek
2022-03-06LibWeb: Parse CSS `text-decoration-thickness` propertyKarol Kosek
2022-03-06LibWeb: Paint text decoration in front of the textKarol Kosek
Previously, the decoration was painted behind the text. This probably wasn't noticed before, as we didn't compute `text-decoration-color` values yet and the decoration had the same color anyway.
2022-03-06LibWeb: Compute `text-decoration-color` valuesKarol Kosek
Previosly, we used only the text color as a line decoration color. The FIXME comment has been directly copy-pasted from the border color note a few lines below.
2022-03-06Keymaps: Add Hebrew keymapIdan Horowitz
2022-03-06LibWeb: Fire resize event at the Window instead of DocumentLuke Wilde
The spec says "fire an event named resize at the Window object associated with doc." However, we were accidentally firing it at `doc` instead of the Window.
2022-03-06LibLine: Reset suggestion index back to zero when fetching new onesAli Mohammad Pur
2022-03-06LibLine: Make sure suggestions have their *_views set correctlyAli Mohammad Pur
2022-03-06Shell: Be more smart with pasted stuffAli Mohammad Pur
Shell can now use LibLine's `on_paste` hook to more intelligently escape pasted data, with the following heuristics: - If the current command is invalid, just pile the pasted string on top - If the cursor is *after* a command node, escape the pasted data, whichever way yields a smaller encoding - If the cursor is at the start of or in the middle of a command name, paste the data as-is, assuming that the user wants to paste code - If the cursor is otherwise in some argument, escape the pasted data according to which kind of string the cursor is in the middle of (double-quoted, single-quoted or a simple bareword)
2022-03-06Shell: Implement leftmost_trivial_literal() for Sequence nodesAli Mohammad Pur
2022-03-06LibLine: Allow the embedder to optionally handle pasted data itselfAli Mohammad Pur
If the 'on_paste' callback is set, LibLine will buffer the pasted data and pass it over to the embedder to use as it pleases; in practice, this means that the users of LibLine can now escape or otherwise handle pasted data without the incremental codepoint-by-codepoint buildup.
2022-03-06Shell: Allow completing StringLiterals as pathsAli Mohammad Pur
This auto-escapes the token as well :^)