summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2022-03-27LibC: Fix potential double free in ttyname_r_for_directoryBrian Gianforcaro
If we break out of the loop before we attempt to allocate again, then we double free the memory pointed to by `name_path`. Found by Static Analysis: Sonar Cloud
2022-03-27Everywhere: Rename CommandResult stdout, stderr members to output, errorBrian Gianforcaro
The names stdout / stderr are bound to conflict with existing declarations when compiling against other LibC's. The build on OpenBSD is broken for this reason at the moment. Lets rename the members to more generic names to resolve the situation.
2022-03-27LibWeb: Don't choke on ICB with inline childrenAndreas Kling
Let's relax our assumption about what kind of children the ICB has. This is preparation for loading XHTML documents.
2022-03-27LibWeb: Make whitespace collapsing statelessAndreas Kling
Previously, the whitespace collapsing code had a parameter telling it whether the previous text node ended in whitespace. This was not actually necessary, so let's get rid of it.
2022-03-27LibWeb: Ensure lazy WindowObject creation when activating event handlerLinus Groh
2022-03-27LibWeb: Don't crash in IFC if very first chunk is collapsible whitespaceAndreas Kling
2022-03-27LibLine: Avoid pointless size_t <-> ssize_t castAli Mohammad Pur
Just a small cleanup.
2022-03-27LibLine: Handle read events seriallyAli Mohammad Pur
Previously LibLine accepted read callbacks while it was in the process of reading input, this wasn't an issue as no async code was being executed up until the Shell autocompletion came along. Simply defer input processing while processing input to avoid causing problems. Fixes #13280.
2022-03-27Shell: Keep the stdio and rpath pledges for execute_process()Ali Mohammad Pur
If the command fails, we'd like to still be capable of printing out diagnostics, so restore stdio and rpath. Fixes #13281.
2022-03-27LookupServer: Fix confusing copy/paste error in debug messageLinus Groh
2022-03-27LibGL+LibSoftGPU+LibGfx: Reimplement normal transformationJelle Raaijmakers
We now support generating top-left submatrices from a `Gfx::Matrix` and we move the normal transformation calculation into `SoftGPU::Device`. No functional changes.
2022-03-27LibGL: Always normalize vertex attribute dataJelle Raaijmakers
We were normalizing data read from vertex attribute pointers based on their usage, but there is nothing written about this behavior in the spec or in man pages. When we implement `glVertexAttribPointer` however, the user can optionally enable normalization per vertex attribute pointer. This refactors the `VertexAttribPointer` to have a `normalize` field so we can support that future implementation.
2022-03-27LibSoftGPU+LibGfx: Transform and normalize normals before lightingJelle Raaijmakers
We were transforming the vertices' normals twice (bug 1) and normalizing them after lighting (bug 2). In the lighting code, we were then diverting from the spec to deal with the normal situation, which is now no longer needed. This fixes the lighting of Tux in Tux Racer.
2022-03-27LibSoftGPU: Clean up `Material` initial value styleJelle Raaijmakers
2022-03-27LibGL+LibSoftGPU: Implement more of `GL_LIGHT_MODEL_COLOR_CONTROL`Jelle Raaijmakers
This gets rid of a place where OpenGL was leaking into LibSoftGPU.
2022-03-27LibGL: Use correct `GLbyte` range in `glColor4b`Jelle Raaijmakers
We were only setting half the color intensity that we should have set.
2022-03-27LibSoftGPU: Test for `1.f` equality in determining the scale factorJelle Raaijmakers
We are still not doing the right thing here, but using `<=` instead of `<` at least gets rid of artifacts in Grim Fandango.
2022-03-27LibWeb: Resolve top/bottom inset properties for position:relativeAndreas Kling
This patch reimplements inset property resolution based on the new CSS Positioned Layout specification. Nothing should change for left/right insets, but we gain support for top/bottom. :^)
2022-03-27LibWeb: Rename ComputedValues::offset() => inset()Andreas Kling
2022-03-27LibWeb: Rename FormattingContext::compute_position() => compute_inset()Andreas Kling
This function computes the used inset properties, not the position of a box per se, so let's call it something more accurate.
2022-03-27LibWeb: Stop allowing position:relative to affect layoutAndreas Kling
Relatively positioned boxes should not affect the *layout* of their siblings. So instead of applying relative inset as a layout-time translation on the box, we now perform the adjustment at the paintable level instead. This makes position:relative actually work as expected, and exposes some new bugs we need to take care of for Acid2. :^)
2022-03-27LibWeb: Take borders and padding into account when doing Flex layoutEnver Balalic
Before this the flex layout didn't take into account the applied borders or padding while laying out the items. The child's top and left borders would get painted over the parent's borders, also due to it not taking borders into account, children with borders would overlap each other. Due to it not taking padding into account, the children would get drawn outside the parent element.
2022-03-27LookupServer: Use case-insensitive comparison for domain namesTimur Sultanov
Some ISPs may MITM DNS requests coming from clients, changing the case of domain name in response. LookupServer will refuse responses from any DNS server in that case. This commit changes the behaviour to perform a case-insensitive equality check.
2022-03-27disk_benchmark: TRY more stuff :^)Kenneth Myhra
2022-03-27disk_benchmark: Core::ArgsParser to parse argumentsKenneth Myhra
2022-03-27LibCore: Add Vector<size_t> variant of add_option()Kenneth Myhra
This adds a Vector<size_t> variant of add_option(). The signature includes a separator parameter which defaults to ','.
2022-03-27LibWeb: Add fast-paths for wrapping already-wrapped C++ objectsAndreas Kling
If a C++ object already has a JS wrapper, we don't need to go through the expensive type checks to figure out which kind of wrapper to create. Instead, just return the wrapper we already have! This gives a noticeable increase in smoothness on Acid3, where ~10% of CPU time was previously spent doing RTTI type checks in wrap(). With these changes, it's down to ~1%.
2022-03-27Revert "LibGfx: Remove bogus baseline adjustment in Painter's draw_text_line()"Andreas Kling
This reverts commit 2b2915656dca747ef4415b9d59f6d1fd6e50bf24. While this adjustment is bogus, it is currently responsible for putting CenterLeft aligned scalable text in the right position. This is going to take a bunch of work to get right.
2022-03-27LibGfx: Remove bogus baseline adjustment in Painter's draw_text_line()Andreas Kling
This didn't achieve anything other than a slight vertical misalignment for scalable fonts.
2022-03-27LibWeb: Use Gfx::Font::pixel_size() when we want pixel metricsAndreas Kling
This gives us consistent results with both bitmap and scalable fonts.
2022-03-27LibGfx: Use Font::pixel_size() instead of glyph_height() when paintingAndreas Kling
This gives us correct height metrics for both bitmap and scalable fonts.
2022-03-27LibGfx: Add Font::pixel_size() and Font::point_size()Andreas Kling
We've gotten ourselves into a bit of a mess by mixing pixel and point sizes in multiple places. Step one towards getting out of this mess is adding explicit accessors for the unit you're trying to fetch. The core of the issue comes from bitmap fonts storing integer pixel sizes and scaled (TTF) fonts storing float point sizes.
2022-03-27LibWeb: Don't round font sizes when looking them upAndreas Kling
We previously had a rounding error which sometimes led to asking LibGfx for fonts with slightly wrong sizes.
2022-03-27LibGfx: Make FontDatabase lookups take font (point) sizes as floatAndreas Kling
This will allow web content to ask for fractional sizes, which becomes important when converting between px/pt.
2022-03-27WindowServer+LibGUI: Expose raw scroll wheel values to applicationscircl
This is useful, for instance, in games in which you can switch held items using the scroll wheel. In order to implement this, they previously would have to either add a hard-coded division by 4, or look up your mouse settings to adjust correctly. This commit adds an MouseEvent.wheel_raw_delta_x() and MouseEvent.wheel_raw_delta_y().
2022-03-27LibWeb: Use date constantsLenny Maiorani
Make the code DRY (Don't Repeat Yourself) by using the `AK`-provided month name constants instead of copying them.
2022-03-26LibWeb: Include negative margins in height:auto computation for BFC rootAndreas Kling
...but never allow the resulting height to become negative. This solves an issue seen on Acid3 where elements with negative vertical margins expanded the size of their height:auto container instead of shrinking it, which is the correct behavior. This now works :^)
2022-03-26LibWeb: Don't collapse horizontal margins between floating boxesAndreas Kling
CSS 2.2 says "Horizontal margins never collapse." So instead of collapsing them, we now add them together, which makes negative margins between floating boxes work beautifully.
2022-03-26Browser: Make the main browser window a little bit bigger by defaultAndreas Kling
2022-03-26LibWeb: Remove debug spam about not executing empty script elementsAndreas Kling
2022-03-26LibWeb: Fix typo in SVGSVGElement::apply_presentational_hints()Andreas Kling
Regressed in 7df62c64b7116842e43f2c8fcd1a7b0e71f456b7. Thanks to Dex for spotting this! :^)
2022-03-26LibWeb: Simplify text chunk iteration a little bitAndreas Kling
Instead of TextNode::ChunkIterator having two bool members to remember things across calls to next(), this patch reorganizes the loop in next() so that preserved newline/whitespace chunks are emitted right away instead of in an awkward deferred way.
2022-03-26LibWeb: Remove unused declarations from Layout::TextNodeAndreas Kling
2022-03-26LibWeb: Make text newlines in "pre" mode emit a ForcedBreak itemAndreas Kling
Instead of emitting a Text item with the "should_force_break" flag set to true, newlines in newline-preserving text content now timply turn into ForcedBreak items. This makes the <pre> element work again.
2022-03-26LibWeb: Don't append collapsible whitespace to start of new lineAndreas Kling
After performing a required line break, and the next text chunk is all collapsible whitespace, simply discard the whitespace.
2022-03-26LibWeb: Make HTML{Button,Select,TextArea}Element focusableLinus Groh
From the HTML spec: Modulo platform conventions, it is suggested that the following elements should be considered as focusable areas and be sequentially focusable: ... - button elements - select elements - textarea elements ... Also add a spec link to the existing HTMLAnchorElement::is_focusable(). Note that this still doesn't allow triggering keyboard-focused buttons, checkboxes, or radio buttons - we don't seem to run the expected activation behavior for any of them.
2022-03-26LibWeb: Make any HTMLInputElement with type != hidden focusableLinus Groh
From the HTML spec: Modulo platform conventions, it is suggested that the following elements should be considered as focusable areas and be sequentially focusable: ... - input elements whose type attribute are not in the Hidden state ...
2022-03-26LibWeb: Make HTMLInputElement::TypeAttributeState an enum classLinus Groh
2022-03-26tee: Port to LibMain and move to SerenityOS code patternsKenneth Myhra
This patch ports the utility 'tee' to LibMain and converts a larger part of its code to our SerenityOS patterns.
2022-03-26Chess: On pgn import avoid losing piece promotion infoSimon Danner
Fixes #13268