Commit graph

28442 commits

Author SHA1 Message Date
Sam Atkins
1ae515c0b7 LibWeb: Replace FlexFlowStyleValue with ShorthandStyleValue 2023-09-20 12:17:16 +01:00
Sam Atkins
aa45b3dfe3 LibWeb: Replace FlexStyleValue with ShorthandStyleValue
We still need the custom parsing and to_string() logic, but nothing
else. :^)
2023-09-20 12:17:16 +01:00
Sam Atkins
a72788b889 LibWeb: Return after expanding ShorthandStyleValues
We don't want to carry on doing things after we've handled these.
2023-09-20 12:17:16 +01:00
Sam Atkins
d20254f1bc LibWeb: Rename CompositeStyleValue -> ShorthandStyleValue
It's a shorthand, so let's call it that. :^)
2023-09-20 12:17:16 +01:00
Aliaksandr Kalenik
4ff4ac11b9 LibJS: Remove alreadyDeclared check in FunctionDeclarationInstantiation
We don't need to check if a function parameter is already declared
while creating bindings for them because we deduplicate their names by
storing them in a hash table in one of the previous steps.

This change makes React-Redux-TodoMVC test in Speedometer run 2%
faster.
2023-09-19 16:58:25 +02:00
Shannon Booth
b603e860af LibWeb: Port CharacterData from DeprecatedString to String
The existing implementation has some pre-existing issues where it is
incorrectly assumes that byte offsets are given through the IDL instead
of UTF-16 code units. While making these changes, leave some FIXMEs for
that.
2023-09-19 10:54:07 +02:00
Shannon Booth
3b12a13f17 LibWeb: Add String variants of functions in ChildNode
This is required in porting over CharacterData from DeprecatedString to
String.

Unfortunately, as with ParentNode, we cannot yet remove the
DeprecatedString variants of these functions as the Element interface
includes ChildNode and has not yet been ported over from
DeprecatedString.
2023-09-19 10:54:07 +02:00
MacDue
909bcfe9a4 LibWeb: Resolve and paint simple SVG masks
This allows applying SVG <mask>s to elements. It is only implemented for
the simplest (and default) case:

	- mask-type = luminance
 	- maskContentUnits = maskContentUnits
 	- maskUnits = objectBoundingBox
	- Default masking area

It should be possible to extend to cover more cases. Though the layout
for maskContentUnits = objectBoundingBox will be tricky to figure out.
2023-09-19 10:46:05 +02:00
MacDue
650180811e LibWeb: Flesh out SVGMaskElement a bit
- Add method to resolve the masking area (based on the target element
  size)
