Instead of hard-coding the names of system fonts to use for the CSS
generic fonts (like "sans-serif", "monospace", etc.) we now call out
to a Platform::FontPlugin and ask for the generic names.
We didn't set their display at all before, and since CSS display is not
inherited, anonymous block wrappers were actually "display: inline", but
it kinda worked anyway because we positioned blocks based on their C++
class (BlockContainer) rather than their CSS display value.
Now that we position based on CSS display value, this broke positioning
of anonymous wrapper blocks, and this fixes that.
Instead of letting buttons determine the relative position
of their menus, a workaround only used by Statusbar segments,
open them all uniformly for a nice, consistent UI.
Passing a rect to popup() now routes to open_button_menu(), an
analog to open_menubar_menu(), which adjusts the menu's popup
position in the same way. Fixes button menus obscuring the buttons
which spawn them and jutting out at odd corners depending on screen
position.
in exclusive, checkable groups. Instead of merely setting the
button checked, call click() so buttons with registered actions
can activate. Fixes ActionGroups like FileManager's view type
checkables not activating when cycled with the keyboard.
Unlike regular buttons, unchecked checkables don't need to repaint
on MouseUp to feel responsive when clicking rapidly. In fact, this
can lead to a flickering effect when a bogus unchecked state gets
painted again before the button's checked one.
This adds two new icons for browser context menu items "Close Other
Tabs" and "Download".
This adds existing icons where they were missing in context menu items.
Before this change, block-level boxes were laid out vertically by
placing them after the nearest previous BlockContainer sibling. This
only worked if the preceding block-level box happened to be a
BlockContainer.
This fixes an issue where the screenshot on netsurf-browser.org was not
being laid out properly (it was `img { display: block }` which creates
a block-level ImageBox, and ImageBox is not a BlockContainer but a
ReplacedBox, so the following block-level box was skipping over the
ImageBox and being placed next to whatever was before the ImageBox..)
Instead of calling Core::EventLoop directly, LibJS now has a virtual
function on VM::CustomData for customizing this behavior.
We use this in LibWeb to plumb the spin request through to the
PlatformEventPlugin.
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now
goes through a Web::Platform abstraction layer instead.
This will allow us to plug in Qt's event loop (and QTimer) over in
Ladybird, to avoid having to deal with multiple event loops.
We were constantly measuring and re-measuring the "alt" attribute text
of ImageBox layout nodes, even when the alt text didn't change. By
caching this, we avoid a *lot* of repeated text measurement work.
- Use the border box of the floated element when testing if something
needs to flow around it.
- Take the floated element's containing block size into account (instead
of the BFC root) when calculating available space on a line where a
right-side float intrudes.
To prevent lag when the displayed code points are redrawn in support of
a search box, only create the GUI::Button objects for the emoji a single
time. Re-use those buttons when adding them to the dialog.
This will allow easily adding components such as a search box. Also,
increase the number of emoji per row. This does not fix the issue where
too many emoji will cause the dialog to grow limitlessly, but it looks a
bit more reasonable now with the number of emoji that we have.
Our bilinear scaling logic worked well for upscaling, but during
downscaling the bitmap was often shifted one pixel to the bottom right.
This is a common problem, described here in more detail:
https://bartwronski.com/2021/02/15/bilinear-down-upsampling-pixel-grids-and-that-half-pixel-offset/
Fix it by calculating coordinate shift values that align the pixel's
boundaries between the source and target pixels before selecting the
source pixels to interpolate.
Previously we allowed entering any day value greater than one. With this
patch the maximum input value is dynamic based on the selected month and
year.
This adds icons for folder paths ending in ".git". This adds 16x16 and
32x32 versions of a folder with a Git logo for both the closed and open
versions of the folder icon.
This allows JS::Script to mark its corresponding HTML::Script, even if
it's a little roundabout looking. Fixes an issue where the JS::Script
was kept alive by the execution stack, but the HTML::Script was gone.
This was originally part of 8f9ed415a0
but got lost in a merging accident.
Instead, use the window object from the context element. This fixes an
issue where activating event handlers during fragment parsing would try
to set up callbacks using the internal window object's ESO.
This caused a verify_cast crash on Google Maps, since the internal realm
doesn't have an associated ESO. Perhaps it should, but in this specific
case, it makes more sense for fragment parsing to fully adopt the
context provided.
This allows the garbage collector to keep HTML::Script objects alive and
fixes a bug where a HTMLScriptElement could get GC'd while its code was
executing.
Workers don't have a document, so we can't ask them if scripting is
enabled or not. This is not the right long-term fix, but it fixes an
assertion when trying to query the missing responsible document of a
web worker.
This is *not* according to spec, however we currently store prototypes
and constructors on Window, so the only way for objects in a worker
context to become fully formed is to make a Window.
Long-term we should clean this up and remove the worker window object,
but for now it allows workers to exist without asserting.
There are still some remaining cases where generated code depends on the
existence of FooWrapper => Web::NS::Foo mappings. Fixing those will
require figuring out the appropriate namespace for all IDL types, not
just the currently parsed interface.
wrap() is now basically a no-op so we should stop using it everywhere
and eventually remove it. This patch removes uses of wrap() in
non-generated code.