Commit Graph

13040 Commits

Author SHA1 Message Date
Andreas Kling
58522f5088 LibWeb: Make window.{window,self,frames} return the WindowProxy
These now follow the spec and return the WindowProxy rather than the
Window itself.
2022-10-20 16:01:26 +02:00
Andreas Kling
8fd59fce9c LibWeb: Remove unnecessary hack in HTML::Window::initialize()
We don't need to force-set the realm's global object during
initialization anymore, now that intrinsics are set up elsewhere.
2022-10-20 15:31:12 +02:00
Andreas Kling
dc15cacfc3 LibWeb: Use OrderedHashMap to store pending idle callbacks
This removes the need for a separate IdleCallback object per
registration, since the handles are now used as map keys.
2022-10-20 15:16:23 +02:00
Andreas Kling
8875cd0c83 LibWeb: Prevent world leak when activating event handler
Since SafeFunction strongly protects all of its captures, we can't
capture `this` when activating an event handler since that creates a
reference cycle and we end up leaking the entire world.
2022-10-20 15:16:23 +02:00
Andreas Kling
268b9c5d90 LibWeb: Make the layout tree GC-allocated
This removes a set of complex reference cycles between DOM, layout tree
and browsing context.

It also makes lifetimes much easier to reason about, as the DOM and
layout trees are now free to keep each other alive.
2022-10-20 15:16:23 +02:00
Andreas Kling
83c5ff57d8 LibWeb: Make BrowsingContext GC-allocated
(And BrowsingContextGroup had to come along for the ride as well.)
This solves a number of nasty reference cycles between browsing
contexts, history items, and their documents.
2022-10-20 15:16:23 +02:00
Andreas Kling
2898701459 LibWeb: Hang on to the internal realm with a JS::Handle
This fixes an issue where GC would kill the internal realm if it ran at
the wrong time during startup. Found by aggressively GC'ing between
every allocation.
2022-10-20 15:16:23 +02:00
Andreas Kling
6e0f80fbe0 LibWeb: Make the HTMLParser GC-allocated
This prevents a reference cycle between a HTMLParser opened via
document.open() and the document. It was one of many things keeping
some documents alive indefinitely.
2022-10-20 15:16:23 +02:00
Andreas Kling
68452c749a LibWeb: Prevent GC from running during intrinsics allocation
Due to the way we lazily construct prototypes and constructors for web
platform interfaces, it's possible for nested GC allocation to occur
while GC objects have been allocated but not fully constructed.

If the garbage collector ends up running in this state, it may attempt
to call JS::Cell::visit_edges() on an object whose vtable pointer hasn't
been set up yet.

This patch works around the issue by deferring GC while intrinsics are
being brought up. Furthermore, we also create a dummy global object for
the internal realm, and populate it with intrinsics. This works around
the same issue happening when allocating something (like the default UA
stylesheets) in the internal realm.

These solutions are pretty hacky and sad, so I've left FIXMEs about
finding a nicer way.
2022-10-20 15:16:23 +02:00
Andreas Kling
8412206cb4 LibWeb: Cache pseudo element layout nodes weakly on DOM::Element
Having the cache be strong created a reference cycle between DOM nodes
and their pseudo elements.
2022-10-20 15:16:23 +02:00
Andreas Kling
e23fe8cf87 LibJS: Make define_native_foo() take SafeFunctions
We were taking AK::Function and then passing them along to
NativeFunction, which takes a SafeFunction. This works, since
SafeFunction will transparently wrap AK::Function in a CallableWrapper
when assigned, but it was causing us to accumulate thousands of
pointless wrappers around direct function pointers.

By using SafeFunction at every step of the setup call chain, we no
longer create any CallableWrappers for the majority of native functions
in LibJS. Also, the number of heap-registered SafeFunctions in a new
realm goes down from ~5000 to 5. :^)
2022-10-20 15:16:23 +02:00
Andreas Kling
202cc025e5 LibJS: Don't register SafeFunction-to-function-pointer with JS::Heap
Direct function pointers don't have captures, so we don't need to
register the SafeFunction with the Heap when it's just wrapping a
function pointer.
2022-10-20 15:16:23 +02:00
Andreas Kling
be5a39657e LibWeb: Only store one DOM pointer per Layout::Node
Instead of storing two JS::Handles into the DOM, we can combine them
into a single one.

If the layout node is anonymous, m_dom_node points to the DOM::Document.
Otherwise, m_dom_node points to the associated DOM node.

The anonymous state is moved to an m_anonymous boolean member.

