Commit graph

47934 commits

Author SHA1 Message Date
Kenneth Myhra
be958a14cf LibWeb: Use from_deprecated_fly_string() instead of from_utf8()
Use FlyString::from_deprecated_fly_string() in these instances instead
of FlyString::from_utf8(). As we convert to new FlyString/String we want
to be aware of these potential unnecessary allocations.
2023-03-11 18:32:33 +00:00
Kenneth Myhra
e28a6d5da4 AK: Add FlyString::from_deprecated_fly_string()
Let's add FlyString::from_deprecated_fly_string() so we can use it
instead of FlyString::from_utf8(). This will make it easier to detect
potential unncessary allocations as we transfer to FlyString.
2023-03-11 18:32:33 +00:00
Linus Groh
41b8d81d49 LibWeb/HTML: Remove redundant namespace qualifiers from Window.{cpp,h} 2023-03-11 18:26:40 +00:00
Linus Groh
324dacbc5d LibWeb/HTML: Propagate OOM errors from Window::{local,session}_storage()
This requires a bit of error type conversion glue as HashMap::try_ensure
expects the callback to return ErrorOr<T> like the function itself does.
2023-03-11 18:26:40 +00:00
Linus Groh
4da68384e6 LibWeb/HTML: Make Window::m{location,navigator} lazily allocated
This now matches the other window-owned objects, which already do this:
m_crypto, m_performance, m_screen.
2023-03-11 17:53:50 +00:00
Linus Groh
22552382ff LibWeb/HTML: Use CreateMethodProperty for Window namespace properties
This makes sure the property attributes are correct (writable and
configurable), which they currently aren't for either CSS or
WebAssembly.
2023-03-11 17:32:07 +00:00
Linus Groh
be0dcd465f LibJS: Fix return type of Object::create_method_property()
This doesn't return a completion in the spec as it doesn't need to
propagate any errors. It's also unused right now, which is probably why
no one noticed.
2023-03-11 17:32:07 +00:00
Linus Groh
b6a69f5f03 LibWeb/HTML: Consolidate duplicate public/private sections in Window.h 2023-03-11 17:09:01 +00:00
Mathis Wiehl
dd81a975d7 LibWeb: Establish a stacking context for root element
Until now we were just creating a stacking context for the tree root,
which usually is the viewport element. This lead to weird painting
behaviour when negative z-index children of the html element that
established their own stacking context were drawn below the canvas
background.

