Commit graph

9254 commits

Author SHA1 Message Date
Daniel Bertalan
4b4177f39c LibDiff: Generate hunks for new/deleted files
Previously we would fail to generate any hunks if the old or the new
file was empty. We now do, with the original/target line index set to 0,
as specified by POSIX.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
01dc718f07 LibCore: Do not skip dotfiles when copying directories recursively 2022-03-08 23:30:47 +01:00
Daniel Bertalan
a285e651f1 LibArchive: Accept space characters as terminators of tar numeric fields
POSIX specifies that each numeric field is terminated with one or more
space or NUL characters.
2022-03-08 23:30:47 +01:00
Tim Schumacher
35e5024b7d DynamicLinker: Replace $ORIGIN with the executable path 2022-03-08 23:21:35 +01:00
Tim Schumacher
e7f861f34c DynamicLinker: Implement support for RPATH and RUNPATH 2022-03-08 23:21:35 +01:00
Tim Schumacher
7bd0a3e9ba DynamicLoader: Make the cached DynamicObject publicly accessible 2022-03-08 23:21:35 +01:00
Linus Groh
03c46a261f LibWeb: Implement the WindowProxy exotic object
A couple steps requiring working relationships between browsing contexts
are currently FIXME'd - see #12917.
2022-03-08 23:13:54 +01:00
Linus Groh
6f941433d6 LibWeb: Stub out 'check if access between two BCs should be reported'
I put this is a CrossOrigin/ subdirectory in anticipation of a lot more
cross-origin related ground to cover. :^)
2022-03-08 23:13:54 +01:00
Linus Groh
ae96eae4f9 LibWeb: Implement 'cross-origin accessible window property name' concept 2022-03-08 23:13:54 +01:00
Tom
d124889698 LibC: Add IPv6 support to inet_ntop and inet_pton 2022-03-08 23:05:44 +01:00
Timothy Flynn
f235f08e6d LibJS: Use known binding indices when creating new for-loop environments
When the initialization statement of a for-loop uses 'let', we must
create a new environment for each iteration of the for loop. The
bindings of the initialization statement are copied over to the new
environment. Since the bindings are created in the same order each time,
we can use that order to directly initialize the bindings and avoid any
O(n) lookups in this hot loop.
2022-03-08 23:02:12 +01:00
Timothy Flynn
f56bf610c4 LibJS: Allow pre-allocating DeclarativeEnvironment's bindings list 2022-03-08 23:02:12 +01:00
Timothy Flynn
435f49d98e LibJS: Allow direct index-based initialization of a declarative binding
Similar to the direct getter and setter in DeclarativeEnvironment, there
are cases where we already know the index of a binding and can avoid a
O(n) lookup to re-find that index.
2022-03-08 23:02:12 +01:00
Timothy Flynn
533170fbfa LibJS: Combine DeclarativeEnvironment's bindings and names into one list
This reduces the size of the DeclarativeEnvironment from 72 bytes to 48
bytes. This savings helps in the context of nested for-loops which use
'let' to bind the initial variable declarations. In this case, the spec
dicates we create a new environment for each loop iteration by way of
the CreatePerIterationEnvironment AO.

In particular, test262's generated RegExp tests contains many loops of
the form:

    for (let i = 0; i < a_number_on_the_order_of_10; ++i)
        for (let j = 0; j < a_number_on_the_order_of_10_thousand; ++j)

This results in creating hundreds of thousands of environments.
2022-03-08 23:02:12 +01:00
Luke Wilde
8d784310e0 LibJS: Implement the Error.prototype.stack setter
This implements the setter based on the Error Stacks proposal.
https://tc39.es/proposal-error-stacks/#sec-set-error.prototype-stack

Required by Twitch.
2022-03-08 22:59:09 +01:00
kimlintu
89c846a31c LibCore: Add support for application/zip mime-type
The local file header signature of a ZIP entry is normally 0x04034B50
and stored in little-endian byte order. Therefore, if the archive
starts with an entry we can identify a ZIP file by checking if the
first two bytes are 0x504B (PK).