This cuts the number of JS::Handles created by the layout tree in half
(and shrinks Layout::Node by 8 bytes).
2022-10-20 15:16:23 +02:00
Andreas Kling
18a5c56f14 LibWeb: Don't store JS::Handle<JS::Promise> in EnvironmentSettingsObject
Now that the ESO is a JS::Cell, we can just store them as NonnullGCPtr
and mark them in visit_edges().
2022-10-20 15:16:23 +02:00
Andreas Kling
dbee75af19 LibWeb: Tear down old layout tree when new document becomes active
When a new document becomes the active document of a browsing context,
we now notify the old document, allowing it to tear down its layout
tree. In the future, there might be more cleanups we'd like to do here.
2022-10-20 15:16:23 +02:00
Andreas Kling
94f0c34dfe LibWeb: Remove unnecessary WeakPtr in queue_microtask_impl()
Capturing a WeakPtr to a GC-allocated object in a JS::SafeFunction is
basically pointless, since the SafeFunction mechanism will then keep
the object alive anyway.
2022-10-20 15:16:23 +02:00
Andreas Kling
57f508f048 LibWeb: Use JS::SafeFunction in run_timer_initialization_steps() 2022-10-20 15:16:23 +02:00
Andreas Kling
a8bdf866d9 LibWeb: Discard old browsing context after obtaining a new one
Cleaning up an old FIXME from before discard was implemented.
2022-10-20 15:16:23 +02:00
Andreas Kling
24510b0845 LibWeb: Make window.parent and window.top return WindowProxy
These functions were previously ad-hoc and returned the active
document's window. They now correctly teturn the browsing context's
WindowProxy instead.
2022-10-20 15:16:23 +02:00
Andreas Kling
3c548adf9c LibWeb: Create and hook up a WindowProxy for each BrowsingContext
All the machinery for this was already in place, we just never created
the actual WindowProxy and installed it.
2022-10-20 15:16:23 +02:00
Andreas Kling
738e770fce LibJS: Remove unnecessary operator==() for ({Nonnull,}GCPtr<T>, T*)
These aren't necessary in the first place since {Nonnull,}GCPtr has
operator T*()
2022-10-20 15:16:23 +02:00
Moustafa Raafat
8f964604f0 LibJS: Refactor CalendarFields for better linearity
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/9b139a1
2022-10-20 00:53:44 +02:00
Idan Horowitz
d38aeddd77 LibJS: Simplify ParseTemporalTimeZoneString
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/eec8efab
2022-10-20 00:47:42 +02:00
Idan Horowitz
0c61552b81 LibJS: Refactor ToRelativeTemporalObject
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/895854d9
2022-10-20 00:47:42 +02:00
Moustafa Raafat
092b33c96e LibJS: Remove trivial operations ISO{Year,Month,Day}
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/606d8a2
2022-10-19 22:39:33 +02:00
Moustafa Raafat
69d5368b2a LibJS: Remove trivial operation IsValidISOMonth
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/a08330a
2022-10-19 22:39:33 +02:00
Moustafa Raafat
48cc557dfa LibJS: Merge ISOMonthCode and BuildISOMonthCode
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/a4d17b1
2022-10-19 22:39:33 +02:00
Moustafa Raafat
b69ceae10c LibJS: Improve alias names in ResolveISOMonth
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/01d5fbe
2022-10-19 22:39:33 +02:00
Moustafa Raafat
d758566996 LibJS: Simplify ResolveISOMonth
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/1b83226
2022-10-19 22:39:33 +02:00
Tobias Christiansen
3db92885cd WebContent+Friends: Add get_element_property IPC and plumbing 2022-10-19 22:30:06 +02:00
Jelle Raaijmakers
91cec51b99 LibGL: Correctly normalize different vertex attribute type pointers
According to the OpenGL 2.0 spec § 2.8, the data for each attribute type
pointer is normalized according to the type. The only exception to this
is `glVertexAttribPointer` which accepts a `normalized` parameter, but
we have not yet implemented that API.
2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
00b21fba57 LibGL: Return GLboolean value in glIsEnabled 2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
fe5419da0f LibGL: Implement state for all pixel store parameters
This implements the state and context parameters for all packing and
unpacking parameters accepted by `glPixelStore*`.
2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
e2b151812e LibGL: Don't repeat ourselves in read_from_vertex_attribute_pointer 2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
5def168f14 LibGL: Implement missing glDeleteLists error conditions 2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
2d59c9b6b6 LibGL: Make read_from_vertex_attribute_pointer static 2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
01a4d58432 LibGL: Do not return early if client-side vertex array is disabled
According to the spec, enabling the client-side vertex array should
behave as if `glVertex` is executed after all other states such as the
normal, color, etc. have changed. We were not changing these states if
the client-side vertex array was disabled which probably does not affect
a lot of applications, but this seems like the correct thing to do. :^)
2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
03258f4c96 LibGL: Add buffer API stubs
No implemented functionality, but this makes it easier to see if
software is using this family of functions.
2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
1c32d93a12 LibSoftGPU: Call floor_int_range only once in sample_2d_lod
We were invoking `frac_int_range` twice to get the `alpha` and `beta`
values to interpolate between 4 texels, but these call into
`floor_int_range` again. Let's not repeat the work.
2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
88ca72aa79 LibSoftGPU: Extract argb32_color value in rasterization
This makes it easier to correlate slow instructions in the disassembly
view of ProfileViewer.
2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
681695a07a LibSoftGPU: Make alpha testing a static function
There is no need to access the Device's members for alpha testing; pass
in the required alpha function and reference value.
2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
4e63ce231f LibSoftGPU: Clean up Sampler imports 2022-10-19 22:22:58 +02:00
Jelle Raaijmakers
1774fde37c LibSoftGPU: Drop texel Z coordinate from Sampler
We only support 2D indexing into textures at the moment, so don't
perform any work trying to support the Z coordinate.
2022-10-19 22:22:58 +02:00
cflip
abc0c44f0b LibGL+LibGPU+LibSoftGPU: Report maximum texture size 2022-10-19 22:07:05 +02:00
Etienne Rodriguez
e5a9f030f2 LibGUI: Insert first displayed emoji on return
This enables users to insert emojis without using the mouse by searching
for it in the EmojiInputDialog and then hitting return.
2022-10-19 14:05:42 -04:00
Andreas Kling
178f0b9971 LibJS: Support non-base-10 BigInt literals in bytecode VM
Fixes 39 tests in test262 and a handful in test-js. :^)
2022-10-19 19:58:15 +02:00
Andreas Kling
29935fe943 LibJS: Support for (x in obj) iteration in bytecode VM
We were mistakenly treating these as `for (x of obj)`. By reorganizing
the code a little bit, we actually support both kinds of iteration with
less duplication. :^)

Fixes 17 tests in test262.
2022-10-19 19:03:57 +02:00
Tobias Christiansen
3f5a620b5d WebContent+Friends: Add get_element_attribute IPC and plumbing 2022-10-19 17:30:58 +02:00
Aliaksandr Kalenik
dfc3a4772b LibWeb: Ignore "pointer-events: none" elements in hit_test 2022-10-19 16:11:15 +02:00
Andreas Kling
f39b6ae3c6 LibJS: Avoid expensive UTF-8/16 conversion in legacy RegExp properties
Let's not incur the cost of a synchronous conversion to UTF-8 for all
the legacy static properties after running a regular expression.

The SunSpider subtest regexp-dna goes from taking ~25 sec to ~0.7 sec
on my machine.
2022-10-19 16:10:42 +02:00
Andreas Kling
d9b543da68 LibJS: Disable bytecode optimizations by default
The optimization passes are not stable, which makes test262 flaky.
Address this by introducing a new OptimizationLevel::None and making it
the default.

This removes all the flakiness from test262 in my testing.

