Commit graph

41812 commits

Author SHA1 Message Date
MacDue
7c8ce42593 LibWeb: Fix string whitespace splitting mistake
`.split_view(Infra::ASCII_WHITESPACE)` tries to split the string view on
the string "\t\n\f\r " (not any of the individual characters of that
string).

The correct way to split this string views here is
`.split_view_if(Infra::is_ascii_whitespace)`, this is a little
inconsistent with String, so probably should be addressed.
2022-10-02 22:47:28 +01:00
Andreas Kling
6bb3d4694f Meta: Add Lucas Chollet to the contributors list :^) 2022-10-02 21:37:06 +02:00
Lucas CHOLLET
b8c42365f0 mount: Report error instead of crashing on failure
Being unable to `open` on the source caused mount to crash. The error is
now properly reported to the user.
2022-10-02 21:33:35 +02:00
implicitfield
6c86b40724 test: Support more options
Adds -g, -G, -k, -O and -u options.
2022-10-02 21:33:01 +02:00
implicitfield
caab6ac968 test: Print the correct operator on error 2022-10-02 21:33:01 +02:00
Linus Groh
7760c00714 LibWeb: Move strip_and_collapse_whitespace() to Infra/
...and make it spec compliant by considering all ASCII whitespace,
greatly simplifying it in the process :^)
2022-10-02 21:32:49 +02:00
Linus Groh
b86c264975 LibWeb: Replace incorrect uses of split_view() for whitespace splitting 2022-10-02 21:32:49 +02:00
Linus Groh
b9220a18d1 LibWeb: Replace incorrect uses of String::trim_whitespace() 2022-10-02 21:32:49 +02:00
Linus Groh
fb21271334 LibWeb: Replace incorrect uses of AK::is_ascii_space() 2022-10-02 21:32:49 +02:00
Linus Groh
87ac38c78b LibWeb: Add is_ascii_whitespace() function
This matches the Infra spec's definition of 'ASCII whitespace', and we
can at last stop using AK::is_ascii_space(), which has a different idea
about what 'whitespace' means.
2022-10-02 21:32:49 +02:00
matcool
eae9cb2b02 Keymaps: Improve pt-br keymap
Adds /?° key (scancode 115).
Shift + 6 now maps to ¨ instead of space.
AltGr + (1-6) now map to ¹²³£¢¬.
AltGr + = now maps to §.
AltGr + [ now maps to ª.
AltGr + ] now maps to º.
AltGr + q now maps to /.
AltGr + w now maps to ?.
AltGr + e now maps to °.
AltGr + c now maps to ₢.
2022-10-02 21:28:55 +02:00
matcool
cb9b004ff8 Snake: Show message box on game over
Previously the game would immediately reset on game over, but now it'll
pause the game and show a message box with your score.
2022-10-02 21:28:37 +02:00
Monroe Clinton
67300af248 Games: Wrong parent window passed to GUI::MessageBox
We were passing the wrong parent window to GUI::MessageBox making
it impossible to exit the message window.
2022-10-02 21:28:26 +02:00
MacDue
2a9128efe3 Base: Add example backdrop-filter using hue-rotate() 2022-10-02 21:17:41 +02:00
MacDue
e697a72c99 LibWeb: Support painting the hue-rotate() filter effect 2022-10-02 21:17:41 +02:00
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