Commit graph

41673 commits

Author SHA1 Message Date
Linus Groh 4f73851afc LibWeb: Move CallbackType from Bindings/ to WebIDL/
Let's stop putting generic types and AOs from the Web IDL spec into
the Bindings namespace and directory in LibWeb, and instead follow our
usual naming rules of 'directory = namespace = spec name'. The IDL
namespace is already used by LibIDL, so Web::WebIDL seems like a good
choice.
2022-09-24 19:31:39 +01:00
Linus Groh dc44effd44 LibWeb: Move cross-origin AOs from Bindings/ to HTML/CrossOrigin/
These are from the HTML spec and therefore belong in the HTML/ directory
in LibWeb. Bindings/ has become a bit of a dumping ground, so this is a
first step towards cleaning that up.
2022-09-24 19:31:39 +01:00
MacDue c3841e1667 LibWeb: Restore clipping of positioned descendants
63c727a was meant to stop clipping absolutely positioned descendants,
but used `is_positioned()` rather than `is_absolutely_positioned()`,
which meant it disabled clipping in many more cases that it should
have.
2022-09-24 19:06:57 +02:00
Itamar 7165dbce5c LibGfx: Fix affine transformations in TrueType composite glyphs
This fixes an issue where, when looping over the components of a
composite glyph, we used to mutate the affine transformation of the
glyph itself when computing the transformations of its components.

(AffineTransform::multiply() is non-const).
2022-09-24 17:06:29 +02:00
Liav A 13e9947b4b WindowServer: Fallback to safe mode-setting in case of mapping overflow
In case of possible framebuffer mapping overflow, just fallback to the
safe mode-setting of the DisplayConnector, because in that state we know
for sure that we can map a usable framebuffer (otherwise it is a bug in
the Kernel, and not WindowServer).
2022-09-24 15:38:56 +01:00
Liav A d5b97eb41e Kernel+Userland: Provide bytes count for a DisplayConnector framebuffer
This value will be used later on by WindowServer to reject resolutions
that will request a mapping that will overflow the hardware framebuffer
max length.
2022-09-24 15:38:56 +01:00
Liav A 50ed50752f LibEDID: Remove head index when retrieving an EDID from DisplayConnector
We simply don't need that field anymore, as it was used when one
FramebufferDevice could contain multiple framebuffers within it, each
for a connected screen head.
2022-09-24 15:36:19 +01:00
Andreas Kling c04b107e26 LibWeb: Treat replaced % sizes as 0 if containing block is indefinite 2022-09-24 14:41:18 +02:00
kleines Filmröllchen a5b72577e6 Meta: Enable full region dumping on CI 2022-09-24 14:22:09 +02:00
kleines Filmröllchen 1a7d6508e3 Kernel: By default, don't dump regions when a userspace crash happens
There is the DUMP_REGIONS_ON_CRASH debug macro which re-enables this
(old) behavior.
2022-09-24 14:22:09 +02:00
Andreas Kling 416fa7bd4f LibWeb: Bring flex basis calculation a little closer to spec
This ends up having a big impact on performance, as we now correctly
treat a used flex-basis of `content` as `max-content` which means
we can use cacheable intrinsic sizes for flex items in the majority
of cases.
2022-09-24 14:09:56 +02:00
Andreas Kling f0ac687823 LibWeb: Remove awkward BFC::compute_theoretical_height() function
This was used by FFC to estimate the height of flex items after
performing layout inside them.

Now that we have automatic_content_height(), we no longer need this
awkward API and we can fold it into BFC's own height calculation.
2022-09-24 13:53:23 +02:00
Liav A e181269da7 Revert "Tests/Kernel: Add tests to ensure we don't regress InodeVMObjects"
This reverts commit b0d555163bc724542ea6560a2bc82bc3b620c31d.
2022-09-24 13:49:40 +02:00
Liav A 6e26e9fb29 Revert "Kernel: Send SIGBUS to threads that use after valid Inode mmaped range"
This reverts commit 0c675192c9.
2022-09-24 13:49:40 +02:00
MacDue 4d7e4e5da8 LibWeb: Avoid overflow and OOB indexing in get_buffer_source_copy()
Previously, this would overflow when both length and offset were
zero, leading to an OOB index into es_array_buffer. This would lead to
a crash on a few MDN pages.
2022-09-24 13:49:15 +02:00
Andreas Kling ba065faa54 LibWeb: Remove unused capture in queue_a_microtask() 2022-09-24 13:48:38 +02:00
Andreas Kling a8e1599ae1 LibWeb: Use automatic_content_height() in flex item internal layouts 2022-09-24 13:47:58 +02:00
Andreas Kling 5656173e00 LibWeb: Use automatic_content_height() when computing intrinsic heights 2022-09-24 13:47:17 +02:00
Andreas Kling 62974160da LibWeb: Add FormattingContext::automatic_content_height()
This function should return the automatic height of the formatting
context's root box.