Also checks for the .zip file extension, which is is also used by file
if no byte signature was detected.
2022-03-08 22:38:53 +01:00
Ali Mohammad Pur
5d51e26caf LibPthread: Partially implement pthread_cleanup_(push pop)
These are also supposed to run on cancellation, but we don't support
cancellation.
2022-03-08 22:29:53 +01:00
Andrew Smith
31a2ac94c7 LibGUI: Fix crash in GML Playground auto-completing SpinBox props
Crash was caused by deferred invocation of a lambda on the SpinBox's
TextEditor widget's on_change. The lambda referenced the SpinBox ptr,
but in GML Playground the SpinBox was free'd before the deferred
lambda could run, causing a use-after-free error. Fixed by using
a weak ptr to detect if the SpinBox was free'd.
2022-03-08 22:18:59 +01:00
Vrins
39a5076f40 Browser+LibWeb: Add an Element size preview widget to inspector
This Adds an element size preview widget to the inspector widget
in a new tab. This functions similar to chrome and firefox and
shows the margin, border, padding, and content size of the selected
element in the inspector.

The colors for the size preview widget are taken from the chrome
browser.
2022-03-08 22:09:52 +01:00
Vrins
3b22fd9a9f LibGfx: Add support for TextAlignment::TopCenter / BottomCenter
Now supports TextAlignment::TopCenter and TextAlignment::BottomCenter
for the Painter::draw_text.

Also patched this in Spreadsheet/CellTypeDialog.cpp
2022-03-08 22:09:52 +01:00
Liav A
df5fa20bee LibEDID: Fix DetailedTiming::pixel_clock_khz result
The stored value is in units of 10 kHz, which means that to get the
value in kHz, we need to multiply it by 10 and not 10000.
2022-03-08 22:07:59 +01:00
Lady Gegga
2a898a7e4a LibWeb: Add explicit color to mark element 2022-03-08 18:52:16 +01:00
Lady Gegga
2c1f5cd310 LibWeb: Add default styling to abbr, acronym, mark, strike and tt 2022-03-08 18:52:16 +01:00
networkException
3e7869d57d LibWeb: Remove outdated FIXME comment in Namespaces validate_and_extract
As step "2. Validate qualifiedName" got implemented in
bfa7aad0f6, parts is known to have a
length of 2.
2022-03-08 16:23:35 +01:00
Jelle Raaijmakers
3ece3f3ed1 LibSoftGPU: Remove a lot of [ui]32x4 casts in Sampler 2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
c21a3b3029 LibGL: Better handling of texture targets and default textures
We were lacking support for default textures (i.e. calling
`glBindTexture` with a `texture` argument of `0`) which caused our
Quake2 port to render red screens whenever a video was playing. Every
texture unit is now initialized with a default 2D texture.

Additionally, we had this concept of a "currently bound target" on our
texture units which is not how OpenGL wants us to handle targets.
Calling `glBindTexture` should set the texture for the provided target
only, making it sort of an alias for future operations on the same
target.

Finally, `glDeleteTextures` should not remove the bound texture from
the target in the texture unit, but it should reset it to the default
texture.
2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
c87d3521e4 LibGL: East-const glTex* methods 2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
5d21d1d105 LibGL: Remove duplicate public: from Texture2D.h 2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
9c2a7c0e03 LibTextCodec: Add support for the UTF16-LE encoding 2022-03-08 14:51:06 +01:00
Linus Groh
0706f0d487 LibWeb: Move Timer from DOM directory & namespace to HTML
Timers are part of the HTML spec. :^)
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
2022-03-08 00:30:30 +01:00
Linus Groh
1422bd45eb LibWeb: Move Window from DOM directory & namespace to HTML
The Window object is part of the HTML spec. :^)
https://html.spec.whatwg.org/multipage/window-object.html
2022-03-08 00:30:30 +01:00
Andreas Kling
2dfb617c5b LibWeb: Make InlineLevelIterator emit absolutely positioned items
Note that we don't put absolutely positioned items on a line! This is
just so that IFC can discover boxes and pass them along to BFC.