Now we establish a stacking context for both, the root element and the
viewport.
2023-03-11 16:54:58 +00:00
Sam Atkins
08c1effc04 HackStudio: Use Syntax::Language instead of our own one
The one behavior difference here is that the statusbar used to display
"Unknown" for unknown file types, and "Markdown" for md, but we now
display "Plain Text" for all file types without syntax highlighters.
2023-03-11 13:22:57 +00:00
Sam Atkins
ffce6cc977 LibSyntax: Add Language-from-String/Path functions
These are taken from HackStudio, but slightly rearranged to be more
alphabetical, and returning an empty Optional instead of "Unknown".
2023-03-11 13:22:57 +00:00
Sam Atkins
82f58b8af0 AK: Forward-declare LexicalPath
And alphabetically sort the list while I'm at it.
2023-03-11 13:22:57 +00:00
Sam Atkins
8007c103dd LibSyntax: Move Language enum into its own files 2023-03-11 13:22:57 +00:00
Pankaj Raghav
a1f2f08764 Meta: Use the correct boot device addressing mode for NVMe devices
Commit: 2c84466ad8 ("Kernel/Storage: Introduce new boot device
addressing modes") changed the way we pass the boot device parameter.

That commit missed updating boot parameter in the run.sh script for NVMe
boot devices.
2023-03-11 13:15:00 +00:00
Pankaj Raghav
f8b67e1596 Kernel/Storage+Base: Fix boot_device_addressing document for NVMe
The LUN.target_id parameter points to a NVMe Namespace which starts from
1 and not 0. Fix the document to reflect the same while addressing a
nvme device in the boot parameters
2023-03-11 13:15:00 +00:00
Aliaksandr Kalenik
84e17fcbcc WebDriver: Fix crash in async execute script endpoint
Removal of dummy execution context in
9aca54091a caused a crash in
`execute_async_script` because of empty execution contexts stack
during `create_resolving_functions` call.
2023-03-11 13:11:51 +00:00
Fabian Dellwing
7c0b360881 Kernel: Add non standard value to sys$sysconf
Add `_SC_PHYS_PAGES` to sys$sysconf syscall. This value is needed
for a port I'm working on.
2023-03-11 13:06:36 +00:00
Julian Offenhäuser
c705afa43a Kernel: Fix variable shadowing issue in PCIIDELegacyModeController
In this specific else case, primary_base_io_window would not be assigned
in the outer scope, leading to a crash immediately after.
2023-03-11 06:06:01 -07:00
Andrew Kaster
b996e15d9d CI: Remove stale dependence on Toolchain.yml from nightly job
We removed this file in 0a7d0362ea but
forgot to update the nightly job.
2023-03-11 05:36:14 -07:00
Andreas Kling
47797ff52c Meta: Remove Brian's entries from CODEOWNERS
The scope of these entries is not proportional to Brian's capacity for
code review at the moment, so let's stop marking him as "code owner" on
almost every PR. :^)
2023-03-11 13:11:09 +01:00
Andreas Kling
af8d5207f6 Meta: Don't check for newlines at EOF in Tests/LibWeb/Layout/ 2023-03-11 13:05:35 +01:00
Andreas Kling
f3556f239e LibWeb: Don't touch flex items after they we've been frozen
When using the flex shrink factor, the flexible length resolution
algorithm was incorrectly ignoring the `frozen` flag on items and would
update the same items again, causing overconsumption of the remaining
free space on the flex line.
2023-03-11 11:52:19 +01:00
Andreas Kling
0808463a7d LibWeb: Use FlexItem::outer_hypothetical_main_size() in one more place
Better than doing the calculation manually.
2023-03-11 11:45:17 +01:00
Andreas Kling
f97754942c LibWeb: Collapse margin-left with space used by left-side floats
We had an issue where boxes with margin-left were shifted right by
left-side floats twice instead of just once.
2023-03-11 10:46:26 +01:00
Andreas Kling
1cf5737e9e LibWeb: Add fast_is<T>() for various types stood out in a profile 2023-03-11 10:46:26 +01:00
Andreas Kling
f6426cdcd4 LibWeb: Use static_cast in SVGGeometryBox::dom_node()
These are only ever constructed with a corresponding SVGGeometryElement,
so we know it's safe to static_cast here.
2023-03-11 10:46:26 +01:00
Mathis Wiehl
ab4cf7c57d LibWeb: Don't overflow flex containers on margin auto
In case flex items had `margin: auto` on the primary flex axis, we were
still also distributing remaining space according to `justify-content`
rules. This lead to duplicated spacing in various places and overflows.

It looks like this issue was observed previously but missidentified
because there was logic to ignore margins at the start and end which
would partially paper over the root cause. However this created other
bugs (like for example not having a margin at beginning and end ;-)) and
I can find nothing in the spec or other browser behaviour that indicates
that this is something that should be done.

Now we skip justify-content space distribution alltogether if it has
already been distributed to auto margins.
2023-03-11 10:46:21 +01:00
Aliaksandr Kalenik
3716e1b8a0 Ladybird: Delete unused ConsoleClient and ConsoleGlobalObject
After the separation of LibWeb into WebContent process, ConsoleClient
and ConsoleGlobalObject are no longer used.
2023-03-11 08:09:10 +01:00
Andrew Kaster
3d33217d60 Ladybird+CI: Move layout_test.sh test runner from CI yml into CMake
We should be able to run this locally, as long as ENABLE_LAGOM_LADYBIRD
is true, or if building ladybird from the ladybird source directory.