We can enable optimizations by default again once they have been made
stable. :^)
2022-10-19 14:37:57 +02:00
MacDue
c6fbeb5845 LibWeb: Don't attempt to paint text shadows for empty text fragments
This avoids the debug spam that happens then the shadow painting fails
to allocate a zero sized bitmap.
2022-10-18 23:18:53 +02:00
MacDue
89e308726e LibWeb: Print requested bitmap sizes in shadow painting debug logs
Also replace "box-shadow" with "text-shadow" in the text shadow
painting debug logs.
2022-10-18 23:18:53 +02:00
Luke Wilde
41d6307c17 LibHTTP: Fix not consuming the last byte of body in from_raw_request
`index + 1` was not correct. For example, if the body has two bytes, we
would consume the first byte and increment the index. We then add one
to the index and see it's equal to the size, so we take this one byte
and set the body result to it. The while loop would still continue and
we consume the second byte, adding it to the temporary buffer. We see
that the index is above the size, so we don't update the body, dropping
the last byte on the floor.
2022-10-18 23:18:20 +02:00
Tobias Christiansen
5d762bd448 WebDriver+Friends: Add IPC and plumbing for Element-getting
This extends the IPC calls `get_document_element` and
`query_selector_all` to be usable by the WebDriver. For this the
`WebDriverConnection` provides the same interfaces and takes care of
routing the data through the Browser.
2022-10-18 19:18:33 +02:00
Timothy Flynn
27737f613c LibTimeZone+LibJS: Update to TZDB version 2022e
https://mm.icann.org/pipermail/tz-announce/2022-October/000074.html

This version changes America/Chicago's transtion from LMT to CST from
1883 Nov 18 12:09:24 to 1883 Nov 18 18:00.
2022-10-18 16:01:44 +02:00
Liav A
74a080fb68 LibC: Use proper casting in fgetc and fgetc_unlocked functions
In the fgetc function, a fix was already in place but was clunky. A real
proper solution is to use an unsigned char instead of a char when
returning the value, so an implicit cast is happening based on the
assumption that the value is unsigned, so if the variable contained 0xff
it won't be treated as -1, but as unsigned 0xff, so the result int will
be 0xff and not -1.

The same solution is applied to the fgetc_unlocked function as well.
2022-10-18 13:21:38 +02:00
Zaggy1024
f0420def78 LibWeb: Implement HTMLSelectElement length, item() and namedItem()
These are simple calls through to the HTMLOptionsCollection functions
the same names, as with HTMLSelectElement.add().
2022-10-18 12:57:40 +02:00
Johannes Laudenberg
2547e0b966 LibWeb: Use calculate_min_content_height() for sizing of grid children
When sizing grid children we now also check whether
calculate_min_content_height() adds to the computed height. Previously
we were using the result of layout_inner() which led to zero height of
not specifically sized block level children.

This fixes a height issue with our GitHub page. The footer is now at
its place and is not hovering over other content anymore.
2022-10-18 12:55:34 +02:00
Linus Groh
a6ba82fc49 LibTimeZone: Resolve /etc/localtime with realpath(), not readlink()
On Fedora Silverblue and other OSTree-based systems, /etc/localtime is
a symlink to /run/host/etc/localtime, which then points to the expected
zoneinfo file, e.g. ../usr/share/zoneinfo/Europe/Berlin.
By using realpath() instead of readlink() we can resolve the symlink
recursively and avoid falling back to UTC.
2022-10-17 22:19:50 +02:00
Timothy Flynn
b1b17f286f LibC: Retrieve the current time zone from LibTimeZone
This ensures we have just one location for determining the time zone, so
that LibC and LibTimeZone will behave the same.

(Note the FIXME removed here is also in TimeZone::current_time_zone.)
2022-10-17 21:50:55 +02:00
Timothy Flynn
ed612d835d LibTimeZone: Default to UTC if parsing the TZ environment variable fails
Commit c3fd455 changed LibTimeZone to fall back to the system time zone
when we fail to parse the TZ environment variable. This behavior differs
from both our LibC and glibc; they abort parsing and default to UTC.

This changes LibTimeZone to behave the same way to avoid a very awkward
situation where some parts of the codebase thinks the timezone is UTC,
and others think the timezone is whatever /etc/timezone indicates.
2022-10-17 21:50:55 +02:00
leeight
0d96468e9b LibJS: Implement RegExp legacy static properties
RegExp legacy static properties Spec url is https://github.com/tc39/proposal-regexp-legacy-features
2022-10-17 17:08:33 +02:00
Andrew Kaster
b8e51425e9 Lagom+CMake: Propagate dependencies for generated custom targets
We have logic for serenity_generated_sources which works well for source
files that are specified in GENERATED_SOURCES prior to calling
serenity_lib or serenity_bin. However, code generated with
invoke_generator, and the LibWeb generators do not always follow the
pattern of the IDL and GML files.

For the LibWeb generators, we can just add_dependencies to LibWeb at the
time we declare the generate_Foo custom target. However for LibLocale,
LibTimeZone, and LibUnicode, we don't have the name of the target
available, so export the name in a variable to set into
GENERATED_SOURCES.

To make this work for Lagom, we need to make sure that lagom_lib and
serenity_bin in Lagom/CMakeLists.txt call serenity_generated_sources on
the target.

This enables the Xcode generator on macOS hosts, at least for Lagom.
2022-10-17 15:55:55 +02:00
Linus Groh
b79b78a5cc LibJS: Sync the set of rounding modes
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/9613358
- https://github.com/tc39/proposal-temporal/commit/4c45464
2022-10-17 13:31:22 +02:00
Linus Groh
3d4ce3cc6d LibJS: Add missing validation to remaining Calendar operations
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/c2a0cea
2022-10-17 12:56:05 +02:00
Linus Groh
4567ded8e4 LibJS: Reject relativeTo string such as "2022-08-18T17:01Z"
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/2dc20bf
2022-10-17 12:56:05 +02:00
Linus Groh
57162ad510 LibJS: Rename IsValidTimeZoneName to IsAvailableTimeZoneName
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/873313b
2022-10-17 12:56:05 +02:00
Linus Groh
72997c6b77 LibJS: Define IsValidTimeZoneName in terms of AvailableTimeZones
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/d83dcf0

Note that even though we already implement AvailableTimeZones for Intl,
I kept the existing implementation calling into LibTimeZone directly.
2022-10-17 12:56:05 +02:00
cflip
05e7b338ad LibDesktop+Taskbar: Add 'WorkingDirectory' property to app files 2022-10-17 01:37:58 +02:00
cflip
953520df49 LibCore: Add argument to specify working directory in Process::spawn 2022-10-17 01:37:58 +02:00
Hendiadyoin1
490c097bc4 LibJS: Forward a string aproximation of the CallExpression to Call Ops
This gives us better debug output when analysing calls to `undefined`
and also fixes multiple test-js cases expecting an
`(evaluated from $Expression)` in the error message.

This also refactors out the generation of that string, to avoid code
duplication with the AST interpreter.
2022-10-17 01:36:41 +02:00
Liav A
db45e242c4 LibC: Do an explicit static_cast in the fgetc function
We assumed that by returning a char in the fgetc function that an
implicit cast is sufficient, but apparently if that char contains 0xff,
the result int will be -1 (0xFFFFFFFF). To ensure this does not happen,
let's do an explicit casting.
2022-10-17 01:08:22 +02:00
Andrew Kaster
2f439327ac LibThreading: Only set pthread name on Serenity
pthread_setname_np is a can of worms for portability. Linux, macOS,
and the BSDs all do it differently.

