summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-18Libraries: Change enums to enum classes in LibArchiveLenny Maiorani
2022-03-18LibWeb: Add some default style for <textarea> elements and a testDaniel Lemos
2022-03-18Userland: Change static const variables to static constexprLenny Maiorani
`static const` variables can be computed and initialized at run-time during initialization or the first time a function is called. Change them to `static constexpr` to ensure they are computed at compile-time. This allows some removal of `strlen` because the length of the `StringView` can be used which is pre-computed at compile-time.
2022-03-18AK: Mark the StringView user-defined literal as constevalTimothy Flynn
Even though the StringView(char*, size_t) constructor only runs its overflow check when evaluated in a runtime context, the code generated here could prevent the compiler from optimizing invocations from the StringView user-defined literal (verified on Compiler Explorer). This changes the user-defined literal declaration to be consteval to ensure it is evaluated at compile time.
2022-03-18LibWeb: Invalidate layout after setting Element.innerHTMLAndreas Kling
It's not enough to only relayout here, since the API can substantially change the DOM. We have to rebuild the layout tree.
2022-03-18Base: Add new bitmap font tengchaHLady Gegga
2022-03-18LibWeb: Place right-side floats relative to their containing blockAndreas Kling
We were incorrectly placing them relative to the BFC root, but CSS2 says they are relative to their own containing block.
2022-03-18LibWeb: Update hit_test for CSS TransformsSimon Wanner
This now also takes a FloatPoint instead of an IntPoint to avoid excessive rounding when multiple transforms apply on top of each other.
2022-03-18LibWeb: Implement CSS transforms on stacking contextsSimon Wanner
Since there is currently no easy way to handle rotations and skews with LibGfx this only implements translation and scaling by first constructing a general 4x4 transformation matrix like outlined in the css-transforms-1 specification. This is then downgraded to a Gfx::AffineTransform in order to transform the destination rectangle used with draw_scaled_bitmap() While rotation would be nice this already looks pretty good :^)
2022-03-18LibWeb: Establish a new stacking context for elements with `transform`Simon Wanner
2022-03-18LibGfx: Add AffineTransform::inverseSimon Wanner
2022-03-18LibWeb: Apply the 'transform' presentational attribute to SVG elementsSimon Wanner
2022-03-18LibWeb: Add parsing support for the remaining transform functionsSimon Wanner
2022-03-18LibWeb: Mark more CSS properties as not affecting layoutSam Atkins
- background properties - box-shadow - cursor - SVG fill/stroke properties - image-rendering - outline properties - pointer-events - user-select This should be basically all of them. I skipped `opacity` and `transform` since establishing a stacking context feels like a layout-affecting thing, but I could be very wrong on that!
2022-03-18LibWeb: Rewrite CSS float implementation to use offset-from-edgeAndreas Kling
The previous implementation used relative X offsets for both left and right-side floats. This made right-side floats super awkward, since we could only determine their X position once the width of the BFC root was known, and for BFC roots with automatic width, this was not even working at all most of the time. This patch changes the way we deal with floats so that BFC keeps track of the offset-from-edge for each float. The offset is the distance from the BFC root edge (left or right, depending on float direction) to the "innermost" margin edge of the floating box. Floating box are now laid out in two passes: while going through the normal flow layout, we put floats in their *static* position (i.e the position they would have occupied if they weren't floating) and then update the Y position value to the final one. The second pass occurs later on, when the BFC root has had its width assigned by the parent context. Once we know the root width, we can set the X position value of floating boxes. (Because the X position of right-side floats is relative to the right edge of the BFC root.)
2022-03-18LibWeb: Make LineBuilder aware of the current LayoutModeAndreas Kling
This will allow us to override the available space correctly when doing intrinsic sizing.
2022-03-18LibWeb: Implement shrink-to-fit layout on top of intrinsic size cacheAndreas Kling
Using the intrinsic size cache means we only perform the nested layout to determine intrinsic size *once* per root layout pass. Furthermore, by using a throwaway FormattingState, details of the nested layout can't leak into and mutate the outer layout.
2022-03-18LibWeb: Cache intrinsic sizes on the root FormattingStateAndreas Kling
Instead of caching them with the current state, we can cache them at the root of the state tree. Since intrinsic sizes are immutable during the same layout, this allows layout to take advantage of intrinsic sizes discovered during nested layout (and avoids a *lot* of duplicate work.)
2022-03-18LibWeb: Give FormattingState a reference to its root stateAndreas Kling
FormattingStates can have parents, in case we're performing nested layouts to determine something's intrinsic size. In those cases, it will soon be useful to find the outermost (root) state.
2022-03-18LibWeb: Simplify Layout::Node::containing_block()Andreas Kling
Use first_ancestor_of_type<BlockContainer>() instead of implementing a custom traversal lambda.
2022-03-18Kernel: When receiving unexpected TCP flags, print the flagsAndreas Kling
It'll be easier to understand what might be happening if we know which unexpected flags are actually showing up. :^)
2022-03-18Kernel: Rename TCPFlags::PUSH => PSHAndreas Kling
Let's use the proper name of this TCP flag.
2022-03-18LibWeb: Make PaintableBox::enclosing_stacking_context() cheaperAndreas Kling
No need to call the expensive establishes_stacking_context() here, as we've already built the stacking context tree and can simply test for the presence of existing stacking contexts.
2022-03-18LibWeb: Move available_space_for_line() from IFC to BFCAndreas Kling
This is preparation for allowing blocks with their own internal BFC to flow around floating boxes in the parent BFC. Note that IFC still has the available_space_for_line() API, which returns space available within the IFC's own containing block, while the BFC available_space_for_line() returns space available within its root.
2022-03-18AK: Add const variant of Vector::in_reverse()Andreas Kling
2022-03-18Kernel: Mark `serenity_dev_` functions as staticBrian Gianforcaro
This avoids multiple definition errors when linking software which may utilize these functions from different compilation units.
2022-03-18Ports/stress-ng: Update stress-ng to 0.13.12Brian Gianforcaro
This required updating a bunch of patches which had conflicts in the latest version. New Patches: - serenity: Add bogus O_NDELAY just to allow the port to compile - serenity: Disable nice() stress workload as we do not implement it - serenity: Disable prctl stressor on serenity
2022-03-18Games: Add MasterWordJoe Petrus
A simple wordle clone.
2022-03-18Kernel/Graphics: Don't declare VGA changing-state methods as constLiav A
2022-03-18LibWeb: Combine identical relative/regular selector parsing functionsSam Atkins
2022-03-18LibWeb: Implement `:nth-[last-]child(n of foo)` syntaxSam Atkins
In Selectors level 4, `:nth-child()` and `:nth-last-child()` can both optionally take a selector-list argument. This selector-list acts as a filter, so that only elements matching the list are counted. For example, this means that the following are equivalent: ```css :nth-child(2n+1 of p) {} p:nth-of-type(2n+1) {} ```
2022-03-18Base: Add `of foo` tests to nth-child and nth-last-child test pagesSam Atkins
Also split the selector-list up for easier debugging.
2022-03-18LibWeb: Calculate specificity for special pseudo-classesSam Atkins
This fixes the specificity for :not(), :is() and :where(). Also, we now clamp the specificity numbers instead of letting them overflow, and I sprinkled in some spec comments for good measure.
2022-03-18LibWeb: Implement the :where() selectorSam Atkins
This is identical to :is() except for specificity, so we can use the same code paths. :^)
2022-03-18Base: Add a test page for the CSS :where() selectorSam Atkins
This behaves identically to :is() except for specificity, so this test page is identical to the other one. It's not because I'm lazy. :^)
2022-03-18LibWeb: Implement the :is() selectorSam Atkins
This lets us finally get rid of a FIXME in the default style sheet. :^)
2022-03-18Base: Add nested lists to list test-pageSam Atkins
2022-03-18Base: Correct the :not() test page's titleSam Atkins
Oops!
2022-03-18Base: Add a test page for the CSS :is() selectorSam Atkins
2022-03-18LibWeb: Parse forgiving selector-listsSam Atkins
`<forgiving-selector-list>` and `<forgiving-relative-selector-list>` are the same as regular selector-lists, except that an invalid selector does not make the whole list invalid. The former is used by the `:is()` pseudo-class. For example: ```css /* This entire selector-list is invalid */ .foo, .bar, !?invalid { } /* This is valid, but the "!?invalid" selector is removed */ :is(.foo, .bar, !?invalid) { } ``` Also as part of this, I've removed the `parse_a_selector(TokenStream)` and `parse_a_relative_selector(TokenStream)` methods as they don't add anything useful.
2022-03-18LibGfx: Draw window frame border radii antialiasedMacDue
I think this now looks very nice :^)
2022-03-18LibGfx: AntiAliasingPainter::draw_circle/fill_rect_with_rounded_cornersMacDue
Follows the efficient algorithm from this paper: https://cs.uwaterloo.ca/research/tr/1984/CS-84-38.pdf Can be extended ellipses in future.
2022-03-18LibVT/Kernel: Make VT::Attribute::Flags enum class, use AK EnumBitsBrian Gianforcaro
Noticed the TODO in `Attribute.h` and realized we have as solution to this problem already. :^)
2022-03-18Kernel: Fix crash when opening GPU3DDevice without creating a contextSahan Fernando
2022-03-18Kernel: Don't initialize early framebuffer console if address is invalidLiav A
To do so, we now check that the framebuffer type is RGB so we know that the Multiboot bootloader actually provided a valid framebuffer to work with. This fixes a problem I observed on my ICH7 test machine that apparently the multiboot_framebuffer_addr was not null but there was no framebuffer that was set up for RGB colors, and by initializing that console, there was a memory curroption caused somewhere in the EBDA area to probably cause a complete system lockup.
2022-03-18Kernel: Allow to disable early boot consoleLiav A
This aid debugging on bare metal when we suspect that the boot console does something wrong that interferes with other kernel components.
2022-03-18Kernel/Graphics: Move all VGA related methods to GraphicsManagementLiav A
This helps solving an issue when we boot with text mode screen so the Kernel initializes an early text mode console, but even after disabling it, that console can still access VGA ports. This wouldn't be a problem for emulated hardware but bare metal hardware might have a "conflict", especially if the native driver explicitly request to disable the VGA emulation.
2022-03-18SoundPlayer: Fix read of uninitialized member variables on startupBrian Gianforcaro
I found these by running SoundPlayer under UserspaceEmulator. After boot we attempt to read from these values before they are initialized.
2022-03-18Kernel: Zero initialize DoubleBuffer::InnerBuffer::sizeBrian Gianforcaro
Found by PVS-Studio.
2022-03-18Kernel: Default initialize AC97::m_codec_revisionBrian Gianforcaro
Found by PVS-Studio.