This fixes an issue where only direct children of the IFC containing
block were considered for absolute positioning. Now we pick up
absolutely positioned children of nested inline nodes as well.
2022-03-08 00:19:49 +01:00
Stephan Unverwerth
8165346ae4 LibSoftGPU: Choose correct texture filter based on scale factor
Previously the test determining whether to use texture maginifaction or
texture minification was reversed. This commit fixes the test and also
provides an early out of the sampler in case of texture magnification
since magnification does not make use of mipmaps.
2022-03-08 00:49:31 +02:00
ForLoveOfCats
c204885a94 LibGUI: Animated smooth scroll interpolation 2022-03-07 22:24:24 +01:00
Maciej
86c0961240 LibWeb: Make TextNode::ChunkIterator::try_commit_chunk() const 2022-03-07 21:49:36 +01:00
Andreas Kling
ff60e8ffc6 LibJS: Use Vector instead of HashMap in DeclarativeEnvironment
Constructing the HashMap in DeclarativeEnvironment was by far the most
expensive thing when making JavaScript function calls.

As it turns out, we don't really need this to be a HashMap in the first
place, as lookups are cached (by EnvironmentCoordinate) after the first
access, so after that we were not even looking in the HashMap, going
directly to the bindings Vector instead.

This reduces function_declaration_instantiation() from 16% to 9% when
idling in "Biolab Disaster". It also reduces has_binding() from 3% to
1% on the same content.

With these changes, we now actually get to idle a little bit between
game frames on my machine. :^)
2022-03-07 14:49:21 +01:00
Sam Atkins
deea129b8c LibWeb: Add Ratio type to MediaFeatureValue
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-07 13:42:25 +01:00
Sam Atkins
5f93f1c161 LibWeb: Introduce and parse CSS Ratio type
This is only used by media-queries, so for now we can skip
adding/parsing a StyleValue for these.
2022-03-07 13:42:25 +01:00
Sam Atkins
e30bfabbca LibWeb: Correct "color" media-feature value
This is bits per color channel, not bits per pixel, so 32 was a little
over-optimistic. :^)
2022-03-07 13:42:25 +01:00
Jelle Raaijmakers
62ffe67a9f LibGfx: Reimplement Vector::length() as a loop
This more generic loop supports arbitrary values of `N` and also gets
rid of that strange single argument `AK::hypot` invocation.
2022-03-07 11:00:45 +01:00
Jelle Raaijmakers
d75135663b LibGfx+LibSoftGPU: Add and use Vector.xy()
Also use `.xyz()` where appropriate.
2022-03-07 11:00:45 +01:00
Jelle Raaijmakers
439617cf6f LibSoftGPU: Use lroundf instead of roundf in rasterization rect
Casting a `float` to `int` might still inadvertently floor the value,
while `lroundf` will return a properly rounded `long`.
2022-03-07 11:00:45 +01:00
Jelle Raaijmakers
37dd10fbbe LibSoftGPU: Use float instead of int for triangle screen coords
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-07 11:00:45 +01:00
Matthew Olsson
6133acb8c0 LibPDF: Allow newlines between xref table and "trailer" keyword 2022-03-07 10:53:57 +01:00
Matthew Olsson
4d509ff365 LibPDF: Fix "incorrect" matrix multiplication in Renderer
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-07 10:53:57 +01:00
Matthew Olsson
6f1cfcf217 LibPDF: Implement marked renderer operations as nops 2022-03-07 10:53:57 +01:00
Matthew Olsson
544e44eec1 LibPDF: Fix bad hex string parsing logic 2022-03-07 10:53:57 +01:00
Matthew Olsson
3cfecc3d3b LibPDF: Remove useless hex string substring call 2022-03-07 10:53:57 +01:00
Matthew Olsson
e9342183f0 LibPDF: Support all Dest types 2022-03-07 10:53:57 +01:00
Matthew Olsson
b240d23a87 LibPDF: Propagate errors in Renderer/PDFViewer 2022-03-07 10:53:57 +01:00