Also skip adding the tid as an inspectable Core::Object property on
systems where pthread_t is known to be a pointer.
2022-10-16 15:39:00 -06:00
Jelle Raaijmakers
0cf3cb6279 LibGL: Immediately dereference vertex attribute data in display lists
According to the spec, pointers to client data need to be dereferenced
immediately when adding calls such as `glDrawElements` or
`glArrayElement` to a display list. We were trying to support display
lists for these calls but since they only invoke _other_ calls that also
support display lists, we can simply defer the display list
functionality to them.

This fixes the rendering of the ClassiCube port by cflip.
2022-10-16 21:12:15 +02:00
Linus Groh
0ea4d228e6 LibWeb: Add missing body has_value() check in XMLHttpRequest::send() 2022-10-16 18:04:46 +02:00
Julian Offenhäuser
b14f0950a5 LibPDF: Add very basic support for Adobe Type 1 font rendering
Previously we would draw all text, no matter what font type, as
Liberation Serif, which results in things like ugly character spacing.

We now have partial support for drawing Type 1 glyphs, which are part of
a PostScript font program. We completely ignore hinting for now, which
results in ugly looking characters at low resolutions, but gain support
for a large number of typefaces, including most of the default fonts
used in TeX.
2022-10-16 17:44:54 +02:00
Julian Offenhäuser
e6f29302a7 LibPDF: Add glyph drawing and type info methods to PDFFont
A PDFFont can now be asked for its specific type and whether it is part
of the standard 14 fonts. It now also contains a method to draw a
glyph, which is stubbed-out for now.

This will be useful for the renderer to take into consideration when
drawing text, since we don't include replacements for the standard set
of fonts yet, but still want to make use of embedded fonts when
available.
2022-10-16 17:44:54 +02:00
Julian Offenhäuser
36f83cecab LibPDF: Allow page objects to inherit the MediaBox and Resources entries 2022-10-16 17:44:54 +02:00
Julian Offenhäuser
2f71e0f09a LibPDF: Allow text operator sequences to start with whitespace 2022-10-16 17:44:54 +02:00
Julian Offenhäuser
7ecd420b03 LibPDF: Parse floating point numbers that omit a leading zero correctly 2022-10-16 17:44:54 +02:00
Linus Groh
9e6475d76d LibJS: Add spec comments to RegExpObject
Also fix the evaluation order of ToString for pattern and flags while
we're here, and improve some of the variable names.
2022-10-16 17:32:02 +02:00
Linus Groh
eb5be649a5 LibJS: Add spec comments to RegExpConstructor 2022-10-16 17:32:02 +02:00
Linus Groh
1da66b5879 LibJS: Implement the RegExpAlloc AO 2022-10-16 17:32:02 +02:00
Andrew Kaster
1ae0cfd08b CMake+Userland: Use CMakeLists from Userland to build Lagom Libraries
Also do this for Shell.

This greatly simplifies the CMakeLists in Lagom, replacing many glob
patterns with a big list of libraries. There are still a few special
libraries that need some help to conform to the pattern, like LibELF and
LibWebView.

It also lets us remove essentially all of the Serenity or Lagom binary
directory detection logic from code generators, as now both projects
directories enter the generator logic from the same place.
2022-10-16 16:36:39 +02:00
Andrew Kaster
f7f92f104f Lagom+LibCore: Build LibCore, AK, and LibMain with add_subdirectory
By deferring to the CMakeLists in each of these libraries' directories,
we can get rid of a lot of curious GLOB patterns and list removals in
the Lagom CMakeLists.
2022-10-16 16:36:39 +02:00
Andrew Kaster
1ca48a2aec AK+Userland: Use a CMake variable for AK_SOURCES instead of GLOB
This lets us remove a glob pattern from LibC, the DynamicLoader, and,
later, Lagom. The Kernel already has its own separate list of AK files
that it wants, which is only a subset of all AK files.
2022-10-16 16:36:39 +02:00
Linus Groh
b6f101f1c0 LibJS: Fix TemporalCalendarString ambiguity
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/278d238
- https://github.com/tc39/proposal-temporal/commit/b73aea7
2022-10-16 15:20:23 +02:00
Linus Groh
484c66125d LibJS: Rename Get{IANA => Named}TimeZonePreviousTransition
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6b759d1
2022-10-16 14:45:09 +02:00
Linus Groh
8cc260107d LibJS: Rename Get{IANA => Named}TimeZoneNextTransition
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/4b0246a
2022-10-16 14:45:09 +02:00
Idan Horowitz
d795f9c6cf LibJS: Change dateAdd to a required parameter of MoveRelativeDate
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/45d9079
2022-10-16 13:45:56 +02:00
Idan Horowitz
3c55643283 LibJS: Add dateAdd to all remaining MoveRelativeDate calls
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/a48838a
2022-10-16 13:45:56 +02:00
Idan Horowitz
4e79ce4e7a LibJS: Add optional dateAdd parameter to MoveRelativeDate
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/891060f
2022-10-16 13:45:56 +02:00
Luke Wilde
35c9e324b4 LibJS: Add fast path TimeZone conversion to PlainDate#toZonedDateTime
This is a normative chane in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/fcab1af
2022-10-16 13:40:21 +02:00
Luke Wilde
707f12f927 LibJS: Remove extra property check from Instant#toZonedDateTimeISO
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7dfbd80
2022-10-16 13:40:21 +02:00
Luke Wilde
f7bb79d6d1 LibJS: Fast-path ToTemporalTimeZone when the argument is a TimeZone
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/54cea53
2022-10-16 13:40:21 +02:00
Luke Wilde
8c3512d6ce LibJS: Fast-path ToTemporalCalendar when the argument is a Calendar
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/2a43b39
2022-10-16 13:40:21 +02:00
Kenneth Myhra
f09e256328 LibWeb: Let LoadRequest::set_body() take by value
This changes the signature of LoadRequest::set_body() to take by value
and then use move semantics to move the contents of the ByteBuffer.

