Commit graph

34596 commits

Author SHA1 Message Date
Andreas Kling 4b900bc100 AK: Add fast path in String::trim() and String::trim_whitespace()
If the trimmed string would be the entire string, just return *this
instead of creating a new StringImpl.
2022-02-19 14:45:59 +01:00
Andreas Kling 25504f6a1b LibWeb: Use Vector::clear_with_capacity() in HTMLTokenizer
This avoids constantly reallocating the Vector<HTMLToken>.
2022-02-19 14:45:59 +01:00
Andreas Kling 2dd3b54827 AK: Make CaseInsensitiveStringTraits allocation-free
Instead of calling String::to_lowercase(), do case-insensitive hashing
and comparison.
2022-02-19 14:45:59 +01:00
Andreas Kling 1b6ed558bb LibWeb: Move QualifiedName into the Web::DOM namespace 2022-02-19 14:45:59 +01:00
Andreas Kling cdd1a9f128 LibWeb: Move QualifiedName.h into LibWeb/DOM/ 2022-02-19 14:45:59 +01:00
Andreas Kling a97586c24a LibWeb: Shrink DOM::EventTarget by 80 bytes
Do this by converting two Function members into virtual functions:
- legacy_pre_activation_behavior
- legacy_cancelled_activation_behavior
2022-02-19 14:45:59 +01:00
Andreas Kling bfe69e9d0d LibWeb: Cache and reuse some very common StyleValue objects
Length values: auto, 0px, 1px
Color values: black, white, transparent
2022-02-19 14:45:59 +01:00
Andreas Kling 141b01d3e3 LibWeb: Turn StyleProperties::m_property_values into an Array
After style computation, every StyleProperties has a value for every
PropertyID. Given this, it's simpler, faster and less memory-heavy to
use an Array instead of a HashMap. :^)
2022-02-19 14:45:59 +01:00
Linus Groh eca8208a34 Kernel: Increase i8042 IO attempt counts, again
This is very similar to the change that was done in 32053e8, except it
turned out that the new limit of 50 iterations was not enough when
testing on bare metal - most IO operations would succeed in the first or
second iteration, but two of them took 140 and 150 iterations
respectively.
Increase the limit from 50 to 250 to account for this, and have some
additional headroom.
2022-02-19 13:37:51 +00:00
Linus Groh 37a04b739a Kernel: Only do i8042 existence check via probing as a fallback
This caused an initialization failure of the i8042 when I tested on
bare metal. We cannot entirely get rid of this method as QEMU for
example doesn't indicate the existence of an i8042 via ACPI, but we can
get away with only doing the manual probing if ACPI is disabled or we
didn't get a 'yes' from it.
Increasing the number of maximum loops did eventually lead to a
successful return from the function, but would later fail the actual
self test.
2022-02-19 13:37:51 +00:00
Daniel Bertalan ee9125fa9a Meta: Use correct variable for checking if the mold linker is used
This variable was originally called USE_MOLD_LINKER, but it was changed
to ENABLE_MOLD_LINKER during review to be consistent with other
configuration options. I branched off the commits that added RELR
support before this change, and I failed to update the variable name
there.
2022-02-19 14:21:52 +02:00
Maciej c375182be6 Base: Add some Supplemental Arrows C to KaticaRegular/Bold 10
They are used by fonts.serenityos.net title :^)

Codepoints added: U+1F800-U+1F80B, U+1F810-U+1F813

PDF: https://www.unicode.org/charts/PDF/U1F800.pdf
2022-02-19 13:27:42 +02:00
Gunnar Beutner 6b9913f010 Meta: Explicitly set number of available inodes for genext2fs
According to its manpage genext2fs tries to create the file system with
as few inodes as possible. This causes SerenityOS to fail at boot time
when creating temporary files.
2022-02-19 13:13:22 +02:00
Gunnar Beutner 7a65bd8efb AK: Don't use x86 assembly when building for non-x86 targets
This allows Lagom to be built successfully for Apple M1.

