Commit graph

41747 commits

Author SHA1 Message Date
MacDue
df6b7fff90 LibGfx: Implement HueRotateFilter
This implements a simple and fairly efficient hue rotation filter.
It is based off the SVG feColorMatrix "hueRotate" matrix operation.
https://drafts.fxtf.org/filter-effects-1/#elementdef-fecolormatrix
2022-10-02 21:17:41 +02:00
MacDue
6b167c8427 LibGfx: Add [[nodiscard]] to Matrix operators 2022-10-02 21:17:41 +02:00
MacDue
3d532571bb LibGfx: Add Matrix::operator*(T scalar) 2022-10-02 21:17:41 +02:00
MacDue
95878688a7 LibGfx: Add Matrix::operator+(Matrix const & other) 2022-10-02 21:17:41 +02:00
Andreas Kling
6aa82f8b0b LibWeb: Report the current OS instead of always saying SerenityOS 2022-10-02 21:14:02 +02:00
Andreas Kling
de6d012367 LibWeb: Improve placement of abspos boxes with dual-auto insets
When an absolutely positioned box has auto insets on both sides of an
axis, it's placed according to the "static position rectangle". This is,
roughly, the rectangle a box would occupy if it were position:static
instead of position:absolute or position:fixed.

This patch implements a rough, but still significantly better,
estimation of such static positions. It gets pretty hairy in the case
where an abspos box has a parent whose children are inline.
2022-10-02 21:14:02 +02:00
Andreas Kling
74840c5537 AK: Add more AK_OS_FOO macros, including AK_OS_SERENITY 2022-10-02 21:14:02 +02:00
Andreas Kling
95a3da86c3 LibWeb: Reset painter translation when painting fixed-position elements
This makes nested position:fixed elements work, previously we'd apply
the viewport scroll offset once at every nesting level.
2022-10-02 21:14:02 +02:00
Andreas Kling
a494bd24f1 LibGfx: Add a way to get the Painter's current 2D translation 2022-10-02 21:14:02 +02:00
Andreas Kling
46a13c3d2e LibWeb: Add helpful locals in layout_absolutely_positioned_element()
This code had some obnoxiously repetetive call chains.
2022-10-02 21:14:02 +02:00
Andreas Kling
d1d99fda32 LibWeb: Vertical % margins are relative to containing block width
We were messing this up on absolutely positioned elements by using the
containing block height instead.
2022-10-02 21:14:02 +02:00
Andreas Kling
9c44634ca5 LibWeb: Reorganize layout algorithms around available space
This is a big and messy change, and here's the gist:

- AvaliableSpace is now 2x AvailableSize (width and height)

- Layout algorithms are redesigned around the idea of available space

- When doing layout across nested formatting contexts, the parent
  context tells the child context how much space is available for the
  child's root box in both axes.

- "Available space" replaces "containing block width" in most places.

- The width and height in a box's UsedValues are considered to be
  definite after they're assigned to. Marking something as having
  definite size is no longer a separate step,

This probably introduces various regressions, but the big win here is
that our layout system now works with available space, just like the
specs are written. Fixing issues will be much easier going forward,
since you don't need to do nearly as much conversion from "spec logic"
to "LibWeb logic" as you previously did.
2022-10-02 21:14:02 +02:00
Andreas Kling
b55c4ccdf7 LibWeb: Don't try to format inline-block boxes in BFC
Inline-level block boxes are handled by IFC. BFC doesn't have to worry
about these.
2022-10-02 21:14:02 +02:00
MacDue
e852aff9e3 LibWeb: Fix crash when loading a HTML string that contains an iframe
The HTMLIFrameElement does not create the nested browsing context on
insertion if the document does not have browsing context, which is not
set unless it's the active document.

Previously, in FrameLoader the document was not set as active until
after parsing, which led to iframes without nested browsing contexts,
and crashes.

Fixes #14207
2022-10-02 19:58:26 +01:00
Mykola
39f0eeae29 Base: Add a moderate amount of emojis
Added:
	🍖 - U+1F356 MEAT ON BONE
	🗻 - U+1F5FB MOUNT FUJI
	🏞 - U+1F3DE NATIONAL PARK
	🌁 - U+1F301 FOGGY
	🌃 - U+1F303 NIGHT WITH STARS
	🌆 - U+1F306 CITYSCAPE AT DUSK
	🌇 - U+1F307 SUNSET
	🏐 - U+1F3D0 VOLLEYBALL
	🇽🇰 - U+1F1FD U+1F1F0 FLAG: KOSOVO
