summaryrefslogtreecommitdiff
path: root/Ladybird
AgeCommit message (Collapse)Author
2023-05-27Ladybird+Tests/LibWeb: Add very basic text-only test harnessAndreas Kling
This allows us to create "text tests" in addition to "layout tests". Text tests work the same as layout tests, but dump the document content as text and exit upon receiving the window "load" event.
2023-05-25Ladybird: Add shortcut to "Close Current Tab"Xexxa
2023-05-25Ladybird: Move "Settings" from "File" to "Edit"Xexxa
2023-05-25Ladybird: Add missing iconsXexxa
2023-05-24Ladybird: Use cursor position for context menuKarthik Karanth
2023-05-23LibGfx+Everywhere: Change `Gfx::Rect` to be endpoint exclusiveJelle Raaijmakers
Previously, calling `.right()` on a `Gfx::Rect` would return the last column's coordinate still inside the rectangle, or `left + width - 1`. This is called 'endpoint inclusive' and does not make a lot of sense for `Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would return 4 as its right side. This same problem exists for `.bottom()`. This changes `Gfx::Rect` to be endpoint exclusive, which gives us the nice property that `width = right - left` and `height = bottom - top`. It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly the same. All users of `Gfx::Rect` have been updated accordingly.
2023-05-23Ladybird: Default to HTTPS instead of HTTP if no protocol is specifiedAndreas Kling
2023-05-23Ladybird: Select all text in LocationEdit on clickRafaΕ‚ Babiarz
2023-05-21Ladybird: Remove unused IODevice.h includeBen Wiederhake
2023-05-17Browser+Ladybird+LibWebView: Handle trivial content APIs in LibWebViewTimothy Flynn
The goal here is to reduce the amount of WebContent client APIs that are duplicated across every ViewImplementation. Across our three browsers, we currently: Ladybird - Mix some AK::Function callbacks and Qt signals to notify tabs of WebContent events. Browser - Use only AK::Function callbacks. headless-browser - Drop most events on the floor. Instead, let's only use AK::Function callbacks across all three browsers to propagate events to tabs. This allows us to invoke those callbacks directly from LibWebView instead of all three browsers needing to define a trivial `if (callback) callback();` override of a LibWebView virtual function. For headless-browser, we can simply not set these callbacks. As a first pass, this only converts WebContent events that are trivial to this approach. That is, events that were simply passed onto the tab or handled without much fuss.
2023-05-17Ladybird: Move ownership of the JS console/inspector to the tab objectTimothy Flynn
This is to match Browser, where ownership of all "subwidgets" is placed on the tab as well. This further lets us align the web view callbacks to match Browser's OOPWV as well, which will later let us move them into the base LibWebView class.
2023-05-17Browser+Ladybird+LibWebView: Virtualize computing content/widget pointsTimothy Flynn
This will allow moving some copy-pasted functionality from web view implementations to the base LibWebView class.
2023-05-17Ladybird: Remove unused JS console methodsTimothy Flynn
Note that the real implementations of these functions are: notify_server_did_output_js_console_message notify_server_did_get_js_console_messages Which have the same method bodies as these unused variants.
2023-05-17Browser+Ladybird+LibWebView: Move some common functions to LibWebViewTimothy Flynn
The implementations of handle_web_content_process_crash and take_screenshot are exactly the same across Browser and Ladybird. Let's reduce some code duplication and move them to LibWebView.
2023-05-16Ladybird: Fix context menus being in slightly the wrong positionMacDue
Previously, we were doing mapToGlobal() via the Tab widget, but the widget position was actually relative to the WebContentView. This meant context menus appeared slightly vertically offset from where you clicked.
2023-05-16Ladybird: Add screenshot actions to the page context menuTimothy Flynn
Browser on Serenity has these actions already.
2023-05-16Ladybird: Add a context menu for image elementsTimothy Flynn
2023-05-16Ladybird: Add a context menu for link elementsTimothy Flynn
2023-05-16Ladybird: Add a context menu for video elementsTimothy Flynn
2023-05-16Ladybird: Move the page context menu from the BrowserWindow to the TabTimothy Flynn
This will allow us to show different context menus depending on what element is clicked, much like we do for Browser on Serenity.
2023-05-16Browser+LibWeb+WebContent: Broadcast video element context menu requestsTimothy Flynn
This just sets up the IPC to notify the browser process of context menu requests on video elements. The IPC contains a few pieces of information about the state of the video element.
2023-05-15Ladybird+LibWebView: Move backing store management code to LibWebViewAndreas Kling
This lets us share this code on all platforms, and makes resizing the window much faster on SerenityOS as well. :^)
2023-05-15Ladybird: Make resizing the window a lot less laggyAndreas Kling
While resizing, we now pad the shared bitmap allocations with 256 pixels extra in both axes. This avoids churning through huge allocations for every single resize step. We also don't reallocate at all when making the window smaller. 3 seconds after the user stops resizing, we resize the backing stores again so they fit the window perfectly.
2023-05-15Ladybird: Only request repaint for what's in the visible viewportAndreas Kling
Before this change, we asked WebContent to fill the whole shared bitmap with content, even if we couldn't show it all in the viewport.
2023-05-15Ladybird+LibWebView: Remember the size of the last paintAndreas Kling
This will allow us to change the size of the backing store bitmap without conflating the size of the bitmap and the size of the paint.
2023-05-15Ladybird: Floor the WebContentView viewport offset at 0, 0Andreas Kling
This fixes an unpleasant visual glitch when resizing the window. When the user makes our QAbstractScrollArea larger, the scroll bars can end up with negative values, which we were happily forwarding to the WebContent process and asking it to paint the whole page at an offset.
2023-05-14Ladybird: Send the double click event to WebContentLuke Wilde
2023-05-13Ladybird: Add common handy actions to context menuMacDue
This commit adds the common actions you'd expect to the Ladybird context menu, arranged like so: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Go Back Alt+Left β”‚ β”‚ Go Forward Alt+Right β”‚ β”‚ Reload Ctrl+R β”‚ β”‚ ──────────────────────────── β”‚ β”‚ Copy Ctrl+C β”‚ β”‚ Select All Ctrl+A β”‚ β”‚ ──────────────────────────── β”‚ β”‚ View Source Ctrl+U β”‚ β”‚ Inspect Element β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
2023-05-13Ladybird: Disable SQL database by default (until we can trust it)Andreas Kling
The asynchronous query execution keeps causing bugs with document.cookie so let's make the SQL database backend default off until we can trust it to do what we need.
2023-05-09AK: Add the `Input` word to input-only buffered streamsLucas CHOLLET
This concerns both `BufferedSeekable` and `BufferedFile`.
2023-05-09Ladybird: Allow right clicking and inspecting elementsMacDue
This adds "Inspect Element" (currently the only entry) to the context menu for the page, which will do what you expect (most of the time), and bring up the Inspector with hovered element selected.
2023-05-08Documentation: Homogenize Ladybird build instructionsmartinfalisse
Change the file name so that it is similar to the other build instructions and may be easier to find :^).
2023-05-08LibWeb: Add `--layout-test-mode` flag to HeadlessBrowsermartinfalisse
The `layout-test-mode` flag changes the font to be SerenitySans as this is the font used for layout tests for cross-platform compatibility of tests.
2023-05-08Ladybird: Move arguments parsing before FontPluginQt initmartinfalisse
In a future commit will pass arguments parsed to the FontPluginQt constructor.
2023-05-07Ladybird: Don't ask Qt to decode any images for usMacDue
We should only rely on LibGfx to decode images for us, if LibGfx can't decode an image that should be motivation to improve LibGfx, not hidden by Qt picking up the slack :^)
2023-05-07Ladybird: Don't ask Qt to decode SVG images for usAndreas Kling
While it's nice to see <img src="foo.svg"> suddenly work in Ladybird after linking with the Qt SVG module, this is cheating. We should implement SVG-as-image ourselves instead of relying on 3rd party code to do it. :^)
2023-05-06Ladybird: Stop telling Qt to use HTTP pipeliningAndreas Kling
For some reason, this was causing incomplete HTTP loads in some cases. As an example, we would only load half of the "Ahem" CSS font from the wpt.live server when running Acid3. I only enabled pipelining in the first place because I assumed it would be a performance boost, but it appears to do more than that. I suppose there's a reason it's off by default (and most Qt API users don't bother enabling it.)
2023-05-05Ladybird: Use vector icons in the browser toolbarAndreas Kling
We now load SVG icons (via the Qt resource system) and render them into a QIcon (with normal and disabled variants) using system colors. We also re-render them if the system color theme changes. This instantly makes Ladybird look less foreign on my Linux box. I drew the icons myself, and they could definitely be more optimized, but this was my first time using Inkscape. :^)
2023-05-05Ladybird: Remove the "home" icon from the toolbar (and the concept)Andreas Kling
This feature isn't really that useful in practice, so let's remove it. (Other browsers haven't had this action for years either.)
2023-04-30Ladybird: Let WebContent know if the current system theme is darkAndreas Kling
This means we now actually respect @media (prefers-color-scheme: dark) by default when in dark mode. :^)
2023-04-27Ladybird: Prohibit GUI interaction of the WebContent process on macOSTimothy Flynn
The WebContent process behaves a bit awkwardly on macOS. When we launch the process, we have to create a QGuiApplication to access system fonts. But on macOS, doing so creates an entry in the Dock, and also causes the WebContent to be focused. So if you enter cmd+Q without first focusing the Ladybird GUI, WebContent is closed, while the Ladybird process keeps running.
2023-04-26LibCore: Remove unused EventLoopManager::wake()Andreas Kling
Only EventLoopImplementation needs to know how to wake up.
2023-04-26LibCore: Move post_event() back to EventLoopImplementationAndreas Kling
This shouldn't have been moved to EventLoopManager, as the manager is global and one-per-process, and the implementation is one-per-loop. This makes cross-thread event posting work again, and unbreaks SoundPlayer (and probably other things as well.)
2023-04-26Browser+Ladybird: Render text in the JS console with a monospace fontTimothy Flynn
2023-04-26Ladybird: Explicitly set the font family for CSS generic fontsTimothy Flynn
We currently query Qt for system fonts using QFont::setStyleHint(). The docs from Qt have the following note regarding this API on X11: Qt does not support style hints on X11 since this information is not provided by the window system. This prevents any monospace font from working on X11 systems. For now, work around this by specifying the font-family for fonts which Qt has listed as mapping to a CSS generic font-family.
2023-04-25LibCore+Ladybird: Add EventLoopManager interface for persistent stateAndreas Kling
Things such as timers and notifiers aren't specific to one instance of Core::EventLoop, so let's not tie them down to EventLoopImplementation. Instead, move those APIs + signals & a few other things to a new EventLoopManager interface. EventLoopManager also knows how to create a new EventLoopImplementation object.
2023-04-25Ladybird+LibCore: Use QCoreApplication to drive the main Qt event loopAndreas Kling
Using QEventLoop works for everything but it breaks *one* little feature that we care about: automatically quitting the app when all windows have been closed. That only works if you drive the outermost main event loop with a QCoreApplication instead of a QEventLoop. This is unfortunate, as it complicates our API a little bit, but I'm sure we can think of a way to make this nicer someday. In order for QCoreApplication::exec() to process our own ThreadEventQueue, we now have a zero-timer that we kick whenever new events are posted to the thread queue.
2023-04-25Ladybird: Remove Web::Platform plugins for Qt in favor of LibCoreAndreas Kling
Now that the Core::EventLoop is driven by a QEventLoop in Ladybird, we don't need to patch LibWeb with Web::Platform plugins. This patch removes EventLoopPluginQt and TimerQt. Note that we can't just replace the Web::Platform abstractions with LibCore stuff immediately, since the Web::Platform APIs use JS::SafeFunction for callbacks.
2023-04-25Ladybird: Run the Core::EventLoop with a Qt backendAndreas Kling
This patch adds EventLoopImplementationQt which is a full replacement for the Core::EventLoopImplementationUnix that uses Qt's event loop as a backend instead. This means that Core::Timer, Core::Notifier, and Core::Event delivery are all driven by Qt primitives in the Ladybird UI and WC processes.
2023-04-25LibCore: Simplify Core::Notifier by only allowing one event typeAndreas Kling
Not a single client of this API actually used the event mask feature to listen for readability AND writability. Let's simplify the API and have only one hook: on_activation.