This removes a special case from the Lagom CI yml file.
2023-03-10 23:01:55 +00:00
Lucas CHOLLET
af58f012be Tests: Add a test for JPEGs with RGB components 2023-03-10 22:22:36 +01:00
Lucas CHOLLET
a47d775be6 LibGfx/JPEG: Support RGB JPEGs
By default, JPEGs use YCbCr to encode colors however other encoding
exist. This patch adds the logic to determine which transformation is
needed and support for RGB encoded JPEGs :^).
2023-03-10 22:22:36 +01:00
Lucas CHOLLET
c60338e187 LibGfx/JPEG: Decode the App14 segment
This half-standardized application specific segment is used for color
transform information. It means that the decoder is know informed if the
image uses YCbCr, RGB, CMYK or even YCCK.
2023-03-10 22:22:36 +01:00
Lucas CHOLLET
00808c5eba LibGfx/JPEG: Use decimal instead of hexadecimal for APP markers 2023-03-10 22:22:36 +01:00
implicitfield
d4d1cab895 ThemeEditor: Support more color scheme-related roles 2023-03-10 22:03:49 +01:00
implicitfield
e9e4baee77 Everywhere: Support overriding the system color scheme 2023-03-10 22:03:49 +01:00
implicitfield
fba0cee622 Flood: Update the man page to reflect current color scheme handling 2023-03-10 22:03:49 +01:00
Ali Mohammad Pur
56b5b78d7b Shell: Error out on invalid `export' argument
Previously `export =` would crash the shell, make this an error instead.
2023-03-10 22:33:30 +03:30
Andrew Kaster
a5c47d0be3 LibAudio: Include missing AK/Stream.h in Loader.h
This fixes the FuzzQOILoader build.
2023-03-10 11:44:11 -07:00
Tom
52e45fb6fa LibWeb+Base: Fix row-height bug in Grid when there is a column gap
This fixes a bug in the CSS Grid when there is a column and/or row gap,
as previously it would take the index of the incorrect column when
finding the `AvailableSize`.

There is a mild complication in the GridFormattingContext as the
OccupationGrid does not take into account the gap columns and rows that
later appear in the `Vector<TemporaryTrack>` columns and rows. The
PositionedBoxes are kind of a connection between the two, and so it's
now more explicit whether you would like to refer to a column by its
position taking into the gap columns/rows or not.
2023-03-10 18:20:27 +01:00
Andreas Kling
da861fe7af Tests/LibWeb: Use SerenitySans in new layout tests
This ensures consistent font metrics no matter which platform fonts
are available.
2023-03-10 18:10:33 +01:00
Andreas Kling
ff7b949061 LibWeb: Make HTMLScript private members private once again
These were accidentally made public a while ago. Thankfully nobody
started poking into script element internals since then. :^)
2023-03-10 14:59:46 +01:00
Andreas Kling
e8f5085669 LibWeb: Implement Range.createContextualFragment() 2023-03-10 14:58:55 +01:00
Andreas Kling
fb6d6a985f LibWeb: Implement Element.setAttributeNode{,NS}() 2023-03-10 14:56:29 +01:00
Andreas Kling
8c5c78f1f1 LibWeb: Implement Document.createAttribute{,NS}() 2023-03-10 14:56:03 +01:00
Andreas Kling
109ed27423 LibWeb: Rewrite FFC "resolve flexible lengths" algorithm from draft spec
The draft CSS-FLEXBOX-1 spec had a more detailed description of this
algorithm, so let's use that as our basis for the implementation.

Test by Aliaksandr. :^)
2023-03-10 13:38:34 +01:00
Andreas Kling
1cd61723f0 LibWeb: Show layout test failure diffs in unified format (diff -u) 2023-03-10 13:38:34 +01:00
Andreas Kling
0ef07383e5 LibWeb: Fix bogus min/max-height for box-sizing:border-box flex items
When resolving these constraints to CSS pixel sizes, we have to resolve
padding-top and padding-bottom against the flex container's *width*,
not its height.
2023-03-10 13:38:34 +01:00
Andreas Kling
24d5a9d7df LibWeb: Fix bogus percentage vertical padding with box-sizing:border-box
The padding-top and padding-bottom properties are relative to the
*width* of the containing block, not the height.

It's funny how we keep making this same mistake again and again. :^)
2023-03-10 13:38:34 +01:00
Andreas Kling
07f6ee9e73 LibWeb: Simplify FFC get_pixel_{width,height} internal helper API
These took an Optional<CSS::Size> for some reason, but that was not
necessary. Just take a CSS::Size.
2023-03-10 13:15:45 +01:00
Andreas Kling
6b19397452 LibWeb: Avoid unnecessary work for box-sizing: content-box flex items 2023-03-10 13:15:45 +01:00