This is done to avoid the fallible copy constructor of ByteBuffer.
2022-10-16 02:06:29 +03:30
Kenneth Myhra
7831e62955 LibWeb: Add support for DOM::Document to XHR::send()
This patch adds support for posting a DOM::Document using XHR::send().
2022-10-16 02:06:29 +03:30
Kenneth Myhra
d5247ae33e LibWeb: Let lambdas return WebIDL::ExceptionOr in XHR::send()
Instead of ErrorOr let these lambdas return WebIdL::ExceptionOr. This
patch also cleans up this part so it's a bit more readable.
2022-10-16 02:06:29 +03:30
networkException
afeff4cebb LibJS+js: Disable console debug messages outside Serenity only for js
Previously we would disable console debug messages on all non Serenity
platforms as it caused double printing on lagom `js`. This patch limits
this to the `js` utility, allowing LibWeb to print debug messages
regardless of the operating system :^)
2022-10-16 02:06:02 +03:30
Timothy Flynn
094f9bf6a2 LibJS: Subtract time zone offsets when converting from local time to UTC
When converting to UTC, the UTC AO first tries to disambiguate possible
time zone offsets for the given local time. When doing so, the
GetNamedTimeZoneEpochNanoseconds AO must *subtract* the found time zone
offset from the local time to convert to UTC. The same is performed
later in the UTC AO when returning the final UTC time (step 5).
2022-10-15 22:55:48 +02:00
Tobias Christiansen
2c808958b9 LibWeb: Make Cookie::Cookie transportable over IPC 2022-10-15 22:28:34 +02:00
Timothy Flynn
443ffab9dc LibJS: Use infallible ParseTimeZoneOffsetString
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/654e300
2022-10-15 18:05:02 +02:00
Timothy Flynn
d992cba014 LibJS: Remove Temporal::DefaultTimeZone
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/e232580
2022-10-15 18:05:02 +02:00
Timothy Flynn
735e1c4e20 LibJS: Replace GetIANATimeZoneOffset[Ns] with GetNamedTimeZoneOffset[Ns]
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/e44d36b
2022-10-15 18:05:02 +02:00
Timothy Flynn
053cc90dbe LibJS: Replace GetIANATimeZoneEpochValue with GetNamedTimeZoneEpoch[Ns]
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/e834014
2022-10-15 18:05:02 +02:00
Timothy Flynn
1a84dbcb07 LibJS: Replace GetEpochFromISOParts with GetUTCEpochNanoseconds
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/1b051cc

Note that since Date's implementation of this AO uses Crypto bigints
rather than allocating JS bigints, this change has the fallout of
removing some unused VM parameters and adding an overload of the
IsValidEpochNanoseconds AO for use without a JS::BigInt.
2022-10-15 18:05:02 +02:00
Timothy Flynn
4fbec2e8b3 LibJS: Replace RoundTowardsZero with truncate
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/409ab66
2022-10-15 18:05:02 +02:00
Timothy Flynn
019211bcb4 LibJS: Consolidate sources of system time zone to one location in Date
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/43fd5f2

For the most part, these AOs are hoisted from Temporal.

Note that despite being a normative change, the expectation is that
this change does not result in any behavior differences.
2022-10-15 18:05:02 +02:00
Timothy Flynn
e952dca026 LibJS: Expose the StringToNumber AO for public use
This will be needed outside of Value.cpp.
2022-10-15 18:05:02 +02:00
martinfalisse
bd9ec60305 LibWeb: Implement minmax()
On the basis of the values passed to the minmax functions, do different
actions given different min and max grid track sizes.
2022-10-15 16:04:01 +02:00
martinfalisse
53f3df78e5 LibWeb: Implement auto-fill and auto-fit
Implement auto-fill and auto-fit for the grid, which allow for placing
as many columns as will fit within a given container size.
2022-10-15 16:04:01 +02:00
martinfalisse
4745a0c20a LibWeb: Implement more of the grid spec
This is a small change that implements more of the CSS Grid spec.
2022-10-15 16:04:01 +02:00
martinfalisse
e227e8027f LibWeb: Parse minmax() value
Parse the minmax() function when passed to the grid-template-columns or
grid-template-rows CSS property.
2022-10-15 16:04:01 +02:00
martinfalisse
a5f042b424 LibWeb: Parse auto-fill and auto-fit attributes
Parse auto-fill and auto-fit attributes for the CSS Grid.
2022-10-15 16:04:01 +02:00
martinfalisse
3cba4b6e41 LibWeb: Refactor parsing a GridTrackSize
This functionality was duplicated and this way it is more clean. It will
also be used when parsing minmax() values.
2022-10-15 16:04:01 +02:00
martinfalisse
202620e80c LibWeb: Refactor GridTrack maintenance in the GFC
Refactor the m_grid_columns and m_grid_rows to be maintained in the
class, which will make it easier to later create functions relating to
them.
2022-10-15 16:04:01 +02:00
martinfalisse
f7bd1edde3 LibWeb: Calculate the height of the css grid correctly
Enable the CSS grid height to be calculated correclly.
2022-10-15 16:04:01 +02:00
martinfalisse
b6a29ae9e2 LibWeb: Use w3 instead of drafts for spec
Add more specs to the CSS Grid class and update others so as to use
w3.org instead of the drafts website.
2022-10-15 16:04:01 +02:00
martinfalisse
f7af190de0 LibWeb: Add parent classes for managing GridTrackSizes
Add classes ExplicitTrackSizing and MetaGridTrackSize which will allow
for managing properties like auto-fill and minmax.

In the following CSS example there are 3 classes that will be used:
grid-template-column: repeat(auto-fill, minmax(50px, 1fr) 75px);

ExplicitTrackSizing - will contain the entire value. e.g.
repeat(auto-fill, minmax(50px, 1fr) 75px)

With a flag if it's a repeat, as well as references to the
MetaGridTrackSizes which is the next step down.

MetaGridTrackSize:
Contain the individual grid track sizes. Here there are two:
minmax(50px, 1fr) as well as 75px.

This way can keep track if it's a minmax function or not, and the
references to both GridTrackSizes in the case it is, or in just the one
if it is not.

GridTrackSize:
Is the most basic element, in this case there are three in total; two of
which are held by the first MetaGridTrackSize, and the third is held by
the second MetaGridTrackSize.
Examples: 50px, 1fr and 75px.
2022-10-15 16:04:01 +02:00
Andreas Kling
6d18164ab0 LibWeb: Apply min-width and max-width constraints to inline-block boxes 2022-10-15 14:10:30 +02:00
Andreas Kling
b289f97a65 LibWeb: Split intrinsic heights cache by definite available widths
As it turns out, we sometimes query the intrinsic height of a box before
having fully resolved and/or constrained its containing block. Because
of this, we may enter intrinsic sizing with different amounts of
available width for the same box.