Until now, we've been relying on some magical handshakes between parent
and child context, when negotiating the height of child context root
boxes. This is a step towards something more reasonable.
2022-09-24 13:41:08 +02:00
Andreas Kling b52165c5d7 LibWeb+LibGfx: Move the blit image through 2D transfrom to Gfx::Painter
Even though this code is obnoxiously slow, it still belongs in LibGfx
and should not be hidden away in LibWeb's CanvasRenderingContext2D.
2022-09-24 13:00:53 +02:00
Andreas Kling 37ea6de772 LibWeb: Remove now-unnecessary JS::Handles in microtask capture lists 2022-09-24 12:23:29 +02:00
Andreas Kling 874e64d664 LibWeb: Make queue_an_element_task() use JS::SafeFunction 2022-09-24 12:23:29 +02:00
Andreas Kling 2ccb9bef49 LibWeb: Remove now-unnecessary JS::Handles in HTML task capture lists
JS::SafeFunction will protect anything captures for HTML tasks now.
2022-09-24 12:23:29 +02:00
Andreas Kling d505192014 LibWeb: Use JS::SafeFunction in the HTML task queues
This means that HTML tasks automatically protect anything in their
capture lists, and we no longer need to jump through hoops with
JS::Handle etc.
2022-09-24 12:23:29 +02:00
Andreas Kling 131c3f50de LibJS: Add JS::SafeFunction, like Function but protects captures from GC
SafeFunction automatically registers its closure memory area in a place
where the JS garbage collector can find it.

This means that you can capture JS::Value and arbitrary pointers into
the GC heap in closures, as long as you're using a SafeFunction, and the
GC will not zap those values!

There's probably some performance impact from this, and there's a lot of
things that could be nicer/smarter about it, but let's build something
that ensures safety first, and we can worry about performance later. :^)
2022-09-24 12:23:29 +02:00
Xexxa 585072fce3 Base: Add more emoji
🏃‍♂️ - U+1F3C3 U+200D U+2642 MAN RUNNING
🏃‍♀️ - U+1F3C3 U+200D U+2640 WOMAN RUNNING
🤸‍♂️ - U+1F938 U+200D U+2642 MAN CARTWHEELING
🤸‍♀️ - U+1F938 U+200D U+2640 WOMAN CARTWHEELING
🫎 - U+1FACE MOOSE
🍛 - U+1F35B CURRY RICE
🛹 - U+1F6F9 SKATEBOARD
🎰 - U+1F3B0 SLOT MACHINE
👙 - U+1F459 BIKINI
📶 - U+1F4F6 ANTENNA BARS
🛜 - U+1F6DC WIRELESS
🇱🇮 - U+1F1F1 U+1F1EE FLAG: LIECHTENSTEIN
🇲🇷 - U+1F1F2 U+1F1F7 FLAG: MAURITANIA
🇳🇮 - U+1F1F3 U+1F1EE FLAG: NICARAGUA
🇵🇫 - U+1F1F5 U+1F1EB FLAG: FRENCH POLYNESIA
2022-09-24 08:39:48 +01:00
MacDue f5052e5017 LibWeb: Don't trigger page_did_layout() on non-active documents
PageHost assumes page_did_layout() to be called when the layout
of the active document changes, however, it seems that sometimes
the layout can change on another document before the layout of
the active document has been calculated. This leads to a VERIFY()
being hit.

This commit now makes it so page_did_layout() is only called when
the document is the active document.