2022-10-02 19:32:26 +01:00
Hendiadyoin1
3e65afa41a LibJS: Show class name in the dump from the NewClass instruction 2022-10-02 18:49:17 +01:00
Hendiadyoin1
baa4d69668 LibJS: Set class' source text in NewClass instruction
This fixes the classes toString method.
2022-10-02 18:49:17 +01:00
djwisdom
7618f2290f Base: Update ports serenity-theming use latest commit f0100c2 2022-10-02 18:48:47 +01:00
Monroe Clinton
086fccc2af Calendar: Fix crash when changing event date
We were capturing by reference which lead to the variables going
out of scope even when used in the lambda. Due to this the
update_starting_day_range lambda crashes when called.
2022-10-02 15:43:37 +02:00
Nico Weber
eb0f5bd65e Base: Fix grammar-o in GML Widget documentation 2022-10-02 10:16:12 +01:00
Tim Schumacher
b288cd6976 Ports/sdl12-compat: Update to version 1.2.56 2022-10-02 00:59:39 +01:00
Hendiadyoin1
e68309144b LibWeb: Don't scale by x, x when a scale x, y is provided as a transform 2022-10-01 21:08:50 +01:00
Andrew Kaster
691a7070f4 LibWeb: Remove the internal window object from WebEngineCustomData
Now that no one needs a Window just to create prototypes, we can remove
the internal window Object from the main thread VM and get rid of the
HTML::Window include for it.

This finally solves the reference binding to nullptr error in ladybird
that shows up when compiling it with ASAN.
2022-10-01 21:05:32 +01:00
Andrew Kaster
56b381aac0 LibWeb: Cleanup unecessary uses and includes of HTML::Window
The big global refactor left some stragglers behind for atomicity.

Clean up the rest, and remove a ton of includes of LibWeb/HTML/Window.h
2022-10-01 21:05:32 +01:00
Andrew Kaster
cc164dc1e2 Fuzzers: Convert FuzzCSSParser to use the MainThreadVM
Instead of trying to create a Window and a Document, and use those to
create a ParsingContext, just use the JS::Realm only constructor to make
sure that bindings are stashed on the main thread VM's realm.
2022-10-01 21:05:32 +01:00
Andrew Kaster
45838579c3 LibWeb: Remove unused DOM::Node::window helper method
This was a crutch for the initial GC conversion that we can get rid of
thanks to moving web prototypes and constructors off of Window.
2022-10-01 21:05:32 +01:00
Andrew Kaster
a1286f5120 LibWeb: Ensure that replaced documents keep the Window of their sibling
The note in the spec says that we're supposed to make sure this new
document has the same Window as the old about:blank document, but we
forgot to actually assign to the Window pointer.
2022-10-01 21:05:32 +01:00
Andrew Kaster
394f1b3836 LibWeb: Remove prototype and constructor helpers from Window 2022-10-01 21:05:32 +01:00
Andrew Kaster
f1367e0e4c LibWeb: Use prototype and constructor methods from new Intrinsics
This will let us remove the helpers from Window that simply defer to the
Intrinsics that are hanging off the [[HostDefined]] slot on the realm
2022-10-01 21:05:32 +01:00
Andrew Kaster
beb3519a49 LibWeb: Remove unecessary dependence on Window from WebGL and WebSocket
These classes only needed Window to get at its realm. Pass a realm
directly to construct WebGL and WebSocket classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
4bb6345b2f LibWeb: Remove unecessary dependence on Window from assorted classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Crypto, Encoding, HRT, IntersectionObserver,
NavigationTiming, Page, RequestIdleCallback, Selection, Streams, URL,
and XML classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
4878a18ee7 LibWeb: Remove unecessary dependence on Window from Fetch, XHR, FileAPI
These classes only needed Window to get at its realm. Pass a realm
directly to construct Fetch, XMLHttpRequest and FileAPI classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
6a10352712 LibWeb: Remove unecessary dependence on Window from UIEvents classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct UIEvents classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
d0efc7734a LibWeb: Remove unecessary dependence on Window from WebAssembly classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct WebAssembly classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
320dddde6a LibWeb: Remove unecessary dependence on Window from SVG classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct SCG classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
62a8c26b73 LibWeb: Remove unecessary dependence on Window from Geometry classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct Geometry classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
f0c5f77f99 LibWeb: Remove unecessary dependence on Window from HTML classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct HTML classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
a2ccb00e1d LibWeb: Remove unecessary dependence on Window from CSS classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct CSS classes.
2022-10-01 21:05:32 +01:00
Andrew Kaster
8de7e49a56 LibWeb: Remove unecessary dependence on Window from DOM and WebIDL
These classes only needed Window to get at its realm. Pass a realm
directly to construct DOM and WebIDL classes.

