Commit Graph

14 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
46c98dbf43 LibWeb: Use device pixels to translate NestedBrowsingContextPaintable
Fix translation of iframes when pixel size is not 1.0.
2023-04-20 20:44:02 +02:00
Andreas Kling
d8ccc2d54e LibWeb: Rename BrowsingContextContainer => NavigableContainer
The "browsing context container" concept in the HTML spec has been
replaced with "navigable container". Renaming this is the first step of
many towards implementing the new world.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-19 18:26:45 +02:00
Andreas Kling
7e76a51cb0 LibWeb: Rename Layout::InitialContainingBlock to Layout::Viewport
The name "initial containing block" was wrong for this, as it doesn't
correspond to the HTML element, and that's specifically what it's
supposed to do! :^)
2023-02-28 12:21:56 +01:00
Andreas Kling
4d401bf796 LibWeb: Make the paint tree GC-allocated
This simplifies the ownership model between DOM/layout/paint nodes
immensely by deferring to the garbage collector for figuring out what's
live and what's not.
2023-01-11 12:55:00 +01:00
Sam Atkins
affc8a22ca LibWeb+WebContent: Convert BrowsingContext to new pixel units
This fixes a few glitches. We no longer give the page double the width
it should have, and we mark the correct area of the page as needing
repainting.
2023-01-05 17:42:31 +01:00
Sam Atkins
ab49dbf137 LibWeb: Convert Paintable coordinates to new pixel units
This fixes a few sizing issues too. The page size is now correct in most
cases! \o/

We get to remove some of the `to_type<>()` shenanigans, though it
reappears in some other places.
2022-12-14 16:47:57 +00:00
Sam Atkins
0bf4089af9 LibWeb: Convert border painting to new pixel units 2022-12-14 16:47:57 +00:00
Sam Atkins
4440af0870 LibWeb: Split PaintContext::viewport_rect() into device/css variants
For now, everyone uses `device_viewport_rect()`, until I convert them.
2022-12-14 16:47:57 +00:00
Andreas Kling
94d54069f4 LibWeb: Don't paint non-visible frames
This fixes an issue where iframes hidden with CSS `visibility: none`
would still be visible.
2022-08-05 12:46:42 +02:00
MacDue
b68f48eb71 LibWeb: Shrink the inner border radii to accommodate the border widths
This fixes the shape of the subreddit logo on new reddit.
2022-07-26 23:56:29 +01:00
MacDue
b179d514d9 LibWeb: Support adding a border-radius to <iframe> elements 2022-07-04 23:09:06 +02:00
Andreas Kling
ed84fbce47 LibWeb: Make Paintable ref-counted
This will allow us to use a protective NonnullRefPtr to keep paintables
alive while running arbitrary JavaScript in response to events.
2022-03-11 00:21:49 +01:00
Andreas Kling
053766d79c LibWeb: Split Paintable into Paintable and PaintableBox
To prepare for paintable inline content, we take the basic painting
functionality and hoist it into a base class.
2022-03-11 00:21:49 +01:00
Andreas Kling
02b316fd5c LibWeb: Let Paintable perform the painting
This patch adds a bunch of Paintable subclasses, each corresponding to
the Layout::Node subclasses that had a paint() override. All painting
logic is moved from layout nodes into their corresponding paintables.

Paintables are now created by asking a Layout::Box to produce one:

    static NonnullOwnPtr<Paintable> Layout::Box::create_paintable()

Note that inline nodes still have their painting logic. Since they
are not boxes, and all paintables have a corresponding box, we'll need
to come up with some other solution for them.
2022-03-11 00:21:49 +01:00