Fixes #15328
2022-09-24 00:38:10 +02:00
Xexxa 29260d1480 Base: Add more emoji
🦒 - U+1F992 GIRAFFE
🦚 - U+1F99A PEACOCK
🌷 - U+1F337 TULIP
♠️ - U+2660 SPADE SUIT
♥️ - U+2665 HEART SUIT
♦️ - U+2666 DIAMOND SUIT
♣️ - U+2663 CLUB SUIT
👗 - U+1F457 DRESS
🇭🇰 - U+1F1ED U+1F1F0 FLAG: HONG KONG SAR CHINA
2022-09-23 22:35:10 +01:00
Xexxa d3cf06deba Base: Adjust size of more emoji flags
🇦🇴 - U+1F1E6 U+1F1F4 FLAG: ANGOLA
🇦🇼 - U+1F1E6 U+1F1FC FLAG: ARUBA
🇦🇽 - U+1F1E6 U+1F1FD FLAG: ÅLAND ISLANDS
🇧🇪 - U+1F1E7 U+1F1EA FLAG: BELGIUM
🇧🇫 - U+1F1E7 U+1F1EB FLAG: BURKINA FASO
🇧🇮 - U+1F1E7 U+1F1EE FLAG: BURUNDI
🇧🇻 - U+1F1E7 U+1F1FB FLAG: BOUVET ISLAND
🇧🇼 - U+1F1E7 U+1F1FC FLAG: BOTSWANA
🇨🇩 - U+1F1E8 U+1F1E9 FLAG: CONGO - KINSHASA
🇨🇬 - U+1F1E8 U+1F1EC FLAG: CONGO - BRAZZAVILLE
🇨🇭 - U+1F1E8 U+1F1ED FLAG: SWITZERLAND
🇨🇮 - U+1F1E8 U+1F1EE FLAG: CÔTE D’IVOIRE
🇪🇭 - U+1F1EA U+1F1ED FLAG: WESTERN SAHARA
🇫🇴 - U+1F1EB U+1F1F4 FLAG: FAROE ISLANDS
🇮🇶 - U+1F1EE U+1F1F6 FLAG: IRAQ
🇯🇴 - U+1F1EF U+1F1F4 FLAG: JORDAN
🇰🇿 - U+1F1F0 U+1F1FF FLAG: KAZAKHSTAN
🇱🇦 - U+1F1F1 U+1F1E6 FLAG: LAOS
🇱🇧 - U+1F1F1 U+1F1E7 FLAG: LEBANON
🇱🇨 - U+1F1F1 U+1F1E8 FLAG: ST. LUCIA
🇱🇷 - U+1F1F1 U+1F1F7 FLAG: LIBERIA
🇲🇿 - U+1F1F2 U+1F1FF FLAG: MOZAMBIQUE
🇸🇩 - U+1F1F8 U+1F1E9 FLAG: SUDAN
🇸🇳 - U+1F1F8 U+1F1F3 FLAG: SENEGAL
🇸🇹 - U+1F1F8 U+1F1F9 FLAG: SÃO TOMÉ & PRÍNCIPE
🇹🇱 - U+1F1F9 U+1F1F1 FLAG: TIMOR-LESTE
🇹🇹 - U+1F1F9 U+1F1F9 FLAG: TRINIDAD & TOBAGO
🇻🇳 - U+1F1FB U+1F1F3 FLAG: VIETNAM
2022-09-23 22:35:10 +01:00
Luke Wilde 7b8a6b8e7a LibWeb: Set HTMLParser::m_scripting_enabled as according to the spec
This allows <noscript> elements to display their content as proper HTML
instead of raw text when scripting is disabled.
2022-09-23 22:25:09 +01:00
Luke Wilde dfe57543a4 LibWeb: Keep message alive in postMessage task callback lambda
Tasks can run at any time in the future and GC can run in the time
between postMessage and running the task, meaning the message can be
reaped if we don't keep a handle to it.

Fixes Google Syndication ads crashing 100% of the time on rpcs3.net
2022-09-23 17:23:55 +01:00
Liav A f46cc90f82 Documentation: Add a document about the Kernel IOWindow concept 2022-09-23 17:22:15 +01:00
Liav A 05ba034000 Kernel: Introduce the IOWindow class
This class is intended to replace all IOAddress usages in the Kernel
codebase altogether. The idea is to ensure IO can be done in
arch-specific manner that is determined mostly in compile-time, but to
still be able to use most of the Kernel code in non-x86 builds. Specific
devices that rely on x86-specific IO instructions are already placed in
the Arch/x86 directory and are omitted for non-x86 builds.

The reason this works so well is the fact that x86 IO space acts in a
similar fashion to the traditional memory space being available in most
CPU architectures - the x86 IO space is essentially just an array of
bytes like the physical memory address space, but requires x86 IO
instructions to load and store data. Therefore, many devices allow host
software to interact with the hardware registers in both ways, with a
noticeable trend even in the modern x86 hardware to move away from the
old x86 IO space to exclusively using memory-mapped IO.

Therefore, the IOWindow class encapsulates both methods for x86 builds.
The idea is to allow PCI devices to be used in either way in x86 builds,
so when trying to map an IOWindow on a PCI BAR, the Kernel will try to
find the proper method being declared with the PCI BAR flags.
For old PCI hardware on non-x86 builds this might turn into a problem as
we can't use port mapped IO, so the Kernel will gracefully fail with
ENOTSUP error code if that's the case, as there's really nothing we can
do within such case.

