Age | Commit message (Collapse) | Author |
|
It wasn't the content height, but rather the the bottom edge of the
lowest margin box.
|
|
|
|
Let's make 16px the default font size instead of 10px. This makes our
layout results match those of other engines in many more cases.
Also make the h1-h6 element styles use relative (em) font sizes, also
matching other browsers.
|
|
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.
|
|
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.
|
|
load_any_resources() may get called multiple times during layout, but
once we've started a resource load, we don't need to do it again.
|
|
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.
|
|
We were doing this:
max(0, some_floating_point_value)
This returns an `int` result based on the type of `0`, oops!
|
|
|
|
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.
|
|
Now that EventTarget is GC-allocated, it can find the GC heap by just
calling heap() on itself, no need to get this via the internal realm.
|
|
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.
|
|
This ensures that code currently in any active or saved execution stack
always stays alive.
|
|
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.
|
|
No interfaces require wrappers anymore, so we can just make this the
default mode.
|
|
|
|
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.
|
|
This macro will soon go away, but let's start by replacing all the
hand-coded versions of wrap() with this macro that expands to the same
exact thing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Allocations go in initialize().
|
|
Allocations should happen in the initialize() virtual, so move it there.
|
|
Unlike ensure_web_prototype<T>(), the cached version doesn't require the
prototype type to be fully formed, so we can use it without including
the FooPrototype.h header. It's also a bit less verbose. :^)
|
|
|