To accommodate this scenario, we now allow caching of multiple intrinsic
heights, separated by the amount of available width provided as input.
2022-10-15 14:01:54 +02:00
Andreas Kling
869b322a8f LibWeb: Assign hypothetical flex item main sizes as temporary main size
This colors a bit outside the lines of the specification, but the spec
doesn't offer a proper explanation for how descendants of a flex item
are supposed to have access to the flex item's main size for purposes
of percentage resolution.

The approach I came up with here was to take the hypothetical main size
of each flex item, and assign it as a temporary main size. This allows
percentage resolution in descendants to work against the pre-flexing
main size of items. This seems to match how other engines behave,
although it feels somewhat dirty. If/when we learn more about this,
we can come up with something nicer.
2022-10-15 14:01:54 +02:00
Liav A
6bb738c1b3 Ports: Add dosfstools port 2022-10-15 13:16:24 +02:00
Linus Groh
acc1c2b3cb LibWeb/Fetch: Add "webidentity" destination for FedCM
This is a change in the Fetch spec.

See:
- https://github.com/whatwg/fetch/commit/30d462d
- https://github.com/whatwg/fetch/commit/7487a97
2022-10-15 12:15:31 +02:00
Linus Groh
5995a9fd06 LibWeb/Fetch: Add duplex property to Request
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/1fbc40c
2022-10-15 12:15:31 +02:00
Linus Groh
60e9790a40 LibWeb/Fetch: Add support for parsing a single range header value
This is a change in the Fetch spec.

See:
- https://github.com/whatwg/fetch/commit/2d080d7
- https://github.com/whatwg/fetch/commit/a18fb3e
2022-10-15 12:15:31 +02:00
snooze6214
1fde3737f4 LibJS: Move time zone annotation parsing into ParseISODateTime
This is an editorial change in the Temporal spec.

See: tc39/proposal-temporal@c410e25e47
2022-10-15 05:09:09 +00:00
Pavel
40aad77ab1 WebContent+LibWeb+LibJS: Report exceptions to the JS console
Print exceptions passed to `HTML::report_exception` in the JS console

Refactored `ExceptionReporter`: in order to report exception now
you need to pass the relevant realm in it. For passed `JS::Value`
we now create `JS::Error` object to print value as the error message.
2022-10-15 01:25:12 +02:00
leeight
2eb6dbd4f0 headless-browser: Add ca-certs-path options 2022-10-15 02:44:47 +03:30
Lucas CHOLLET
c837a1a8de LibAudio: Factorize stream initialisation to base class LoaderPlugin
All actual plugins follow the same logic to initialize their stream,
this commit factorizes all of this to their base class: `LoaderPlugin`.
2022-10-14 23:11:23 +02:00
Lucas CHOLLET
754b129f4a LibAudio: Allow the MP3 plugin to be constructed from a byte buffer 2022-10-14 23:11:23 +02:00
Lucas CHOLLET
bb17ee8397 LibAudio: Port the MP3 plugin to Core::Stream 2022-10-14 23:11:23 +02:00
Lucas CHOLLET
597a614ce6 LibAudio: Remove the last occurrence of Core::File in the Flac plugin
The design is deeply inspired from what is done in the Wav plugin.
2022-10-14 23:11:23 +02:00
Lucas CHOLLET
f028930033 LibAudio: Remove the last occurrence of Core::File in the Wav plugin 2022-10-14 23:11:23 +02:00
Lucas CHOLLET
2d6124049a LibAudio: Get rid of unused method Loader::file()
`aplay` and two files of `SoundPlayer` were relying on the include of
`LibCore/File.h` by `Loader.h`.
2022-10-14 23:11:23 +02:00
Andreas Kling
27a7c5ef40 LibWeb: Implement CSS fit-content algorithm precisely as spec says
We were using the available space in place of the stretch-fit size.
This was an oversight, and this patch fixes that. It's very possible
that this will uncover broken behavior elsewhere.
2022-10-14 19:53:52 +02:00
Andreas Kling
d7d8e3c78b LibWeb: Resolve *all* percentages in abspos height calculation
We were neglecting to resolve() percentages for many values.
2022-10-14 19:52:07 +02:00
Andreas Kling
834d98520a LibWeb: Implement basic support for align-content in flex layout
This property tells us how to lay out multi-line flex containers.
I implemented all modes except `space-between` and `space-around`.
Those are left as FIXMEs.
2022-10-14 19:50:15 +02:00
Andreas Kling
f8a2c0586a LibWeb: Parse the CSS align-content property 2022-10-14 19:50:15 +02:00
Andreas Kling
b062a0fb7c LibWeb: Make TextNode::ChunkIterator emit an empty chunk for content:""
This ensures that we create a line box for content:"", which would
otherwise get pruned by the empty line cleanup in IFC.

The empty line box is important in this case, since it gives us a
reference point for measuring the automatic height of the IFC's
containing block. By having an empty line, we can now correctly measure
the impact of vertical margins on a generated box with content:""
and allow them to contribute to the block height.
2022-10-14 19:50:15 +02:00
Andreas Kling
c70801ddbc LibWeb: Don't treat content: "" as collapsible whitespace
I couldn't find anything in specs about this, but it seems to be roughly
consistent with other engines.
2022-10-14 19:50:15 +02:00
Andreas Kling
4ddfc3a6db LibWeb: Mark content: "string" text nodes as generated
This will allow us to give them special treatment, particularly when
they are an empty string.
2022-10-14 19:50:15 +02:00
Andreas Kling
063d6cab8b LibWeb: Remove unused Layout::TextNode::ChunkIterator::m_layout_mode 2022-10-14 19:50:15 +02:00
Andreas Kling
42538b5375 LibWeb: Fix bogus inline-block check in line box layout
When checking if a line box fragment "isn't just dumb inline content",
we were checking "is replaced or inline-block". What we really need to
be checking is "is replaced or inline-outside-but-not-flow-inside".
So now we check that.