- Parse the maskUnits and maskContentUnits attributes
2023-09-19 10:46:05 +02:00
MacDue
0af8d81f48 LibWeb: Layout SVG <mask> elements (but don't paint them)
This allows SVG mask elements to have layout computed, but not connected
to the main paint tree. They should only be reachable if (and painted)
if referenced by the "mask" attribute of another element.

This is controlled by the forms_unconnected_subtree() function on the
paintable, which (if it returns true) prevents the paintable from being
added as a child to what would be its parent.
2023-09-19 10:46:05 +02:00
MacDue
c5b50ec2f4 LibWeb: Create paintables for nodes whose parents don't have paintables
A Paintable is not created for an SVG <defs> element (nor should it),
but it can contain SVG <mask> elements that need a paintable.

This change forces those paintables to be created (without a parent).
The masks are then only painted by being referenced from another
element.
2023-09-19 10:46:05 +02:00
MacDue
b340a85523 LibWeb: Make StackingContext functions static where possible
These don't need to be member functions, and this will make it easier
to use these to paint <mask> elements (into an off-screen mask bitmap).
2023-09-19 10:46:05 +02:00
MacDue
dc58b5f418 LibWeb: Add CSS mask property and make it form a stacking context 2023-09-19 10:46:05 +02:00
MacDue
b69e8ee893 LibGfx: Add Gfx::Bitmap::apply_mask()
This allows applying an alpha or luminance mask to a bitmap (of the same
size) inplace.
2023-09-19 10:46:05 +02:00
Kemal Zebari
93e230ba58 LibWeb/URL: Use the correct spec URL comment for URL::port()
Since in the previous snapshot we were using the hostname setter's
spec URL.
2023-09-19 08:18:45 +02:00
Andreas Kling
9ccf25fdbe LibJS: Avoid StringView->DeprecatedFlyString conversions in FDI 2023-09-19 07:17:27 +02:00
Andreas Kling
e32a597d78 LibJS: Fix VariableNameToInitialize name spelling 2023-09-19 07:11:17 +02:00
Andreas Kling
e03f43e1b5 LibJS: Remove unused HashTable in function_declaration_instantiation() 2023-09-19 07:06:50 +02:00
Aliaksandr Kalenik
edd2f8b37f LibJS: Run reusable steps of FunctionDeclarationInstantiation only once
This change moves steps that can be executed only once and then reused
in subsequent function instantiations from
`function_declaration_instantiation` to the ECMAScriptFunctionObject:
- Determine if there are any parameters with duplicate names.
- Determine if there are any parameters with expressions.
- Determine if an arguments object needs to be created.
- Create a list of distinct function names for which bindings need to
  be created.
- Create a list of distinct variable names for which bindings need to
  be created.

This change makes React-Redux-TodoMVC test in Speedometer
run 10% faster :)
2023-09-19 06:54:10 +02:00
Bastiaan van der Plaat
aed25991e6 Maps: Add MapsSettings with multiple tile providers options 2023-09-18 12:46:41 -06:00
Bastiaan van der Plaat
264782557e Maps: Fix bug when opening attribution url by adding launch unveil 2023-09-18 12:46:41 -06:00
Tim Ledbetter
9cd3477763 GameOfLife: Replace DeprecatedString with String 2023-09-18 11:12:25 -06:00
Bastiaan van der Plaat
e3cd789ea8 Maps: Add context menu to the map widget 2023-09-18 11:12:04 -06:00
Bastiaan van der Plaat
9939b028c6 LibWeb: Add basic Navigator send beacon support 2023-09-18 11:08:26 -06:00
Hendiadyoin1
d262670729 LibWeb: Use more CSSPixelFractions in GFC::expand_flexible_tracks
Also contains a drive-by expression simplification, and accidental
double truncation fix.
2023-09-18 18:02:51 +02:00
Tim Ledbetter
9b30dea889 LibGUI: Remove Action::try_create_checkable() 2023-09-18 18:00:45 +02:00
Tim Ledbetter
f570a0f0b8 LibGUI: Remove ItemListModel::try_create() 2023-09-18 18:00:45 +02:00
Tim Ledbetter
a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +02:00
Aliaksandr Kalenik
a4a94de942 LibJS: Get initial_value from local variables if id represents a local
If identifier represents local variable we should get its value from
`local_variables` in `ExecutionContext` instead of environment.
2023-09-18 17:57:56 +02:00
Andreas Kling
675d919dd2 LibWeb: Handle custom ident values for the CSS font-family property
We were parsing these all right, but ignoring them in StyleComputer.

No test unfortunately, since we don't currently have a way to delay
the load event until a @font-face has been fully loaded. (Any test
of this right now would be flaky.)
2023-09-18 16:34:01 +02:00
Andreas Kling
1f69e9cddf LibWeb: Remove Layout::Node::m_visible and compute it on the fly
This fixes an issue where the value would be out of sync with reality
in anonymous wrapper block boxes, since we forgot to compute m_visible
after assigning the computed values to them.