Fixes #12644.
2022-02-19 13:13:22 +02:00
Vrins 12d75b10f3 LibWeb: Inspector content_size tooltip in document view
This adds a small tooltip in the browser showing the size of the
element that currently selected in the inspector view. This allows
for easier debugging since you dont have to dump the layout tree :^).
2022-02-19 11:39:41 +01:00
Debdut Chakraborty 7527b52efc Documentation: Add Userland/ to qtcreator include path 2022-02-19 11:39:08 +01:00
Maciej 3e1c1c0b16 LibWeb: Add support for CSS image-rendering property
Currently only "auto" and "pixelated" values are supported.
2022-02-19 11:38:46 +01:00
Itamar 246b42b635 LibGUI: Guard against use-after-free in Clipboard::the()
We now make sure that a VERIFY will fail if Clipboard::the() is called
after the destruction of its static-local variables.
2022-02-19 11:38:29 +01:00
Itamar 4d2357f8f3 HackStudio: Don't store a global RefPtr to the HackStudioWidget
Previously, we stored a RefPtr to the HackStudioWidget in the
global scope.

This led to a destruction-order related use-after-free bug, where the
global HackStudioWidget instance destructed after the static-local
GUI::Clipboard instance.
When HackStudioWidget destructs it attempts to use the global Clipboard
instance, which had already been freed.

This caused the Hack Studio process to spin endlessly on exit because
it attempted to access the HashTable of the freed Clipboard object.

We now store a global WeakPtr to the HackStudioWidget instead, and
limit the lifetime of the object to the main function scope.
2022-02-19 11:38:29 +01:00
Jakub Berkop 895a050e04 Kernel: Fixed argument passing for profiling_enable syscall
Arguments larger than 32bit need to be passed as a pointer on a 32bit
architectures. sys$profiling_enable has u64 event_mask argument,
which means that it needs to be passed as an pointer. Previously upper
32bits were filled by garbage.
2022-02-19 11:37:02 +01:00
Daniel Bertalan 0f2e18403c Meta: Make serenity.sh gdb work with the Clang toolchain
We now pass along the toolchain type to all subcommands. This ensures
that gdb will load the correct debug information for kernels compiled
with Clang, and the following warning won't appear with the GNU
toolchain:

> WARNING: unknown toolchain 'gdb'. Defaulting to GNU.
>         Valid values are 'Clang', 'GNU' (default)
2022-02-19 11:36:08 +01:00
Simon Danner 0787571192 Filemanager: Only enable rename if available 2022-02-19 11:35:53 +01:00
kperdlich ad722a9f06 Shell: Use an opaque default color for BarewordLiteral
Use an opaque default color for BarewordLiteral in
Syntax Highlighter to avoid transparent barewords.
2022-02-19 11:33:28 +01:00
Adam Plumb 34825ad3d1 LibWeb: Return current document URL if form action missing or empty 2022-02-19 11:31:53 +01:00
Kenneth Myhra 4877e7593c LibWeb: Refresh text-<input> contents when pressing backspace or delete
Make sure to refresh the contents of text-<input> when pressing
backspace or delete key.

The methods 'handle_insert()' and 'handle_delete()' already had the call
to 'm_browsing_context.active_document()->force_layout()' so let us also
add it to 'handle_delete_character_after()'.
2022-02-19 11:28:59 +01:00
Idan Horowitz e2d797dd60 gml-format: Exit with non-0 exit code when the file formatting changes
This let's CI detect when the changes include incorrect GML formatting.
We now also print a message to make it obvious why CI failed.
2022-02-19 02:15:44 +02:00
James Puleo 9f85b4ff7b Core: Remove non-existent classes from Forward.h 2022-02-18 23:31:28 +00:00
Anonymous a97b5393d0 LibJS: Ensure we only call toString on computed properties once 2022-02-18 22:33:59 +00:00
Anonymous c45922c637 LibJS: Unify exponentiation logic for ** operator and Math.pow
The JS behaviour of exponentiation on two number typed values is
not a simple matter of forwarding to ::pow(double, double). So,
this factors out the Math.pow logic to allow it to be shared with
Value::exp.
2022-02-18 22:31:36 +00:00
Lenny Maiorani c0735b047e LibArchive: Use designated initializers
Benefits:
- Braced-initialization prevents unknown narrowing conversions.
- Using designated initializers will result in a compiler error when a
  member is skipped or forgotten.
