summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2022-02-23LibGUI+Apps: Adjust Splitter spacingsthankyouverycool
Different thread highlights between widgets lead to different visual weights between splitters, even when they have the same width or height. This means some splitters look best at odd sizes while others even. This sets the default spacing to the most commonly used, depending on orientation, and adjusts spacing for a few apps based on the new paint rect. The most consistent look across apps requires some manual tweaking occassionally. Knurlheads, use your discretion!
2022-02-23LibGUI+Apps: Prevent Splitter children from being unresizablethankyouverycool
Splitters could be resized in such an order that all their remaining children were fixed size, leading to unfillable gaps on resize events. HackStudio and TextEditor already had logic to handle this edge case, so this patch factors it into a general solution for all Splitters. At least one widget is now guaranteed to be resizeable after a child is removed.
2022-02-23LibGUI+Apps: Let Splitters select which resizee to set fixedthankyouverycool
This gives Splitters more versatility when the right resizee is intended to remain fixed or be toggled on and off.
2022-02-23LibGUI: Adjust grabbable rect between Splitter widgetsthankyouverycool
Previously, the rect began on the edge of the first widget instead of immediately after, causing an overpaint visible on hover.
2022-02-23LibTLS: Add signature verification for DHE and ECDHE key exchangeMichiel Visser
This will verify that the signature of the ephemeral key used in the DHE and ECDHE key exchanges is actually generated by the server. This verification is done using the first certificate provided by the server, however the validity of this certificate is not checked here. Instead this code expects the validity to be checked earlier by `TLSv12::handle_certificate`.
2022-02-23LibCrypto: Add EMSA-PKCS1-V1_5 encoder and verificationMichiel Visser
This add an implementation for the EMSA-PKCS1-V1_5-ENCODE function from RFC8017 section 9.2. The verification of this encoding is implemented by simply encoding the message to be verified, and then comparing the two encoded string. The digest info for the different hash function is from RFC8017 section 9.2 notes 1. These byte sequences are actually ASN.1 encoded data, however these are always constant for a specific hash function and can be treated as opaque byte sequences.
2022-02-23LibTLS: ECDHE switch from FeatureNotSupported to NotUnderstood errorMichiel Visser
NotUnderstood will generate a TLS alert with an InternalError instead of crashing the RequestServer.
2022-02-23LibTLS: Add OutOfMemory error that will send an InternalError alertMichiel Visser
2022-02-23Libraries/LibCpp: Add parser test for out-of-line function definitionsItamar
2022-02-23LanguageServers/Cpp: Fix "complete_includes" language server testItamar
Previously the target result was only a partial completion.
2022-02-23LibCpp: Allow qualified names in AST Declaration nodesItamar
Previously, the names of declarations where stored as a simple StringView. Because of that, we couldn't parse out-of-line function definitions, which have qualified names. For example, we couldn't parse the following snippet: ``` void MyClass::foo(){} ``` To fix this, we now store the name of a declaration with a ASTNode::Name node, which represents a qualified named.
2022-02-22LibGL: Set correct matrices in `glFrustum` and `glOrtho`Jelle Raaijmakers
We were erroneously setting the projection matrix when `GL_MODELVIEW` was supplied.
2022-02-22LibGL: Improve `glFrustum` precision and error handlingJelle Raaijmakers
Do not convert to float too early. Additionally, handle some error cases for the input parameters.
2022-02-22LibGL: Clamp color in `glClearColor` to 0..1Jelle Raaijmakers
2022-02-22LibGL: Implement `glClearDepthf` and store as floatJelle Raaijmakers
Our API still specifies it as a double, but internally we communicate a float to the rasterizer. Additionally, clamp the value to 0..1 as described in the spec.
2022-02-22LibGL: Ignore stack on projection and model view matrix retrievalJelle Raaijmakers
Our implementation keeps the top-most item on the matrix stacks in a member variable, so we can always use that instead of considering the actual stack. Additionally, the current matrix mode should not influence retrieving the projection or model view matrix.
2022-02-22LibSoftGPU: Clean up some conditionals in `Device`Jelle Raaijmakers
No functional changes.
2022-02-22LibSoftGPU: Round rasterization position to nearest integerJelle Raaijmakers
This fixes the issue where e.g. `299.97` would be cast to an integer value of `299`, whereas the pixel's center would lie at `299.5` and would then erroneously be excluded.
2022-02-22LibSoftGPU: Apply regular cartesian coordinate systemJelle Raaijmakers
Currently, LibSoftGPU is still OpenGL-minded in that it uses a coordinate system with the origin of `(0, 0)` at the lower-left of textures, buffers and window coordinates. Because we are blitting to a `Gfx::Bitmap` that has the origin at the top-left, we need to flip the Y-coordinates somewhere in the rasterization logic. We used to do this during conversion of NDC-coordinates to window coordinates. This resulted in some incorrect behavior when rasterization did not pass through the vertex transformation logic, e.g. when calling `glDrawPixels`. This changes the coordinate system to OpenGL's throughout, only to blit the final color buffer upside down to the target bitmap. This fixes drawing to the depth buffer directly resulting in upside down images.
2022-02-22LibGL: East-const two methods in `Texture2D`Jelle Raaijmakers
No functional changes.
2022-02-22LibGL+LibSoftGPU: Use more expressive `is_power_of_two`Jelle Raaijmakers
2022-02-22LibSoftGPU: Rename `rgba` to `bgra` to reflect actual valueJelle Raaijmakers
2022-02-22LibGL: Use `clamp<float>` for depth rangeJelle Raaijmakers
We get `double`s as input, so convert them to `float` first.
2022-02-22LibSoftGPU: Generalize pixel buffers and standardize on BGRA8888Jelle Raaijmakers
Between the OpenGL client and server, a lot of data type and color conversion needs to happen. We are performing these conversions both in `LibSoftGPU` and `LibGL`, which is not ideal. Additionally, some concepts like the color, depth and stencil buffers should share their logic but have separate implementations. This is the first step towards generalizing our `LibSoftGPU` frame buffer: a generalized `Typed3DBuffer` is introduced for arbitrary 3D value storage and retrieval, and `Typed2DBuffer` wraps around it to provide in an easy-to-use 2D pixel buffer. The color, depth and stencil buffers are replaced by `Typed2DBuffer` and are now managed by the new `FrameBuffer` class. The `Image` class now uses multiple `Typed3DBuffer`s for layers and mipmap levels. Additionally, the textures are now always stored as BGRA8888, only converting between formats when reading or writing pixels. Ideally this refactor should have no functional changes, but some graphical glitches in Grim Fandango seem to be fixed and most OpenGL ports get an FPS boost on my machine. :^)
2022-02-22LibGL: Remove superfluous `AK::dbgln` aliasJelle Raaijmakers
2022-02-22LibSoftGPU: Remove `Device::wait_for_all_threads()`Jelle Raaijmakers
This function was added as a FIXME but was then arbitrarily invoked in the rest of `Device`. We are better off removing this FIXME for now and reevaluate introducing multithreading later on, so the code is not littered with useless empty function calls.
2022-02-22LibSoftGPU: Remove unused `AK/Function.h` includeJelle Raaijmakers
2022-02-22LibSoftGPU: Use `fabsf` instead of `fabs` for `float`Jelle Raaijmakers
Let's not do a `float -> double -> float` roundtrip. :^)
2022-02-22LibGL: Allow all primitives in `glBegin()`Jelle Raaijmakers
We check for primitive support in `glEnd()`, so we do not need to preemptively reject the mode in `glBegin()`. This allows `glBegin()` to be invoked with `GL_POINTS`, for example.
2022-02-23LibTest+Spreadsheet: Add some basic spreadsheet runtime behaviour testsAli Mohammad Pur
As there's a somewhat active development going on, let's keep the expected behaviour under tests to make sure nothing blows up :^)
2022-02-23LibJS: Print the expected and received value on expect.toEqual() failureAli Mohammad Pur
'ExpectationError' is hardly an actionable error message.
2022-02-22Shell: Start history counter from 1Ryan Chandler
Previously would show the list of history items starting from an index of 0. This is a bit misleading though. Running `!0` would actually cause the parser to error out and prevent you from running the command.
2022-02-21WindowServer: Mark window frame as invalidated when updating titleTom
We need to set Window::m_invalidated_frame to true when invalidating the title, otherwise we may miss re-rendering the frame if nothing else triggers it.
2022-02-21SystemMonitor: Add missing /boot/Kernel.debug unveilIdan Horowitz
When using the stack tab as root LibSymbolication uses this file to provide Kernel symbols.
2022-02-21LibWeb: Support CSSStyleDeclaration.cssFloatAndreas Kling
Unlike all the other CSS properties, 'float' is special, and can only be accessed via 'cssFloat' on CSSStyleDeclaration. So this patch adds support for that. 1 point on ACID3! :^)
2022-02-21LibWeb: Implement Node.removeChild() in terms of "pre-remove"Andreas Kling
This is what the spec wants us to do.
2022-02-21LibWeb: Make document.write() work while document is parsingAndreas Kling
This necessitated making HTMLParser ref-counted, and having it register itself with Document when created. That makes it possible for scripts to add new input at the current parser insertion point. There is now a reference cycle between Document and HTMLParser. This cycle is explicitly broken by calling Document::detach_parser() at the end of HTMLParser::run(). This is a huge progression on ACID3, from 31% to 49%! :^)
2022-02-21LibWeb: Use correct coordinate space when measuring space between floatsAndreas Kling
When calculating how much space is available for inline content between left and right floated elements, we have to use coordinates in the containing block's coordinate space, since that's what floats use. This fixes an issue where text would sometimes overlap floats.
2022-02-21LibWeb: Calculate edge of containing block correctly when floating rightAndreas Kling
2022-02-21LibWeb: Don't shift right-floated boxes too much to the leftAndreas Kling
We were subtracting the content width of right-floated boxes from their X position for no reason. Removing this makes floats snuggle up to each other on the right side. :^)
2022-02-21LibWeb: Fix floating boxes getting stacked on top of each otherAndreas Kling
This was caused by the freestanding margin_box_rect() using 0 for the content height instead of the actual content height.
2022-02-21LibWeb: Compute table cell height after doing its inside layoutAndreas Kling
2022-02-21LibWeb: Rename FormattingState::ensure() -> get_mutable()Andreas Kling
This makes it much more obvious what the difference between get() and get_mutable() is.
2022-02-21LibWeb: Add hack to avoid crashing on !child_display.is_flow_inside()Andreas Kling
When encountering a box that claims to have block-level children, but its CSS display type isn't actually "flow" inside, we would previously crash due to a VERIFY() failure. However, many sites choke on this due to freestanding table-related boxes like those created by "table-row" and "table-row-group". We're supposed to fix those up by wrapping them in a full set of table boxes during layout tree construction, but that algorithm obviously isn't working correctly in all cases. So let's work around the crashes for now, allowing many more sites to load (even if visually incorrect.) This is a rather monstrous hack, and we should get rid of it as soon as it's not needed anymore.
2022-02-21LibWeb: Respect font-size specified by CSS in "em" length calculationsAndreas Kling
"5em" means 5*font-size, but by forcing "em" to mean the presentation size of the bitmap font actually used, we broke a bunch of layouts that depended on a correct interpretation of "em". This means that "em" units will no longer be relative to the exact size of the bitmap font in use, but I think that's a compromise we'll have to make, since accurate layouts are more important. This yields a visual progression on both ACID2 and ACID3. :^)
2022-02-21LibWeb: Store overflow data in the FormattingStateAndreas Kling
2022-02-21LibWeb: Create list-item markers during layout tree constructionAndreas Kling
Previously, these were added during layout. This didn't fit into the new world where layout doesn't mutate the tree incrementally, so this patch adds logic to Layout::TreeBuilder for adding a marker to each list-item box after its children have been constructed.
2022-02-21LibWeb: Start making our layout system "transactional"Andreas Kling
This patch adds a map of Layout::Node to FormattingState::NodeState. Instead of updating layout nodes incrementally as layout progresses through the formatting contexts, all updates are now written to the corresponding NodeState instead. At the end of layout, FormattingState::commit() is called, which transfers all the values from the NodeState objects to the Node. This will soon allow us to perform completely non-destructive layouts which don't affect the tree. Note that there are many imperfections here, and still many places where we assign to the NodeState, but later read directly from the Node instead. I'm just committing at this stage to make subsequent diffs easier to understand.
2022-02-21LibWeb: Add Layout::FormattingStateAndreas Kling
The purpose of this new object will be to keep track of various states during an ongoing layout. Until now, we've been updating layout tree nodes as we go during layout, which adds an invisible layer of implicit serialization to the whole layout system. My idea with FormattingState is that running layout will produce a result entirely contained within the FormattingState object. At the end of layout, it can then be applied to the layout tree, or simply queried for some metrics we were trying to determine. When doing subtree layouts to determine intrinsic sizes, we will eventually be able to clone the current FormattingState, and run the subtree layout in isolation, opening up opportunities for parallelism. This first patch doesn't go very far though, it merely adds the object as a skeleton class, and makes sure the root BFC has one. :^)
2022-02-21LibWeb: Assign correct viewport dimensions when making style for ICBAndreas Kling
The ICB (initial containing block) gets its style from StyleComputer's create_document_style(). It's basically a generic style for the root of the layout tree. With this patch, we now assign the width and height of the viewport rect as two CSS "px" lengths to the "width" and "height" properties of the ICB style. (Previously they were just defaulting to "auto" and we assigned override dimensions during layout.) This fixes an issue where position:absolute elements with relative width and/or height were not dimensioned correctly, since the values were relative to the width and/or height of the ICB style.