Commit graph

41555 commits

Author SHA1 Message Date
MacDue c0eda77928 Base: Add paint effects with opacity/transforms HTML test cases 2022-09-25 18:37:31 +02:00
MacDue e3537e4374 LibWeb: Fix shadow painting when the target painter is translated 2022-09-25 18:37:31 +02:00
MacDue 3fad64dfbc LibWeb: Sample the destination when painting element opacity/transform
This now copies the area under the destination to a new bitmap, that
is then scaled to the size of the source. The element is then painted
into that bitmap, which is then scaled and painted back to
the destination. This is done as many effects such as shadows, border
radii, filters, etc require being able to read pixels from the painter.

This does work (and is not that noticeable in many cases), but it does
mean there may be a few scaling artifacts in the background
around transformed elements. Though that was already the case before
anyway for the elements (since it is just a bitmap scale).

What we really want is to (where possible) just scale the paintable
and its descendants, then paint things normally, which would give
much nicer results (but is much more tricky to achieve).

This also now makes it so only a bitmap of the size of the paintable is
copied/created, rather than the whole page.
2022-09-25 18:37:31 +02:00
MacDue 8967fe9d92 LibWeb: Add PaintableBox::absolute_paint_rect()
This method returns the total area this element will paint to.
Currently, this just means accounting for box-shadows, though
there are likely more effects that need to be accounted for here.
2022-09-25 18:37:31 +02:00
Andreas Kling 0843960235 LibWeb: Use CSS::Size for computed size and max-size values
This patch changes the *computed* representation of the following CSS
properties to use CSS::Size:

- width, min-width, max-width
- height, min-height, max-height

A few things had to change in order for things to keep working,
but I tried to keep the diff to a minimum.

The main trouble was that `min-width` and `max-width` can't actually be
`auto`, but they *can* be `none`. We previously treated `auto` as a
valid value (and it behaved mostly like `none`).
2022-09-25 17:51:43 +02:00
Andreas Kling 844321d89f LibWeb: Teach CSS::StyleProperties to create CSS::Size values
You can now use StyleProperties::size_value(CSS::PropertyID) to extract
a CSS::Size for a given property.
2022-09-25 17:51:43 +02:00
Andreas Kling ba78fe008f LibWeb: Add CSS::Size to represent the full range of CSS size values
Until now, we've been using CSS::LengthPercentage, sometimes wrapped in
Optional, to represent CSS sizes.

This meant we could not support modern values like `min-content`,
`max-content`, `fit-content(<length>)`. We were also conflating `none`
and `auto` which made the `min-*` and `max-*` properties confusing.

The new CSS::Size class covers all possible size values as individual
substates. It'll be quite a bit of work to make all layout code aware of
the additional features, this patch merely makes the new type available.
2022-09-25 17:51:43 +02:00
Idan Horowitz 04b1d32b70 Kernel: Stop using 'int's for indices in interrupt handling 2022-09-25 16:52:56 +03:00
Idan Horowitz 6f6211c5e6 Kernel: Simplify InterruptManagement::switch_to_pic_mode()
Since switch_to_pic_mode is only called if no IOAPIC is available,
there's no need to try and and find it and disable it.
2022-09-25 16:52:56 +03:00
Idan Horowitz 9abbeff79f Kernel: Store IRQControllers in NonnullRefPtrs instead of RefPtrs
These are always non-null, so there's no point in storing them in a
nullable container.
2022-09-25 16:52:56 +03:00
Idan Horowitz 176989d811 Kernel: Use InterruptManagement::m_interrupt_controllers::append()
There's no need to reinvent the wheel.
2022-09-25 16:52:56 +03:00
Idan Horowitz 746bf12ac4 Kernel: Remove unused InterruptManagement::m_smp_enabled 2022-09-25 16:52:56 +03:00
networkException 4d5a0f1af3 Base: Improve U+1F92F emoji
Previously the emoji looked more like a chef with moustache and hat
instead of a wide open mouth and mushroom cloud :^)
2022-09-25 12:30:34 +02:00
Andreas Kling 022a49e9ac LibWeb: Only notify PageClient about top-level browsing context loads
We don't need to notify the web views that some deeply nested iframe
has started loading a new URL (and we don't want it showing up in the
browser location bar either!)
2022-09-25 12:28:40 +02:00
Andreas Kling d89dc6e24c LibGUI: Add Model::unsafe_create_index()
This will be used by Ladybird to translate between LibGUI and Qt models.
2022-09-25 12:16:12 +02:00
Andreas Kling 05985b51f2 LibWebView: Make DOMTreeModel usable outside of SerenityOS
Two issues made this class unusable on other platforms:
- Hardcoded /res paths to icons
- It required a GUI::TreeView for palette access

