summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2022-09-08LibWeb: Rename confusing parameter to layout_block_level_box()Andreas Kling
It wasn't the content height, but rather the the bottom edge of the lowest margin box.
2022-09-08LibWeb: Use correct box edge when looking for space between floatsAndreas Kling
2022-09-08LibWeb: Make default CSS font settings match other browsers betterAndreas Kling
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.
2022-09-08LibWeb+WebContent: Add abstraction layer for generic font familiesAndreas Kling
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.
2022-09-08LibWeb: Make anonymous wrapper blocks actually have "display: block"Andreas Kling
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.
2022-09-08LibWeb: Position blocks after previous block-level box, ignoring typeAndreas Kling
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..)
2022-09-08LibJS+LibWeb: Spin event loop via VM::CustomData abstractionAndreas Kling
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.
2022-09-07LibWeb+WebContent: Add abstraction layer for event loop and timersAndreas Kling
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.
2022-09-07LibWeb: Only schedule ImageStyleValue resource load onceAndreas Kling
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.
2022-09-07LibWeb: Cache width of "alt" text in ImageBoxAndreas Kling
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.
2022-09-07LibWeb: Improve `float: right` behaviorAndreas Kling
- 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.
2022-09-07LibWeb: Fix three accidental float truncationsAndreas Kling
We were doing this: max(0, some_floating_point_value) This returns an `int` result based on the type of `0`, oops!
2022-09-06LibWeb: Remove unused WindowObject.hAndreas Kling
2022-09-06LibWeb: Don't use the internal window object when parsing HTML fragmentsAndreas Kling
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.
2022-09-06LibWeb: Remove some unnecessary use of the internal realm in EventTargetAndreas Kling
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.
2022-09-06LibJS+LibWeb: Make HTML::Script GC-allocatedAndreas Kling
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.
2022-09-06LibJS: Make Script and Module GC-allocatedAndreas Kling
This ensures that code currently in any active or saved execution stack always stays alive.
2022-09-06LibWeb: Always allow scripting in workers for nowAndreas Kling
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.
2022-09-06LibWeb: Give web workers a (totally hacky) Window objectAndreas Kling
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.
2022-09-06LibWeb: Remove the NoInstanceWrapper extended IDL attributeAndreas Kling
No interfaces require wrappers anymore, so we can just make this the default mode.
2022-09-06LibWeb: Remove now-unused Bindings::wrap()Andreas Kling
2022-09-06LibWeb: Stop using Bindings::wrap() in a bunch of placesAndreas Kling
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.
2022-09-06LibWeb: Use the WRAPPER_HACK() macro instead of hand-coding wrap()Andreas Kling
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.
2022-09-06LibWeb: Remove now-unused Bindings::Wrapper classAndreas Kling
2022-09-06LibWeb: Remove now-unused Bindings::Wrappable classAndreas Kling
2022-09-06LibWeb: Remove the NO_INSTANCE option now that all wrappers are goneAndreas Kling
2022-09-06LibWeb: Make DOMException GC-allocatedAndreas Kling
2022-09-06LibWeb: Make LocationObject a PlatformObjectAndreas Kling
2022-09-06LibWeb: Make WorkerNavigator GC-allocatedAndreas Kling
2022-09-06LibWeb: Make WorkerLocation GC-allocatedAndreas Kling
2022-09-06LibWeb: Make IntersectionObserver GC-allocatedAndreas Kling
2022-09-06LibWeb: Make URL, URLSearchParams & URLSearchParamsIterator GC-allocatedAndreas Kling
2022-09-06LibWeb: Make ResizeObserver GC-allocatedAndreas Kling
2022-09-06LibWeb: Make IdleDeadline GC-allocatedAndreas Kling
2022-09-06LibWeb: Make Selection GC-allocatedAndreas Kling
2022-09-06LibWeb: Make Crypto GC-allocatedAndreas Kling
2022-09-06LibWeb: Make Headers and HeadersIterator GC-allocatedAndreas Kling
2022-09-06LibWeb: Make Blob and File GC-allocatedAndreas Kling
2022-09-06LibWeb: Make TextDecoder GC-allocatedAndreas Kling
2022-09-06LibWeb: Make TextEncoder GC-allocatedAndreas Kling
2022-09-06LibWeb: Make DOMRect, DOMRectReadOnly and DOMRectList GC-allocatedAndreas Kling
2022-09-06LibWeb: Make DOMPoint and DOMPointReadOnly GC-allocatedAndreas Kling
2022-09-06LibWeb: Remove unused HTML::Window::create_with_document()Andreas Kling
2022-09-06LibWeb: Make SubtleCrypto GC-allocatedAndreas Kling
2022-09-06LibWeb: Make Storage GC-allocatedAndreas Kling
2022-09-06LibWeb: Use target's global object when creating focus/blur eventsAndreas Kling
2022-09-06LibWeb: Don't allocate DOMStringMap in HTMLElement constructorAndreas Kling
Allocations go in initialize().
2022-09-06LibWeb: Don't allocate NamedNodeMap in Element constructorAndreas Kling
Allocations should happen in the initialize() virtual, so move it there.
2022-09-06LibWeb: Use cached_web_prototype() as much as possibleAndreas Kling
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. :^)
2022-09-06LibWeb: Add some missing constructors to the Window objectAndreas Kling