This fixes an issue where inline-flex boxes were given incorrect extra
height due to being treated as regular text for purposes of line height
calculation.
2022-10-14 19:50:14 +02:00
Andreas Kling
20711c76b7 LibWeb: Apply min/max constraints to sizes that are initially definite
Also add a comment explaining how we determine initial definite sizes.
2022-10-14 19:50:14 +02:00
Andreas Kling
7f6ba8b910 LibWeb: Clamp flex item's automatic cross sizes to min/max sizes
This takes care of an old FIXME.
2022-10-14 19:50:14 +02:00
Andreas Kling
13792e572c LibWeb: Mark percentage heights as initially definite when appropriate
Percentage heights are now considered definite when their containing
block has a definite height. This makes profile pictures have geometry
on Twitter. (We still don't load the images themselves though.)
2022-10-14 19:50:14 +02:00
Luke Wilde
d5d1146cc3 LibJS/Temporal: Fix inconsistency in order of observable operations
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/a3a8237
2022-10-14 18:55:12 +02:00
kleines Filmröllchen
e6ea49d10b LibAudio: Fix 24-bit PCM rescaling
This code was so totally wrong I can't even explain it.
2022-10-14 09:20:38 -06:00
kleines Filmröllchen
5f71c81e1b LibAudio: Correctly rescale 8-bit PCM samples
8-bit PCM samples are unsigned, at least in WAV, so after rescaling them
to the correct range we also need to center them around 0. This fix
should make 8-bit WAVs have the correct volume of double of what it was
before, and also future-proof for all other unsigned PCM sample formats
we may encounter.
2022-10-14 09:20:38 -06:00
Timothy Flynn
1524288127 LibSQL: Rewrite the SQL::Value type to be contained within one class
Currently, the Value class is essentially a "pImpl" wrapper around the
ValueImpl hierarchy of classes. This is a bit difficult to follow and
reason about, as methods jump between the Value class and its impl
classes.

This changes the Variant held by Value to instead store the specified
types (String, int, etc.) directly. In doing so, the ValueImpl classes
are removed, and all methods are now just concise Variant visitors.

As part of this rewrite, support for the "array" type is dropped (or
rather, just not re-implemented) as it was unused. If it's needed in the
future, support can be re-added.

This does retain the ability for non-NULL types to store NULL values
(i.e. an empty Optional). I tried dropping this support as well, but it
is depended upon by the on-disk storage classes in non-trivial ways.
2022-10-14 17:47:44 +03:30
Timothy Flynn
7d41b46a7d LibSQL: Remove infallible type conversions from SQL::Value
Force the callers to either know that the type is convertible, or to
handle the conversion failure.
2022-10-14 17:47:44 +03:30
Timothy Flynn
af3980384b LibSQL: Return StringView from enum-to-string converters
No need to allocate here. Also mark these methods as constexpr rather
than inline static.
2022-10-14 17:47:44 +03:30
Timothy Flynn
c0b54f18b5 LibSQL: Copy SQL::Value instances less frequently (which may be vectors) 2022-10-14 17:47:44 +03:30
Timothy Flynn
5f549fe5d9 LibSQL: Add missing header includes
These are explicitly needed, and will cause compile errors as headers
moved around in subsequent commits.
2022-10-14 17:47:44 +03:30
leeight
2029c98fa7 LibWeb: Add missing property and methods for history object
We provide `length` property and `go` / `back` / `forward` methods
implementation here.
2022-10-14 16:01:35 +02:00
kleines Filmröllchen
cb0b82ec46 Userland+LibCore: Remove legacy SERENITY_VERSION from Core::Version
This was being used as a default version argument in a couple of APIs,
so those need to change signature and the caller always needs to provide
a version.
2022-10-14 13:45:33 +02:00
kleines Filmröllchen
38bb189772 LibCore: Read version information from uname() instead of /res/version 2022-10-14 13:45:33 +02:00
Timothy Slater
eec881ea34 LibGfx: Implement flood fill algorithm in Bitmap class
This change implements a flood fill algorithm for the Bitmap class. This
will be leveraged by various Tools in PixelPaint. Moving the code into
Bitmap reduces the duplication of the algorithm throughout the
PixelPaint Tools (currently Bucket Tool and Wand Select).

The flood fill function requires you to pass in a threshold value (0 -
100) as well as a lambda for what to do when a pixel gets reached. The
lambda is provided an IntPoint representing the coordinates of the pixel
that was just reached.

The genericized lambda approach allows for a variety of things to be
done as the flood algorithm progresses. For example, the Bucket Tool
will paint each pixel that gets reached with the fill_color. The Wand
Select tool wont actually alter the bitmap itself, instead it uses the
reached pixels to alter a selection mask.
2022-10-14 13:39:33 +02:00
demostanis
6880359064 LibVT: Make Terminal::clear_in_line() keep line attributes 2022-10-14 13:37:29 +02:00
demostanis
09a2db89c9 LibC: Add ffs{,l,ll}
Those are wrappers around AK::bit_scan_forward().
2022-10-14 13:37:29 +02:00
Gunnar Beutner
70f4d943be Kernel+LibC: Add registers for AARCH64 in __mcontext 2022-10-14 13:01:13 +02:00
Gunnar Beutner
a7a71be113 LibC: Fix some compiler errors
__x86_64__ isn't defined at all on AARCH64.
2022-10-14 13:01:13 +02:00
Gunnar Beutner
808c43312d Tests+Userland: Implement AARCH64 support for some inline assembly blobs 2022-10-14 13:01:13 +02:00
Gunnar Beutner
dadf656dc9 Tests+Userland: Prefer using __builtin_trap() instead of UD2
This way we don't have to hard-code per-architecture instructions.
2022-10-14 13:01:13 +02:00
Gunnar Beutner
a650c74b27 AK+Toolchain: Make char and wchar_t behave on AARCH64
By default char and wchar_t are unsigned on AARCH64. This fixes a
bunch of related compiler errors.
2022-10-14 13:01:13 +02:00
Gunnar Beutner
31bd5b1a02 AK+Userland: Stub out code that isn't currently implemented on AARCH64
Even though this almost certainly wouldn't run properly even if we had
a working kernel for AARCH64 this at least lets us build all the
userland binaries.
2022-10-14 13:01:13 +02:00
Lucas CHOLLET
3197c1793a Base: Launch Clipboard at session start-up
The clipboard service hasn't been ported to user-based portals with
others services as it is needed at `GUI::Application` creation and thus
before the first login, as the `LoginServer` needs one.

This problem as been solved thanks to session-based portals, a clipboard
portal is now created at boot for the "login" session and another for
each "user" session.

With a user-based portal, the "login" portal would have needed to be
created for the `root` user, exposing us to security issues. It now, can
be owned by the `window` user.
2022-10-14 11:37:11 +02:00
davidot
1be337353b LibJS: Make sure to exactly add nanoseconds in add_duration
If the given nanoseconds values add to something above 2**53 - 1 we are
potentially rounding the double to some near integer value.
2022-10-14 11:23:50 +02:00
davidot
1b0ca52c54 LibJS: Disallow one day long time zone offsets
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/9cc8b29b
2022-10-14 11:23:50 +02:00
leeight
1167fdb17a LibWeb: Make LoadRequest headers case insensitive 2022-10-14 11:23:36 +02:00
ne0ndrag0n
7fc22896ee LibDesktop: Add support for RequiresRoot option to AppFile 2022-10-14 11:23:06 +02:00
Simon Rask
650d2fdc2d LibJS: Add spec comments to String.prototype.at 2022-10-13 21:14:32 +02:00
Simon Rask
8701832095 LibJS: Add spec comments to String.prototype.substring 2022-10-13 21:14:32 +02:00
Luke Wilde
bf2debdf53 LibWeb: Make navigator.languages an attribute instead of a function 2022-10-13 14:42:14 +02:00
demostanis
63a18aa89e LibGUI+WindowServer: Add Window::set_always_on_top() 2022-10-13 12:37:54 +01:00
Andrew Kaster
290d3449e0 LibVideo: Hide debug message behind MATROSKA_DEBUG
This clutters fuzzer output if enabled.
2022-10-13 11:25:03 +02:00
Andrew Kaster
bf014c4d20 LibVideo: Check parsed superframe sizes when decoding VP9 frames
Make sure that the next parsed superframe size will not overflow the
chunk data before splitting it out to decode a frame.
2022-10-13 11:25:03 +02:00
Andrew Kaster
9d3074f72f LibVideo: Always check byte length before reading first byte in Streamer
The check was missing at the front of
MatroskaReader::Streamer::read_variable_size_integer, causing assertions
on malformed input streams.
2022-10-13 11:25:03 +02:00
MacDue
4507920187 LibWeb: Fix position: fixed canvases/images disappearing when scrolling
This fixes the Serenity logo vanishing after scrolling on the 4th
birthday post.

The previous check did not account for any translation in the painter.
This now uses the painter's clip rect and translation to work out
if a rect is visible. It also makes use of `absolute_paint_rect()`
rather than `absolute_rect()` which can account for things like
box-shadows.
2022-10-13 11:16:27 +02:00
Linus Groh
a982e0380e LibWeb: Implement navigator.webdriver
This is defined via the NavigatorAutomationInformation interface mixin
from the WebDriver spec: https://w3c.github.io/webdriver/#interface
2022-10-13 11:14:45 +02:00
Linus Groh
68006f3e16 LibWeb: Update Navigator.idl to use 4 spaces for indentation 2022-10-13 11:14:45 +02:00
Linus Groh
3f24a444f9 LibWeb+WebContent: Add plumbing for 'webdriver-active flag' 2022-10-13 11:14:45 +02:00
Florent Castelli
ec9c11667f LibC+LibCore: Fix file argument name in posix_spawnp
posix_spawnp takes a file, which is subject to PATH search,
while posix_spawn takes a path.
2022-10-12 23:07:42 +02:00
davidot
d9360676cd LibCore: Add standard_{output, input, error} functions to File::Stream 2022-10-12 12:00:21 -06:00
davidot
e0cccaa583 LibCore: Add option to Stream::File to not close the file on destruction 2022-10-12 12:00:21 -06:00
huttongrabiel
6926991a56 LibGUI: Delete from current position to end of line in VimEditingEngine
When in normal mode pressing Shift+D will delete from the current cursor
position to the end of the line. Leaving the cursor on the character
before where the cursor was when the deletion took place.
2022-10-12 09:46:18 -06:00
Ali Mohammad Pur
166a905951 Userland: Properly populate GENERATED_SOURCES
We previously put the generated headers in SOURCES, which did not mark
them as GENERATED (and did not produce a proper dependency).
This commit moves all generated headers into GENERATED_SOURCES, and
removes useless header SOURCES.
2022-10-12 15:55:15 +01:00
Timon Kruiper
8373a14835 LibWeb: Remove code duplication in computing height for abs-pos elements
This refactors the solve_for_{top, bottom, height, etc} lambdas to use a
common solve_for lambda that takes the length to be solved as an
argument. This way some code duplication is removed.
2022-10-12 11:08:29 +02:00
Samuel Bowman
ca0a0b7a93 LibWeb: Add missing else's in absolutely positioned height computation
Rules 1, 2, and 3 use else if, so rules 4, 5, and 6 should too.
2022-10-12 10:32:57 +02:00
Jan200101
743f46030c LibC: Declare _setjmp and _longjmp on non i386 platforms
These aliases were previously only implemented for i386 and are required
for certain Ports e.g. Lua.
2022-10-12 02:07:27 -06:00
Zaggy1024
41cb705b47 LibVideo: Allow the VP9 decoder to decode ultra high resolution video
Previously, some integer overflows and truncations were causing parsing
errors for 4K videos, with those fixed it can fully decode 8K video.

This adds a test to ensure that 4K video will continue to be decoded.

Note: There seems to be unexpectedly high memory usage while decoding
them, causing 8K video to require more than a gigabyte of RAM. (!!!)
2022-10-12 00:54:31 -06:00
Tommy Murphy
0ee98c69c1 LibCompress: Brotli support metadata of skip_length=0
The relevant RFC section from
https://www.rfc-editor.org/rfc/rfc7932#section-9.2

MSKIPBYTES * 8 bits: MSKIPLEN - 1, where MSKIPLEN is
       the number of metadata bytes; this field is
       only present if MSKIPBYTES is positive;
       otherwise, MSKIPLEN is 0 (if MSKIPBYTES is
       greater than 1, and the last byte is all
       zeros, then the stream should be rejected as
       invalid)

So when skip_bytes is zero we need to break and
re-align bytes.

Added the relevant test case that demonstrates this from:
https://github.com/google/brotli/blob/master/tests/testdata/x.compressed
2022-10-11 22:49:33 -06:00
Andreas Kling
e6de382679 LibWeb: Constrain abspos element heights by min-height and max-height 2022-10-11 22:31:51 +02:00
Andreas Kling
0e295f727a LibWeb: Fix dumb typos in solver helpers for abspos height 2022-10-11 22:23:13 +02:00
Sam Atkins
f754f45680 LibHTTP: Include request body in HttpRequest::from_raw_request() 2022-10-11 21:52:13 +02:00
Sam Atkins
f06a7f40bf LibProtocol: Remove redundant return statement 2022-10-11 21:52:13 +02:00
Sam Atkins
9b891a423b LibHTTP: Make HTTP method names more accessible
Previously you could only get the name of an HttpRequest::Method if you
already had an HttpRequest.
2022-10-11 21:52:13 +02:00