Commit graph

18842 commits

Author SHA1 Message Date
martinfalisse
f538dc2fae LibWeb+Base: Add grid repeat() functionality
Add ability to use values passed to grid-template-columns and
grid-template-rows for CSS Grid layout within a repeat() function.

E.g. grid-template-columns: repeat(2, 50px); means to have two columns
of 50px width each.
2022-10-09 12:40:18 +01:00
implicitfield
0b72d237c1 Taskbar: Display an icon for removing a widget 2022-10-09 10:20:47 +02:00
Andrew Kaster
07b950d8a6 LibWeb: Make HostDefined and Intrinsics free functions [[nodiscard]]
Hopefully no one else will forget to call set_prototype with the cached
prototype they just retrieved from a realm and spend a long time
wondering why their object has no properties...
2022-10-09 10:14:57 +02:00
Andrew Kaster
2d5bee256e LibWeb: Re-implement HTML::Navigator using IDL
Get rid of the bespoke NavigatorObject class and use the modern IDL
strategies for creating platform objects to re-implement Navigator and
its associcated mixin interfaces. While we're here, implement it in a
way that brings WorkerNavigator up to spec :^)
2022-10-09 10:14:57 +02:00
Andrew Kaster
14e1513077 LibWeb: Remove the workaround "Worker Window" from Workers
We can now properly add the prototypes and constructors to the global
object of the Worker's inner realm, so we don't need this window for
anything anymore.
2022-10-09 10:14:57 +02:00
Andrew Kaster
a838cf2725 LibWeb: Delete WindowObjectHelper and use new generated helper instead
There's still some yaks to shave here as Window, Location and Navigator
don't have idl files yet.
2022-10-09 10:14:57 +02:00
Andrew Kaster
067a53b7e7 LibIDL: Remove static maps for interfaces and resolved imports
Instead, create a tree of Parsers all pointing to a top-level Parser.

All module imports and interfaces are stored at the top level, instead
of in a static map. This allows creating multiple IDL::Parsers in the
same process without them stepping on each others toes.
2022-10-09 10:14:57 +02:00
Andrew Kaster
2341294c20 LibIDL: Parse extended attributes that have () wrapped expressions
This includes things like Exposed and LegacyFactoryFunction.
2022-10-09 10:14:57 +02:00
Andrew Kaster
67ceba2e6a LibWeb: Add Exposed attribute and IDL spec links where missing
The intent is to use these to autogenerate prototype declarations for
Window and WorkerGlobalScope classes.

And the spec links are just nice to have :^)
2022-10-09 10:14:57 +02:00
MacDue
0265041d44 LibWeb: Fix ::-webkit-progress-bar/value pseudo elements
Recent changes to layout and display broke these pseudo elements
leading to crashes on a few websites such as https://rpcs3.net/.
2022-10-09 10:11:37 +02:00
martinfalisse
e537035cc6 LibWeb+Base: Deal with column-spans greater than implicit grid
When the indicated column-span is greater than the implicit grid (like
in cases when the grid has the default size of 1x1, and the column is
supposed to span any number greater than that), then previously were
crashing.
2022-10-08 17:26:41 +02:00
martinfalisse
994d996ab2 LibWeb: Fix bug in maybe_add_column()
Fixes a bug in the maybe_add_column() implementation of the
OccupationGrid. Previously were checking for the width of the grid based
off of the first row, and so when augmenting the column count row-by-row
the latter rows would have differing column counts.

Also, were doing an unnecessary + 1 which I imagine comes from before
when I wasn't quite clear on whether I was referring to columns by
index or by the css-value of the column (column 1 in the css is
column index 0).
2022-10-08 17:26:41 +02:00
Andreas Kling
829186af7d LibWeb+WebContent: Add EventLoopPlugin::quit() virtual
This allows you to customize breaking out of the system event loop.
2022-10-08 10:54:52 +02:00
Andrew Kaster
a0d5724a58 LibWeb: Add initial implementation of Element.blur()
This implementation includes a first cut at run the unfocusing steps
from the spec, with many things left unimplemented.