Fixes #21106
2023-09-18 14:45:20 +02:00
Andreas Kling
0a133ccba4 LibWeb: Remove the HTML blink element
Support for this element has been removed from all major engines years
ago already, and it's currently the only reason we have a weird
"visible" flag on Layout::Node (which we toggle on a timer here..)
2023-09-18 14:45:20 +02:00
Daniel Bertalan
1f747b9132 CMake: Use CMAKE_POSITION_INDEPENDENT_CODE instead of explicit -fpic
This makes CMake pass `-fpie` instead of `-fpic` to the compiler when
building the Kernel and userland *executables*. This allows the compiler
to make certain optimizations based on the fact that the code will be
used in an executable, such as not having to emit `.localalias` symbols.
This leads to a 450 KiB decrease in the size of the Kernel binary.
2023-09-18 10:26:42 +02:00
Andrew Kaster
78c2fad89c LibTimeZone: Include generated files before checked-in files
This is a rickety solution to a problem when using LibTimeZone as a
static archive, like we do for Android. When pulling symbols from an
archive into a shared library, lld will pick the weak symbols for our
timezone helpers and keep them. Even if there's a strong symbol in
another object file in the same archive, it ignores them. However,
if we make sure that the strong symbols for the generated files are
first in the list, then we avoid the problem altogether by relying
on linker specifics.
2023-09-17 19:22:29 -06:00
Andrew Kaster
091a0e0b78 LibWeb: Report Android 10 as OS_STRING in user agent on Android
Some websites, such as m.youtube.com, sniff for a version after the
Android OS version. Chrome has recently taken to always reporting
Android 10, so let's follow suit.
2023-09-17 19:22:29 -06:00
Cubic Love
2767fa78f8 Solitaire: Rearrange Help Menu
Rearrange the Help menu actions so they're in the same order as other
application's Help menus.
2023-09-17 17:26:32 -06:00
Tim Ledbetter
784ac6b9f2 less: Allow quitting with uppercase 'Q' 2023-09-17 17:10:50 -06:00
Tim Ledbetter
c9e4a82c04 WebServer: Return 403 for a GET request to an inaccessible path
Previously, trying to access a non-readable file would cause a
connection reset in the browser; trying to access a non-executable
directory would show a completely empty directory listing.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
b2f0c50376 WebServer: Don't display file on directory listing if stat call fails
Previously, the program would crash when attempting to display a symlink
which pointed outside of the permitted directory.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
1dd0791c7e WebServer: Use human-readable sizes on directory listing
A size is no longer displayed for directories; previously, a size of
4096 was always shown.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
cbf39dfddd LibWeb: Use human-readable sizes on directory listing
A size is also no longer displayed for directories.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
19dfdeeaec GameOfLife: Add a tick counter to the status bar
The counter is incremented after each new generation and reset
whenever any cell on the board is toggled. Resizing the board
does not reset the tick count.
2023-09-17 16:51:58 -06:00
Bastiaan van der Plaat
7e9ea964a8 LibWeb: Use TRY in DOMMatrix and DOMPointReadOnly 2023-09-17 16:48:54 -06:00
Bastiaan van der Plaat
8e7d3a6acc LibWeb: Add missing Canvas Context2D transform functions 2023-09-17 16:48:54 -06:00
Tim Ledbetter
0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Liav A
b6b2c6f3e2 PackageManager: Create /usr/Ports directory when updating the ports list
When updating /usr/Ports/AvailablePorts.md, the file or even the entire
/usr/Ports directory might not exist.
To cope with this, we should be able to create it ourselves. To ensure
we are able to do this, we should unveil both /usr and /usr/Ports.
2023-09-17 16:38:21 -06:00
Liav A
4303965986 PackageManager: Inform the user if AvailablePorts.md doesn't exist
If we need to read from /usr/Ports/AvailablePorts.md, but the file does
not exist, then warn the user in an informative way.
2023-09-17 16:38:21 -06:00
Shannon Booth
77d32fcb5f LibWeb: Add an initial implementation for Web::FileAPI::FileReader
Some steps are still to be implemented, namely:
 * Properly aborting the read algorithm
 * Handling BinaryString type properly
 * Setting error on any error

But as it stands, this is enough functionality for the basic case of
reading the contents of a blob using the FileReader API.
2023-09-17 16:37:31 -06:00
Shannon Booth
47616210b6 LibWeb: Add HTML::EventNames::loadend 2023-09-17 16:37:31 -06:00
Shannon Booth
3a6339f3dd LibWeb: Mark Blob::get_stream as public
This algorithm may be called from outside of Blob.
2023-09-17 16:37:31 -06:00