summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWebView/OutOfProcessWebView.h
AgeCommit message (Collapse)Author
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-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-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+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-04-22Browser+Ladybird+LibWeb: Port content filters to StringTimothy Flynn
2023-04-18LibWeb+LibWebView+WebContent: Add APIs to manage an autoplay allowlistTimothy Flynn
The spec defines a Permissions Policy to control some browser behaviors on a per-origin basis. Management of these permissions live in their own spec: https://w3c.github.io/webappsec-permissions-policy/ This implements a somewhat ad-hoc Permissions Policy for autoplaying media elements. We will need to implement the entire policy spec for this to be more general.
2023-04-15Ladybird+LibWebView: Add -P/--enable-callgrind-profiling optionMacDue
This adds a -P option to run Ladybird under callgrind. It starts with instrumentation disabled. To start capturing a profile (once Ladybird has launched) run `callgrind_control -i on` and to stop it again run `callgrind_control -i off`. P.s. This is pretty much stolen from Andreas (and is based on the patch everyone [that wants a profile] have been manually applying).
2023-03-21WebContent+Everywhere: Add a WebContent IPC to activate a tabTimothy Flynn
2023-03-21WebContent+Everywhere: Add an option to not activate new tabs over IPCTimothy Flynn
WebDriver, for example, will want to create new tabs without activating them.
2023-03-16LibWeb+LibWebView+WebContent+Ladybird: Add IPC call that opens new tabAliaksandr Kalenik
2023-03-13LibWeb+Ladybird+Userland: Port window.[alert,confirm,prompt] to StringTimothy Flynn
LibGUI and WebDriver (read: JSON) API boundaries use DeprecatedString, so that is as far as these changes can reach. The one change which isn't just a DeprecatedString to String replacement is handling the "null" prompt response. We previously checked for the null DeprecatedString, whereas we now represent this as an empty Optional<String>.
2023-03-07LibWebView+WebContent: Propagate close from WebContent to LibWebViewAliaksandr Kalenik
2023-01-12LibWebView+Ladybird: Move preferred color scheme to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Move text selection to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Move running JavaScript to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Move debug request to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Move page loading to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Move DOM inspection helpers to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Move get source request to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Move zoom logic to ViewImplementationLinus Groh
2023-01-12LibWebView+Ladybird: Begin de-duplicate WebView implementationsLinus Groh
This starts moving code equally shared between the OOPWV and Ladybird WebContentView implementations to WebView::ViewImplementation, beginning with the client state.
2023-01-12Browser: Implement zoom :^)Linus Groh
Largely based on the Ladybird implementation in 0cc151b.
2023-01-09LibWebView: Add OOPWV "content scales to viewport" hintAndreas Kling
By setting this hint, you indicate to OOPWV that the content inside will scale itself to the viewport size. In such situations, it's fine for OOPWV to reuse a scaled version of an outdated backing store while the view is being resized.
2023-01-07LibWebView+WebContent: Expose the Accessibility Tree to Other ProcessesJonah
This patch also stubs out notify_server_did_get_accessiblity_tree in ladybird since ViewImplementation now has it. However, this feature is still immature, so just stubbing out in ladybird for now. Once we have more robust support in Serenity (namely ARIA properties/state and accessible names and descriptions) we can port this functionality over.
2022-12-19Browser+WebContent: Fixup some DOM inspector weirdnessMacDue
This fixes a few things I noticed whilst working on the inspector for Ladybird. 1. The computed and resolved values were being passed swapped around from the inspect_dom_node() IPC call. I.e. computed values were passed as resolved values and vice versa. This was then fixed by swapping them again in the InspectorWidget (two errors canceled out). 2. Resolved values were called "specified values" seemingly only in the inspect_dom_node() IPC calls. This was a little confusing so I've renamed them to back to "resolved values" for consistency. 3. The inspector took and stored the DOM JSON strings unnecessarily, all the models immediately parse the JSON and don't need the strings to hang around.
2022-12-12Browser: Go back/forward when pressing back/forward mouse buttonsBaitinq
This currently doesn't work when running Serenity through QEMU, as it doesn't pass the side button events over to Serenity due to some bug or missing feature.
2022-12-08Browser+LibWebView+WebContent: Do not domain match on cookie updatesTimothy Flynn
Updating cookies through these hooks happens in one of two manners: 1. Through the Browser's storage inspector. 2. Through WebDriver's delete-cookies operation. In (1), we should not restrict ourselves to being able to delete cookies for the current page. For example, it's handy to open the inspector from the welcome page and be able to delete cookies for any domain. In (2), we already are only interacting with cookies that have been matched against the document URL.
2022-12-07Meta+Userland: Pass Gfx::IntSize by valueMacDue
Just two ints like Gfx::IntPoint.
2022-12-07Meta+Userland: Pass Gfx::IntPoint by valueMacDue
This is just two ints or 8 bytes or the size of the reference on x86_64 or AArch64.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-26Browser: Replace history entry if loading URL because of a redirectBaitinq
We now replace the current history entry if the page-load has been caused because of a redirect. This makes it able to traverse the history if one of the entries redirects you, which previously caused an infinite history traversion loop.
2022-11-26LibWeb+WebContent: Label redirects with new FrameLoader::Type::RedirectBaitinq
Previously we labeled redirects as normal FrameLoader::Type::Navigation, now we introduce a new FrameLoader::Type::Redirect and label redirects with it. This will allow us to handle redirects in the browser differently (such as for overwritting the latest history entry when a redirect happens) :^)
2022-11-26LibWebView+WebContent: Propagate unconsumed input events out of OOPWVSam Atkins
Since 9e2bd9d261a8c0c1b5eeafde95ca310efc667204, the OOPWV has been consuming all mouse and keyboard events, preventing action shortcuts from working. So let's fix that. :^) OOPWV now queues up input events, sending them one at a time to the WebContent process and waiting for the new `did_finish_handling_input_event(bool event_was_accepted) =|` IPC call before sending the next one. If the event was not accepted, OOPWV imitates the usual event bubbling: first passing the event to its superclass, then to its parent widget, and finally propagating to any Action shortcuts. With this, shortcuts like Ctrl+I to open Browser's JS console work again, except when a contenteditable field is selected. That's a whole separate stack of yaks. Co-authored-by: Zaggy1024 <zaggy1024@gmail.com>
2022-11-26LibWebView: Define the OOPWV's superclass in one placeSam Atkins
This lets us change it later without having to remember to update a bunch of uses. (More are coming in the next commit.)
2022-11-16LibWeb+LibWebView+WebContent+WebDriver: Implement Send Alert TextTimothy Flynn
2022-11-16LibWebView+WebContent: Begin handling open user dialogs for WebDriverTimothy Flynn
The way in which dialogs should be handled is configurable by the driver capabilities object, which we don't support yet. So this implements just the default mode to dismiss the dialog and return an error if there is one open. In the OOPWV, this means we need to refer to the dialog after it has been open, so we now hold a pointer to whatever dialog is open.
2022-11-16LibWebView+WebContent: Wait for dialog responses without blocking IPCTimothy Flynn
Currently, the WebContent process is completely blocked while waiting for a response to a dialog request. This patch allows the IPC event loop to continue executing while only blocking the HTML event loop. This will allow other processes like WebDriver to continue to operate on the WebContent process while a dialog is open.
2022-11-12WebDriver: Implement `POST /session/{id}/window/fullscreen` endpointTobias Christiansen
2022-11-11LibWebView+WebContent: Add IPCs to navigate the browser's historyTimothy Flynn
2022-11-11LibWebView+WebContent: Add IPC to update a document's cookieTimothy Flynn
2022-11-11LibWebView+WebContent: Add IPC to get a document's named cookieTimothy Flynn
2022-11-11LibWebView+WebContent: Add IPC to get all cookies for a document's URLTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Execute Async Script to WebContentTimothy Flynn
With this, WebDriverEndpoints is unused and removed :^)
2022-11-11Browser+WebContent+WebDriver: Move Get Page Source to WebContentTimothy Flynn
2022-11-11Browser+WebContent+WebDriver: Move Take Element Screenshot to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Is Element Enabled to WebContentTimothy Flynn
2022-11-10Browser+WebContent+WebDriver: Move Get Element Rect to WebContentTimothy Flynn