Commit graph

54717 commits

Author SHA1 Message Date
Andreas Kling
51caa14381 LibWeb: Remove FrameLoader
This class is no longer used, now that we've moved to navigables.
2023-09-20 18:29:17 +02:00
Aliaksandr Kalenik
693d602b2f LibWeb: Fix infinite loop in GFC growth limit distribution
This change is bd85e1b30b ported from
base size to growth limit distribution.

Fixes https://github.com/SerenityOS/serenity/issues/21056
2023-09-20 18:28:11 +02:00
Sam Atkins
9b4ddff6a9 LibWeb: Replace FontStyleValue with ShorthandStyleValue
Also, actually include font-variant since we were already parsing it but
throwing it away.
2023-09-20 12:17:16 +01:00
Sam Atkins
34591549b1 LibWeb: Replace BorderRadiusShorthandStyleValue with ShorthandStyleValue 2023-09-20 12:17:16 +01:00
Sam Atkins
34e0899ab0 LibWeb: Replace BackgroundStyleValue with ShorthandStyleValue
The `to_string()` for this is modified a little from the original,
because we have to calculate what the layer-count is then, instead of
having it already calculated.
2023-09-20 12:17:16 +01:00
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
Bastiaan van der Plaat
69482f1f14 Ladybird/AppKit: Add mouse wheel events 2023-09-20 08:33:31 +02:00
Kemal Zebari
f6c52f622d AK: Number the spec step comments in URL::serialize_path() 2023-09-19 21:51:31 +01:00
Junior Rantila
f15d46fb8b Meta: Lint .mm files with lint-clang-format.sh 2023-09-19 11:37:48 -06: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
8270b9ab7e LibWeb: Add simple ref test for SVG masking 2023-09-19 10:46:05 +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
Andrew Kaster
d27e4732b6 Meta: Add link to my GitHub sponsors to the contributors list 2023-09-18 19:58:46 -06: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
Daniel Bertalan
715f452233 Documentation: Hide Meta/serenity.sh rebuild-toolchain
Unless a new toolchain update has been merged, users should not need to
rebuild their toolchain. Yet, the first thing they see in the build
documentation is to run `Meta/serenity.sh rebuild-toolchain`, which
might incorrectly lead them to use it whenever they encounter an error.
This is a waste of time and causes frustration.

Move any mentions of this option to `Troubleshooting.md` and add a note
to `BuildInstructions.md` about the toolchain build being a one-time
endeavor.
2023-09-18 11:13:23 -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
Timothy Flynn
ece9908070 Ladybird: Add context menu items to the AppKit chrome to inspect nodes 2023-09-18 11:11:23 -06:00
Timothy Flynn
bd1e35c726 Ladybird: Map the AppKit Inspector's DOM nodes to their IDs and parents
This is in the spirit of commit a4692a6c978a6e66d171e003063449790a6c5879
(and the history behind that commit).

We will need to perform lookups from an integral node ID to the JSON for
that node frequently in the Inspector. We will also need to traverse the
DOM tree from a node, through its ancestors, to the root node. These are
essentially the same maps stored by the Qt Inspector widget.
2023-09-18 11:11:23 -06:00
Timothy Flynn
6304abf94c Ladybird: Add a table to display CSS properties to the AppKit Inspector 2023-09-18 11:11:23 -06:00
Timothy Flynn
4483204c9c Ladybird: Implement a basic Inspector window for the AppKit chrome
This commit includes only fetching the DOM tree from the WebContent
process and displaying it in an NSOutlineView. The displayed tree
includes some basic styling (e.g. colors).
2023-09-18 11:11:23 -06:00
Timothy Flynn
33b006f157 Ladybird: Add a helper to deserialize a JSON string to an NSDictionary
The steps here are a tad verbose, and will be needed several times in
the Inspector window.
2023-09-18 11:11:23 -06:00
Timothy Flynn
507dea5fdd Ladybird: Add an AppKit NSString category to hold common utilities
This currently holds a helper to create a new string which collapses all
consecutive whitespace to a single ASCII space.
2023-09-18 11:11:23 -06:00
Junior Rantila
1f07a18f4e Ladybird: Add tooltips for buttons in AppKit version 2023-09-18 11:10:31 -06:00
Karol Kosek
1681d6f721 Meta: Port recent build changes to gn build
This ports the following commits:
6476dea898
153ae93f9c
45b36bd08a
7870f10aa8
139c575cc9
63d09f6daf
1b3ad1c721
77d32fcb5f
2023-09-18 11:09:48 -06:00
Hendiadyoin1
d168bfabc4 Kernel/USB: Detach devices from their driver when they are detached 2023-09-18 11:09:19 -06:00
Jesse Buhagiar
b4cd354bae Kernel/USB: Add driver search on device plug
When a device is plugged into the machine (and hence, when
`Device::try_create()` is called), then we attempt to load a driver by
calling that driver's probe function.
2023-09-18 11:09:19 -06:00
Jesse Buhagiar
b0ed126538 Kernel/USB: Expose USBConfiguration in USBInterface 2023-09-18 11:09:19 -06:00
Jesse Buhagiar
3cfdc6e363 Kernel/USB: Add get_driver_by_name helper in USBManagement 2023-09-18 11:09:19 -06:00
Jesse Buhagiar
2aa17f619c Kernel/USB: Add USB Driver register/unregister function 2023-09-18 11:09:19 -06:00
Jesse Buhagiar
3cead2801a Kernel: Call USB Driver initialize functions during init 2023-09-18 11:09:19 -06:00
Jesse Buhagiar
a0dd6ec6b1 Kernel/USB: Add driver_init section
At any one given time, there can be an abitrary number of USB drivers in
the system. The way driver mapping works (i.e, a device is inserted, and
a potentially matching driver is probed) requires us to have
instantiated driver objects _before_ a device is inserted. This leaves
us with a slight "chicken and egg" problem. We cannot call the probe
function before the driver is initialised, but we need to know _what_
driver to initialise.

This section is designed to store pointers to functions that are called
during the last stage of the early `_init` sequence in the Kernel. The
accompanying macro in `USBDriver` emits a symbol, based on the driver
name, into this table that is then automatically called.

This way, we enforce a "common" driver model; driver developers are not
only required to write their driver and inherit from `USB::Driver`, but
are also required to have a free floating init function that registers
their driver with the USB Core.
2023-09-18 11:09:19 -06:00
Jesse Buhagiar
8883da9586 Kernel/USB: Add new Driver base class
Co-Authored-By: Liav A <liavalb@gmail.com>
Co-Authored-By: Leon Albrecht <leon2002.la@gmail.com>
2023-09-18 11:09:19 -06:00