This change importantly removes the guarantee that a Document will
always have a non-null Window object. Only Documents created by a
BrowsingContext will have a non-null Window object. Documents created by
for example, DocumentFragment, will not have a Window (soon).

This incremental commit leaves some workarounds in place to keep other
parts of the code building.
2022-10-01 21:05:32 +01:00
Andrew Kaster
8407bf60c5 LibWeb: Introduce new construct_impl method for bound classes
In this generator change, we introduce a new factory method for bound
LibWeb objects that takes a JS::Realm instead of Web::HTML::Window.

The two methods are allowed to co-exist at this point, but the option to
take an HTML::Window will be removed once all clases are converted to
the new API.

We also start using the new Bindings::ensure_web_[prototype/constructor]
helpers from the Bindings/Intrinsics class so that we can eventually
remove the helpers from Window.h for the same.
2022-10-01 21:05:32 +01:00
Andrew Kaster
c61a4f35dc LibWeb: Move Web prototypes and constructors to new Intrinsics object
This Intrinsics object hangs off of a new HostDefined struct that takes
the place of EnvironmentSettingsObject as the true [[HostDefined]] slot
on JS::Realm objects created by LibWeb.

This gets the intrinsics off of the GlobalObject, Window, similar to the
previous refactor of LibJS to move the intrinsics into the Realm's
[[Intrinics]] internal slot.

A side effect of this change is that we cannot fully initialize a Window
object until the [[HostDefined]] slot has been installed into the realm,
which happens with the creation of the WindowEnvironmentSettingsObject.

As such, any Window usage that has not been funned through a WindowESO
will not have any cached Web prototyped or constructors, and will not
have Window APIs available to javascript code. Currently this seems
limited to usage of Window in the CSS parser, but a subsequent commit
will clean those up to take Realm as well. However, this commit compiles
so let's cut it off here :^).
2022-10-01 21:05:32 +01:00
Daniel Bertalan
01c2cffcca AK: Fix naming conflict with compiler builtin
Clang patch D116203 added various builtin functions for type traits,
`__decay` being one of them. This name conflicts with our
`AK::Detail::__decay`, leading to compiler warnings with Clang 16.
2022-10-01 20:39:48 +02:00
Daniel Bertalan
41a8f3f40f Lagom: Link LibMain statically
This matches how LibMain is used within Serenity. This commit makes it
possible to build Lagom with LTO. Previously, `serenity_main` functions
would be dead-stripped away, as the linker could prove that nothing from
the executable ever called them.
2022-10-01 20:39:48 +02:00
DJtheRedstoner
add7dd66f6 Ports/OpenJDK: Use posix_fallocate 2022-10-01 19:17:50 +01:00
DJtheRedstoner
bd08587ac9 Ports/OpenJDK: Update for the removal of StringView(char const*) 2022-10-01 19:17:50 +01:00
Xexxa
8b2683a070 Base: Adjust size of emoji U+1F1F8_U+1F1EF
🇸🇯 - U+1F1F8 U+1F1EF FLAG: SVALBARD & JAN MAYEN
2022-10-01 19:02:53 +01:00
Tim Schumacher
eb6c911b3a Toolchain: Hardcode the results of LLVM runtime library detection
This keeps us from accidentally building toolchains that don't make it
through a clean build if we build them using a populated sysroot, as it
would otherwise detect libpthread and friends and try to pull them in
while LibC is not yet built.
2022-10-01 18:59:51 +01:00
Xexxa
47c428dbe3 Base: Adjust size of emoji U+1F1F5_U+1F1E6
🇵🇦 - U+1F1F5 U+1F1E6 FLAG: PANAMA
2022-10-01 18:58:30 +01:00
Xexxa
d336dbc514 Base: Adjust size of emoji U+1F1EF_U+1F1F2
🇯🇲 - U+1F1EF U+1F1F2 FLAG: JAMAICA
2022-10-01 18:44:05 +01:00
Tim Schumacher
b52b6e8739 Toolchain: Only reextract GCC-related tarballs if patches change
This brings the behaviour in line with Clang, which already does this
since a few revisions.
2022-10-01 18:43:29 +01:00