There are two FIXMEs remaining that depend on a functional
PolicyContainer, which we ignore for now and always behave like a CSP is
set.
(cherry picked from commit 84fe8d675b21ca5fa7da663e6ca86718f05cf29f)
This is a mixin in the IDL, so let's treat it as a mixin in our code and
let both SVGElement and MathMLElement reuse the implementations that we
wrote for HTMLElement.
(cherry picked from commit 5f84c2c3afef81fac09b9b255baa97326ce2b4cd)
We initialize a static GUI::Application in VideoInit that is never
explicitly destructed. Because we don't do so, SDL2 applications can
crash on exit since static destruction of the application will try to
destruct its owned event loop, which was thread-local and already
destroyed.
By clearing the RefPtr in VideoQuit, we prevent crashing directly
afterwards in Serenity's `exit()`.
Add giflib so the Hpl1 and Phoenix VR engines remain enabled. Hpl1
bundles AngelScript, which expects malloc.h on most non-BSD systems, but
Serenity provides the allocation functions through stdlib.h.
SourceForge moved the 5.x releases into a subdirectory. Pass SerenityOS
as UNAME while building and installing so giflib selects ELF
shared-library flags on macOS hosts.
We don't need a default token to have write permissions to anything,
since we use BUGGIEBOT_TOKEN to do the actual publishing. Additionally,
checkouts should just use the default token since both repositories are
public.
Finally, we pin the version for actions/checkout to 6.0.0 so we don't
include the change for the new `includeIf` git config in 6.0.1, which
breaks JamesIves/github-pages-deploy-action. The fix for that should
land in the first version after v4.7.4.
According to POSIX, we must define `timespec`, but we _may_ include
`time.h` in doing so. Compiling ScummVM 2.9.1 against LibC was failing
because compared to glibc, we were pulling in `time.h` too early which
caused conflicts in ScummVM's `common/forbidden.h`.
We only supported named properties on Storage, and as a result
`localStorage[0]` would be disconnected from the Storage's backing map.
Fixes at least 20 subtests in WPT in /webstorage.
(cherry picked from commit 4c189166f4f721211ff9b693f306f65033d70ac1)
We only set the grapheme segmenter's text once after creating a new
segmenter, so we also need to clear it whenever we invalidate the text.
(cherry picked from commit 25516e351e46104ff445216e7835aaab9f9b9535)
This condition was included to implement flex containers with auto
height, but it actually can reset the definitive height to 0 for inline
blocks with only replaced elements such as an SVG. Removing the
condition does not break any in-tree test, so let's improve the
situation on the SVG side of things for now.
(cherry picked from commit 352a66390f27fb7bbbfa823364fefc9af00d4b63)
We were not discarding enough whitespace to actually get to the radius
and color values.
(cherry picked from commit c99fad77e1cfc8789f2a8d33e958d7b5bcf35ea9)
This shares its implementation with `backdrop-filter`.
(cherry picked from commit 29974de852fb14eef78a18232bd36d5c8955a214;
amended to resolve conflict on `height:` in expectations file, and to
remove change to DisplayListPlayerSkia.cpp which serenity doesn't have;
also updated FilterPainting.{h,cpp} for changes since serenity does not
have LadybirdBrowser/ladybird#736 and LadybirdBrowser/ladybird#886)
This exposes BaseAudioContext.listener, which is a container for
parameters related to the configuration of an actual "listener" in 3D
space.
(cherry picked from commit 2a98f2a12d5069a2189fa38b4a7e158d84ee03ec)
Move the pending promises list from AudioContext to BaseAudioContext and
deal with all remaining FIXMEs.
(cherry picked from commit 2df3488840ccf8e8c560bde4826897c2023dbe29)
We need these steps to be available for the yet to be implemented
`BaseAudioContext.decodeAudioData()`.
(cherry picked from commit 177e5210e09ee4b5906e5d7db34154fae4ec76c6)
This opens up the code path for the `ArrayBuffer` type, which can now be
used as a method argument.
(cherry picked from commit 0b9d55b6761b85b3b80a459d6231841e72a26c51)
The DOM spec gets overridden by both the SVG2 and MathML core specs in
that unknown elements should not inherit DOM::Element, but
SVG::SVGElement and MathML::MathMLElement respectively.
(cherry picked from commit 76e638b4ca10a91983877d6f6e7f037c1a720965)
Tiny mistake in the implementation of the spec; fixes 16 FAILs in the
WPT `/dom/ranges/Range-mutations-splitText.html` tests.
(cherry picked from commit dee81f354531c2e49be34279ca31ccc7ad9cbcca)
This implements the `preload` reflected attribute. No actual preloading
is going on yet.
(cherry picked from commit fe933b2057eee8eb65d6e43a97b934bbe85d03bb)
If a HTTP 401 response we get does not contain a `WWW-Authenticate`
header, we should not trigger the logic to ask the user for credentials
and retry the request.
This part is hinted at in a TODO / 'Needs testing' remark in the spec
but needs to be fleshed out. Raised an upstream issue to do so:
https://github.com/whatwg/fetch/issues/1766
This fixes login forms triggering an infinite fetch loop when providing
incorrect credentials.
Co-Authored-By: Victor Tran <[email protected]>
(cherry picked from commit e7984a77116d47fde150f81f6e18cae6aaa147ad)
In calculating the base size of a flex item, we have a piece of ad-hoc
code that deals with an item that does have an instrinsic aspect ratio,
but not a cross size to resolve that ratio against. In determining the
actual flex item size however, we also take into account the minimum
content width and height, which assumes the box' intrinsic width or
height when available. This would break having an image as a flex item,
which gets stretched to its maximum size within the flex container
instead of the flex item being shrunk to the instrinsic size of the
image.
Fix this by only stretching flex items that do not have an instrinsic
width nor height set.
(cherry picked from commit 7a783d3a89aec0caaa63a483c855fe921b6d0984)
Calling `.setSelectionRange()` or `.select()` now updates the document
selection as well, visualizing the text selection.
(cherry picked from commit 732e3fa82f216a6f4114eb0e6bb89e167e95ab42)
This causes UI interactions with the document selection to also update
the input and textarea DOM selection state. Note that we switch around
the order of focusing a DOM node and setting the selection, so we allow
the focus event to override whatever selection we came up with.
(cherry picked from commit badcdcacf5488b6aedab8184774393ba1e86821a)
For both types of elements, `.selectionStart`, `.selectionEnd`,
`.selectionDirection`, `.setSelectionRange()`, `.select()` and the
`select` event are now implemented.
(cherry picked from commit 814ca3267ed73d7ad8492ef69ff87f95240cf922)
IDL enumerations are one of the rare list types in the IDL spec that
allow for a trailing comma:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17508
(cherry picked from commit 47597d0fb83d78eaf43be549cd7fe23e9b239b78)
This caused the last scanlines for edges to render incorrectly. We had
some reference images which included these corruptions (they were almost
unnoticeable), so update them as well.
(cherry picked from commit 5865cf58641794eac73f200a784829d867ccf8b7;
but only the changes to EdgeFlagPathRasterizer.cpp that aren't related
to premultiplied alpha; also this affects more screenshot tests for
us since we use EdgeFlagPathRasterizer for most painting)
Now that ports can find our OpenGL headers and shared library, remove
all configuration and patches that was previously needed to make ports
compile with LibGL.
This allows ports to access the OpenGL headers using `#include
<GL/gl.h>` and find the shared library at `/usr/lib/libGL.so` or
`/usr/lib/libGL.so.1`, removing the need for explicit include paths or
changed library names.
This implements support for `glBlendEquation` and
`glBlendEquationSeparate`. These functions modify the calculation of the
resulting color in blending mode.
An SDL2 application is allowed to show a message box before the video
subsystem is initialized. This change makes sure GUI::Application is
initialized.
An example of this is SRB2: the process forks itself to let the child
process install itself as the signal handler and deal with errors. This
child process could try to show a message box long after the video
subsystem was initialized, but since it is a forked process there is no
static state for GUI::Application or the connection to the window
server and the process would crash because of a null dereference.
Instead of limiting ourselves to the key of the property in the JSON,
allow overriding the function name so we can generate completely
different function signatures with very similar names to other existing
API methods (e.g. `glUniform*` vs `glUniform*v`).
In a TTY's non-canonical mode, data availability can be configured by
setting VMIN and VTIME to determine the minimum amount of bytes to read
and the timeout between bytes, respectively. Some ports (such as SRB2)
set VMIN to 0 which effectively makes reading a TTY such as stdin a
non-blocking read. We didn't support this, causing ports to hang as soon
as they try to read stdin without any data available.
Add a very duct-tapey implementation for the case where VMIN == 0 by
overwriting the TTY's description's blocking status; 3 FIXMEs are
included to make sure we clean this up some day.
SRB2 will try to load libGLU.so.1 dynamically if started with the OpenGL
renderer, so add it as a dependency. The game still crashes immediately,
but this brings us one step closer :^)
This was broken since c8f27d7cb8 introduced a new enum value in
between existing values. Since the Serenity platform support in SDL2
relied on a sequential array index, a lot of keys were now incorrectly
mapped.
This introduces a new way to map Serenity `KeyCode` to SDL2's scancode
constants that is less prone to breaking in the future.
The spec asks us to perform some calculations that quickly exceed an
`u64`, but instead of jumping through hoops we can rely on our AK
implementation of floating point formatting to come up with the
correctly rounded result.
Note that most other JS engines seem to diverge from the spec as well
and fall back to a generic dtoa path.
There were 2 issues with the way we formatted floating point decimals:
if the part after the decimal point exceeded the max of an u64 we would
generate wildly incorrect decimals, and we applied no rounding.
With this new code, we emit decimals one by one and perform a simple
reverse string walk to round the number up if required.
On my machine, benchmarking 3DFileViewer revealed ~2.5% of CPU time
spent in `Vector<GPU::Vertex>::try_append`. By carefully managing list
capacities, we can remove this method from profiles altogether.
Optimize a very hot function by always performing unchecked appends.
When benchmarking 3DFileViewer on my machine, this takes the time spent
in `gl_vertex` down from ~8% to ~2%.
LibSoftGPU used to calculate the normal transformation based on the
model view transformation for every primitive, because that's when we
sent over the matrix. By making LibGL a bit smarter and only update the
matrices when they could have changed, we only need to calculate the
normal transformation once on every matrix update.
When viewing `Tuba.obj` in 3DFileViewer, this brings the percentage of
time spent in `FloatMatrix4x4::inverse()` down from 15% to 0%. :^)
We were confusing the time spent rendering with the time spent rendering
_and_ waiting for the next frame, which is important since we render
frames on a timer.
Previously, we would divide the widget width and height by the tile size
and round up, which did not result in enough tiles to cover the entire
widget. Although this calculation is correct if you starting drawing
tiles in the top left corner, we have an additional offset to account
for.
Now, we take the number of tiles that fit in the widget completely and
pad it with 2 tiles to account for the partial left/right and top/bottom
sides. An additional tile is added to account for the iterator
translating by width / 2, which rounds down again.
The resulting tile rects are always intersected with the widget
dimensions, so even if we're generating more tile coordinates than
strictly necessary, we're not performing the actual download or draw
operations.
The `operator++` of the spiraling tile iterator was repeating the first
coordinates (`0, 0`) instead of moving to the next tile on the first
iteration. Swapping the move and check ensures we get to the end of the
iterator, fixing gray tiles that would sometimes pop up in the lower
right.
Since we never return from `operator++` without setting a valid
position, we can drop `current_x` and `current_y` and just use the
`Gfx::Point<T>` directly.
Since we divide the width and height of the downscaled tiles by 2,
bilinear blending is identical to box sampling and should be preferred
since it's the simpler one of the two algorithms.
...requested size"
This reverts commit 13573a6c4b.
Some clients of `BufferedStream` expect a non-blocking read by
`read_some` which the commit above made impossible by potentially
performing a blocking read. For example, the following command hangs:
pro http://ipecho.net/plain
This is caused by the HTTP job expecting to read the body of the
response which is included in the active buffer, but since the buffered
data size is less than the buffer passed into `read_some`, another
blocking read is performed before anything is returned.
By reverting this commit, all tests still pass and `pro` no longer
hangs. Note that because of another bug related to `stdout` / `stderr`
mixing and the absence of a line ending, there is no output to the
command above except a progress update.
When zooming in or out, if a tile is not yet cached, Maps now also
checks the lower and higher zoom levels for cached tiles and composites
a preview tile that is shown until the actual tile is loaded in.
Previously we would bombard RequestServer with as many requests as it
would take, but when frantically zooming in and out, we would run out of
fd's causing the Maps application to hang.
This implements a tile download queue and limits the amount of parallel
downloads to 8. This fixes the hangs accompanied by this debug console
message:
Peer endpoint error: recvfd: Too many open files (errno=24)
It does not fix other sporadic hangs caused by requests that are never
finished, however.
Hopefully this makes it more clear what the intended action is. For a
lot of people "squashing" means combining multiple commits into one,
which is a common practice when merging to a branch.
Otherwise, if an application defines its own macros, the implementations
get messed up. This way we redefine those macros if they're set.
This fixes the PHP port build.