2022-02-18 23:54:14 +02:00
Lenny Maiorani 484c0edafc LibArchive: Refactor zip header handling
The directory headers have some common code for reading.
2022-02-18 23:54:14 +02:00
u9g 1511e9a5a9 Spreadsheets: Add range functions to the Position class
Adds functions to get range of non-empty cells in a direction.
2022-02-18 23:26:45 +03:30
Linus Groh 3e2dd5455b LibWeb: Use more relevant WebSocket spec links
Having almost everything point to "3. The WebSocket interface" is kind
of pointless.
2022-02-18 19:34:08 +00:00
Linus Groh fb1dca2c4b LibWeb: Move WebSocket into the Web::WebSockets namespace
WebSockets got moved from the HTML standard to their own, the new
WebSockets Standard (https://websockets.spec.whatwg.org).

Move the IDL file and implementation into a new WebSockets directory and
C++ namespace accordingly.
2022-02-18 19:34:08 +00:00
Andreas Kling c001e3f2fd BrowserSettings: Run gml-format on ContentFilterSettingsWidget.gml 2022-02-18 19:21:12 +01:00
Andreas Kling c04c2df0f7 LibWeb: Add missing is_length() check in FFC::is_cross_auto()
We can't access LengthPercentage::length() before verifying that it's
indeed a length.
2022-02-18 19:19:56 +01:00
Sam Atkins f0a4b33a5e LibWeb: Resolve Lengths to pixels earlier 2022-02-18 19:04:37 +01:00
Sam Atkins 356d8bcfe8 LibWeb: Remove Length::Type::Undefined! :^) 2022-02-18 19:04:37 +01:00
Sam Atkins b715943035 LibWeb: Remove redundant Length::resolved() calls
Now that calc() is also resolved in to_px(), code in the form
`foo.resolved(bar).to_px(bar)` can be simplified to `foo.to_px(bar)`.
2022-02-18 19:04:37 +01:00
Sam Atkins 6df3f9920d LibWeb: Calculate calc() lengths in to_px()
to_px() has the layout node available, so let's use it.
2022-02-18 19:04:37 +01:00
Sam Atkins 67066c5140 LibWeb: Remove fallback value from Length::resolved()
Nobody makes undefined Lengths now, (although actually removing
Undefined will come in a later commit) so we can remove this parameter,
and `resolved_or_auto()`/`resolved_or_zero()`.
2022-02-18 19:04:37 +01:00
Sam Atkins 5b2482a939 LibWeb: Use Optional instead of undefined-lengths for widths/heights 2022-02-18 19:04:37 +01:00
Sam Atkins 699b48ccc8 LibWeb: VERIFY when getting a length from an invalid StyleValue 2022-02-18 19:04:37 +01:00
Sam Atkins 2df8d9c609 LibWeb: Initialize BoxShadowData lengths to 0px instead of undefined 2022-02-18 19:04:37 +01:00
Sam Atkins 1093d6e2c3 LibWeb: Use a Variant for calc() percentage_basis
Depending on the type of the calc() expression, the percentage_basis has
to be the same dimension type. Several places were already passing `
{}` for this, so let's make that an empty Variant instead of an
undefined Length. :^)
2022-02-18 19:04:37 +01:00
Maciej 8aa1c7f5b0 Browser: Add option to open BrowserSettings from Browser :^) 2022-02-18 19:00:42 +01:00
Maciej 1606f70f0c BrowserSettings: Implement GUI for setting up content filters :^) 2022-02-18 19:00:42 +01:00
Maciej 4d1c28a23f Browser: Add support for disabling content filtering
Just for completeness.
2022-02-18 19:00:42 +01:00
Maciej 43e463748d Browser: Implement listener for most config options
The only option leaved as TODO is ColorScheme.
2022-02-18 19:00:42 +01:00
Maciej d3fc3337ef Browser: Call url_from_user_input for home URL
This allows omitting HTTP scheme in home URLs.
2022-02-18 19:00:42 +01:00