The viewport related spec steps in particular don't seem to map to
LibWeb concepts, which makes figuring out if things are properly focused
much more difficult.
2022-10-07 21:17:50 +01:00
Gunnar Beutner
400cc41176 LibCore: Make Core::System::{send,recv}fd work on macOS
All the required bits were already there. Also, this would probably
work on FreeBSD without modification but I don't currently have
a system to test this on.
2022-10-07 18:14:48 +01:00
MacDue
35809ef400 LibGfx: Remove unnecessary divides in MatrixFilter 2022-10-07 13:08:24 +01:00
MacDue
b877d71db7 LibWeb: Add missing hue-rotate() filter spec comment 2022-10-07 13:08:24 +01:00
MacDue
60cc96d243 LibWeb: Support painting the saturate() filter effect 2022-10-07 13:08:24 +01:00
MacDue
f77a84a5f6 LibGfx: Implement SaturateFilter
This implements the saturate operation as defined in the SVG filter
specification.

(https://drafts.fxtf.org/filter-effects-1/#feColorMatrixElement)
2022-10-07 13:08:24 +01:00
MacDue
97f66562cc LibGfx: Add MatrixFilter and convert HueRotateFilter to be one
This moves the apply a matrix operation to each [r,g,b] vector in an
image to a general class.
2022-10-07 13:08:24 +01:00
Andreas Kling
78bc856e07 LibWeb: Treat cross min/max sizes better in flexbox layout
For percentage cross min/max sizes that resolve against indefinite
available space, we now essentially ignore them instead of resolving
them to 0 at the start of layout.
2022-10-07 14:03:17 +02:00
matcool
104b51b912 LibUnicode: Fix Hangul syllable composition for specific cases
This fixes `combine_hangul_code_points` which would try to combine
a LVT syllable with a trailing consonant, resulting in a wrong
character.

Also added a test for this specific case.
2022-10-07 07:53:27 -04:00
Andreas Kling
ce0e4b71a3 LibWeb: Floating boxes with width:auto don't have definite width
Since layout is required in order to determine the width of such boxes,
they should not be marked as having definite width initially.
2022-10-07 13:08:44 +02:00
Andreas Kling
913d9221aa LibWeb: Don't insert inline nodes directly under inline-flex container
Yet another legacy "is inline-block?" condition was causing us to insert
inline nodes directly as children of inline-flex containers (instead of
wrapping them in anonymous blocks, which would then cause them to become
flex items.)
2022-10-07 12:47:46 +02:00
Andreas Kling
90b66533d0 LibWeb: Don't hit test all child stacking contexts twice
We're supposed to hit test positive z-index stacking contexts first,
and negative z-index stacking contexts later. Instead, we were hit
testing all stacking contexts both times.

This made hit testing unbearably slow on some websites.

While we're here, also add an extra comment about why stacking contexts
are traversed in reverse order. It tripped me up while looking at this,
so I'm sure it could trip someone else up too.

Regressed in 44057c9482.
2022-10-07 12:10:59 +02:00
Luke Wilde
102e02d336 LibWeb: Use DOM manipulation task source for <script> src parsing errors
See: https://github.com/whatwg/html/commit/5d34cb8

We were already using queue_an_element_task here.
2022-10-06 22:21:17 +01:00
Timothy Flynn
7fc03e8967 LibJS: Use Unicode normalization within String.prototype.normalize 2022-10-06 22:14:44 +01:00
Timothy Flynn
19b758ce8b LibUnicode: Add to-and-from string converters for NormalizationForm 2022-10-06 22:14:44 +01:00
Sam Atkins
462c49ad55 LibWeb: Remove duplicate reference to SVGElement.cpp 2022-10-06 21:45:07 +01:00
Sam Atkins
ab19c5fab8 LibWeb: Implement DOMPoint/DOMPointReadOnly.fromPoint() 2022-10-06 21:45:07 +01:00
Sam Atkins
0823a3c422 BindingsGenerator+LibWeb: Pass a VM to static IDL-based functions
This saves us from having to yoink the VM out of thin air.
2022-10-06 21:45:07 +01:00
Sam Atkins
8a78679152 LibWeb: Correct types in DOMPoint IDL files, and add FIXMEs
Also, the `w` parameters for the constructor default to 1, not 0.
2022-10-06 21:45:07 +01:00
Sam Atkins
a6f0508f9f BindingsGenerator+LibIDL: Parse "inherit" attributes
An "inherit attribute" calls an ancestor's getter with the same name,
but defines its own setter. Since a parent class's public methods are
exposed to child classes, we don't have to do any special handling here
to call the parent's methods, it just works. :^)
2022-10-06 21:45:07 +01:00
Itamar
c30c6eb1c1 HackStudio: Use a single global tooltip window
Previously, every Editor instance had two instances of tooltip windows
& `OutOfProcessWebView`s, one for documentation and one for parameter
hints.

They were initialized with the Editor, which slowed down creation of new
tabs.

We use a single global tooltip & OOPWV instance that is shared between
tabs.

Closes #15488

Co-authored-by: Sam Atkins <atkinssj@serenityos.org>
2022-10-06 21:27:40 +01:00
Itamar
2046a670b3 HackStudio: Remove adjustment of text range for documentation tooltip
We no longer need to adjust the hovered span's range to get the correct
hovered text. This fixes the "documentation tooltip" feature.
2022-10-06 21:27:40 +01:00
martinfalisse
84290ed7c8 Base+LibWeb: Make sure grid positions don't cause out of bounds
Add some tests to the test page to make sure that different combinations
of GridTrackPlacement don't cause out of bounds issues.
2022-10-06 21:16:01 +02:00
martinfalisse
97230c4ddb LibWeb: Clean up grid track placement shorthand parser
Use the implemented non-shorthand version of the GridTrackPlacement
parser to clean up the shorthand version and deduplicate code.
2022-10-06 21:16:01 +02:00
martinfalisse
56f50c9cde Base+LibWeb: Deal with zero-positioned grid items
If a grid item has as its position value a 0 then it should be
invalidated.
2022-10-06 21:16:01 +02:00
martinfalisse
9051a56554 Base+LibWeb: Stub out negative spans
Ensure that when a grid item is passed with a span and a fixed end
position, that if the resulting start of this item is less than 0 then
it won't throw. This is a temporary measure until the correct
functionality is implemented.
2022-10-06 21:16:01 +02:00
martinfalisse
a764e43db3 LibWeb: Factor out OccupationGrid functions
Clean up the code by using an OccupationGrid class. This was a neat idea
proposed by MacDue.
2022-10-06 21:16:01 +02:00
martinfalisse
db19570b94 LibWeb: Truncate oversized grid spans
If a span makes a CSS Grid item overflow vertically, then it should be
truncated as done on other web engines.
2022-10-06 21:16:01 +02:00
martinfalisse
f3bf01f265 LibWeb: Fix bug in placing row-constrained grid items
For row-constrained items (with a row position defined in the CSS),
should be checking for an available position in that row and not in
another..
2022-10-06 21:16:01 +02:00
martinfalisse
a528ea71d1 LibWeb: Use span values for auto-positioned grid items
Auto-positioned items should also take into account the span attributes
passed to them.
2022-10-06 21:16:01 +02:00
martinfalisse
4dc2bd3df0 LibWeb: Handle different span properties for GridTrackPlacement parsing
These changes improve the parsing of the span property, including
handling negative values for the span (defaults to 1), as well as when
no number is passed (also defaults to 1).
2022-10-06 21:16:01 +02:00
martinfalisse
6c22f9bf3f LibWeb: Use ident instead of to_string in parser
Use the ident() function instead of to_string() for parsing. Fix this up
in the rect parser as well.
2022-10-06 21:16:01 +02:00
martinfalisse
330af1a769 LibWeb: Fix bug in spec implementation auto_placement_cursor 2022-10-06 21:16:01 +02:00
martinfalisse
93824edeb7 LibWeb: Fix implementation bugs of grid track is_span()
After having corrected the tracking of span variables in the
GridTrackPlacement class, now can fix some small bugs for its correct
implementation in the GridFormattingContext class.
2022-10-06 21:16:01 +02:00
martinfalisse
9fd07e9cb1 LibWeb: Make it easier to check if grid track is auto positioned
Add some helper functions for checking if a grid-track is
auto-positioned. I think this makes the code more legible.
2022-10-06 21:16:01 +02:00
martinfalisse
236795e931 LibWeb+Base: Re-implement grid track span
Implement span correctly when indicated in the grid-column-start,
grid-row-start, etc. CSS properties. Previously it had been implemented
as if span was something that went alongside the position property, but
actually it seems like if you do 'span 3' in the grid-column-start
property, for example, this means it literally spans 3 blocks, and the
3 has nothing to do with position.
2022-10-06 21:16:01 +02:00
martinfalisse
86ce1b64f0 LibWeb: Fix bug in checking if GridTrackPlacement is auto-positioned
This fixes something I thought I had already fixed everywhere, where
previously there wasn't the possibility to have an Auto
GridTrackPlacement and so the Auto "implementation" was simply checking
if the position of the track was 0.
2022-10-06 21:16:01 +02:00