This patch simply patches out those features on non-Serenity systemsf
for now.
2022-09-25 12:11:02 +02:00
Andreas Kling 34c232def7 Lagom: Build DOMTreeModel from LibWebView
This will be used in Ladybird.
2022-09-25 12:10:28 +02:00
Andreas Kling 5778da765d Lagom: Build a tiny slice of LibGUI
We now build Model, ModelIndex and Icon from LibGUI. These will be used
in Ladybird to view the DOM tree model.
2022-09-25 12:09:36 +02:00
Andreas Kling f36cbd3b65 LibWeb: Invalidate layout when a DOM node is removed from the tree 2022-09-25 02:26:36 +02:00
Andreas Kling 5c6621547c LibWeb: Compute StackingContext transform origin only once
When mousing over twitter, 17% of time was spent computing stacking
context transform origins. Since this never changes after the stacking
context is created, we can cache it and avoid all that work.
2022-09-24 23:06:09 +02:00
thankyouverycool 901b80f988 LibGUI: Update calculated_min_size() for TextEditor
Defer to AbstractScrollableWidget when TextEditor is multi-line.
Otherwise, as "vertical_content_size" was unused, simply return
margins for now.
2022-09-24 22:59:12 +02:00
thankyouverycool 961a225316 LibGUI: Include scrubber and gutter in Scrollbar's calculated_min_size() 2022-09-24 22:59:12 +02:00
thankyouverycool b50bce3cb9 LibGUI: Don't draw Scrollbar button triangles if they'd be off-center 2022-09-24 22:59:12 +02:00
thankyouverycool cbd9cf93be LibGUI: Implement calculated_min_size() for StackWidget 2022-09-24 22:59:12 +02:00
thankyouverycool f0a5ce6d11 LibGUI: Implement calculated_min_size() for ListView 2022-09-24 22:59:12 +02:00
thankyouverycool d495405e53 LibGUI: Implement calculated_min_size() for AbstractScrollableWidget 2022-09-24 22:59:12 +02:00
martinfalisse 521e19444c LibWeb: Make CSS Grid work again
Fixes bug after the automatic_content_height() changes where the height
of the grid container was not being calculated correctly.
2022-09-24 20:57:28 +02:00
hashem78 69d86a60e5 Base: Remove extraneous pixels from msgbox-question.png 2022-09-24 20:57:19 +02:00
Linus Groh 2b2ccb3815 LibWeb: Replace 'heycam.github.io' links with 'webidl.spec.whatwg.org' 2022-09-24 19:32:09 +01:00
Linus Groh 56d8c4ff26 LibWeb: Move WindowProxy from Bindings/ to HTML/ 2022-09-24 19:31:39 +01:00
Linus Groh 86f68eb3c3 LibWeb: Move IDLOverloadResolution from Bindings/ to WebIDL/ 2022-09-24 19:31:39 +01:00
Linus Groh 6480faacb6 LibWeb: Move IDLAbstractOperations from Bindings/ to WebIDL/ 2022-09-24 19:31:39 +01:00
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