For general IO, the read{8,16,32} and write{8,16,32} methods are
available as a convenient API for other places in the Kernel. There are
simply no direct 64-bit IO API methods yet, as it's not needed right now
and is not considered to be Arch-agnostic too - the x86 IO space doesn't
support generating 64 bit cycle on IO bus and instead requires two 2
32-bit accesses. If for whatever reason it appears to be necessary to do
IO in such manner, it could probably be added with some neat tricks to
do so. It is recommended to use Memory::TypedMapping struct if direct 64
bit IO is actually needed.
2022-09-23 17:22:15 +01:00
Liav A 6bafbd64e2 Kernel/Memory: Introduce a method to allocate TypedMapping on the heap
This will be used later on to allocate such structure on the heap when
it is necessary to do so.
2022-09-23 17:22:15 +01:00
Liav A fe2bd8e3dd Kernel: Move x86-specific timer code handling to Arch/x86/Time directory
The APICTimer, HPET and RTC (the RTC timer is in the context of the PC
RTC here) are timers that exist only in x86 platforms, therefore, we
move the handling code and the initialization code to the Arch/x86/Time
directory. Other related code patterns in the TimeManagement singleton
and in the Random.cpp file are guarded with #ifdef to ensure they are
only compiled for x86 builds.
2022-09-23 17:22:15 +01:00
Liav A 48f3d762af Kernel/Graphics: Move x86-specific support for VGA to Arch/x86 directory
The new VGAIOArbiter class is now responsible to conduct x86-specific
instructions to control VGA hardware from the old ISA ports. This allows
us to ensure the GraphicsManagement code doesn't use x86-specific code,
thus allowing it to be compiled within non-x86 kernel builds.
2022-09-23 17:22:15 +01:00
Joel Hansen 8b9c056c5a Base: Modify Check Box emoji
Make it look more like the SerenityOS checkbox.
2022-09-23 16:03:54 +01:00
Joel Hansen f4cea4139f Base: Add emoji
- U+1F0CF Joker 🃏
- U+1F3AB Ticket 🎫
- U+1F5DC Clamp 🗜️
- U+1F48D Ring 💍
- U+1F371 Bento Box 🍱
- U+1F380 Ribbon 🎀
- U+1F436 Dog Face 🐶
- U+1F518 Radio Button 🔘
- U+1F528 Hammer 🔨
- U+1F531 Trident Emblem 🔱
- U+1FA74 Thong Sandal 🩴
- U+2622 Radioactive ☢️
2022-09-23 16:03:54 +01:00
Liav A 36f2e85823 WindowServer: Fix mapping the correct framebuffer size
If we don't support double buffering for a certain type of hardware,
don't try to map with size calculated with (pitch * height * 2), as it
will result in trying to map more memory than is available in the
framebuffer memory range.
2022-09-23 14:04:00 +01:00
Linus Groh 76ace3629a LibWeb: Make Fetch::Infrastructure::Body::stream() const 2022-09-22 21:01:13 +01:00
Linus Groh c7c6d7d9e1 LibWeb: Make FileAPI::Blob::create() buffer/type overload infallible 2022-09-22 21:01:13 +01:00
Linus Groh 54a987ad45 LibWeb: Update extract_body() to use BodyInit 2022-09-22 21:01:13 +01:00
Linus Groh 8f5620b5d9 LibWeb: Add BodyInit union type 2022-09-22 21:01:13 +01:00
Linus Groh 571f4e3ebb LibWeb: Move extract_body() into Fetch 2022-09-22 21:01:13 +01:00
Linus Groh f98ce156c4 LibWeb: Remove ReadableStreamDummy in favor of ReadableStream 2022-09-22 21:01:13 +01:00
Linus Groh 87654f5b51 LibWeb: Start fleshing out the ReadableStream interface
This is so we can just assume it exists in Fetch APIs (while still
skipping functionality that relies on a full implementation, of
course).
2022-09-22 21:01:13 +01:00
Linus Groh 1ace80235b LibWeb: Move XMLHttpRequestBodyInit into Fetch
https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
2022-09-22 21:01:13 +01:00
thankyouverycool 1bba8589fe LibGUI: Hide unnecessary Scrollbars in ComboBox windows
And simplify rect calculations using content size.
2022-09-22 21:37:26 +02:00
thankyouverycool 7858f885fe LibGUI: Update ListView content size on relevant layout changes
Fixes incorrect content sizing when unnecessary scrollbars are hidden.
2022-09-22 21:37:26 +02:00
thankyouverycool 8b4bf96db3 LibGUI: Apply horizontal padding evenly for ListView items 2022-09-22 21:37:26 +02:00