Commit graph

137 commits

Author SHA1 Message Date
Andreas Kling
2b1d294dc6 Ladybird: Let Lagom build the IPC endpoints for WebContent 2022-12-25 07:58:58 -07:00
Andreas Kling
6d189696da Ladybird: Remove PageClientLadybird as it's no longer used 2022-12-25 07:58:58 -07:00
Andreas Kling
1298baa9ad Ladybird: Port over ConsoleWidget from the SerenityOS Browser
While this adds a fair bit of widget code, we're also increasing code
sharing by using the same bits in WebContentClient for interacting with
the JS console.

That said, we should look for more ways to share code here.
2022-12-25 07:58:58 -07:00
Andreas Kling
26a7ea0e0f Ladybird: Render web content in a separate process :^)
This patch brings over the WebContent process over from SerenityOS
to Ladybird, along with a new WebContentView widget that renders
web content in a separate process.

There's a lot of jank and FIXME material here, notably I had to re-add
manually pumped Core::EventLoop instances on both sides, in order to get
the IPC protocol running. This introduces a lot of latency and we should
work towards replacing those loops with improved abstractions.

The WebContent process is built separately here (not part of Lagom) and
we provide our own main.cpp for it. Like everything, this can be better
architected, it's just a starting point. :^)
2022-12-25 07:58:58 -07:00
Andreas Kling
2451a447f5 Ladybird/Meta: Split out build instructions to a separate document 2022-12-25 07:58:58 -07:00
Sam Atkins
acec34351f Ladybird/ConsoleClient: Implement console message styling with %c
This matches the changes made to Serenity in:
7a2da4cabf
2022-12-25 07:58:58 -07:00
Andrew Kaster
0bf79b1f3b Ladybird/CMake: Enable compile_commands.json by default
This should help IDEs have an easier time indexing serenity files.
2022-12-25 07:58:58 -07:00
Andrew Kaster
fb1ca02a74 Ladybird/SimpleWebView: Install and check for content filters in res/
This allows installed ladybird and Andriod ladybird to find the content
filters without copying all of Base/home/anon into the install tree.
2022-12-25 07:58:58 -07:00
Itamar
02b3a89d96 Ladybird/WebView: Fix size calculation in update_viewport_rect()
size() may include the dimensions of the scrollbars, so we now use
viewport() instead.
2022-12-25 07:58:58 -07:00
Moustafa Raafat
22c3b8be7b Ladybird/Tab: Handle "Dump History" action 2022-12-25 07:58:58 -07:00
Moustafa Raafat
612f7daf05 Ladybird/SimpleWebView: Add debug logging for unhandled debug requests 2022-12-25 07:58:58 -07:00
Moustafa Raafat
9854feb263 Ladybird/Tab: Update history title when tab title changes 2022-12-25 07:58:58 -07:00
Moustafa Raafat
a39f0d472a Ladybird/History: Ignore title updates when history has no current item 2022-12-25 07:58:58 -07:00
Moustafa Raafat
742c4767df Ladybird/BrowserWindow: Make "View Source" a separate window
View Source was a subwindow which made it cover part of the browser with
no way for closing it.
2022-12-25 07:58:58 -07:00
Andreas Kling
c2230d5fe8 Ladybird: The JS console widget should be a standalone window
...not part of the WebView. Its lifetime is managed by a QPointer.
2022-12-25 07:58:58 -07:00
Andrew Kaster
b2ba91123b Ladybird/ConsoleClient: Get the current ESO from new HostDefined helper 2022-12-25 07:58:58 -07:00
Andrew Kaster
2ff37d7e13 Ladybird/Everywhere: Ensure that Qt objects are created with parents
This prevents memory leaks detected by both Valgrind and ASAN/LSAN.

Valgrind is still suspicious of the leaked JS::VM from
Web::Bindings::main_thread_vm() but there's other issues with leak
checking all the GC'd objects.

Co-Authored-By: Diego Iastrubni <diegoiast@gmail.com>
2022-12-25 07:58:58 -07:00
Jonas Kvinge
f9af2832c8 Ladybird: Fix typo in README.md 2022-12-25 07:58:58 -07:00
Luke Wilde
e04ec39984 Ladybird: Start applying the default content filter
For the first cut, the file path is not configurable and the content
filter cannot be toggled on or off. If we fail to apply the content
filters for any reason (e.g. the filter file doesn't exist), we simply
just stop loading the content filters to allow using Ladybird without
content filters.
2022-12-25 07:58:58 -07:00
networkException
f1c7ee2810 Ladybird/Everywhere: Replace "protocol" with "scheme" url helpers
See 4230dbbb21
2022-12-25 07:58:58 -07:00
Idan Horowitz
bf26b52ac6 Ladybird/BrowserWindow: Port user agent spoofing from Browser 2022-12-25 07:58:58 -07:00
Idan Horowitz
edd1e770d9 Ladybird/BrowserWindow: Give color scheme action group a detailed name
'group' is not very specific.
2022-12-25 07:58:58 -07:00
Andreas Kling
5ac5fef468 Ladybird: Add a very simple DOM inspector
We use a ModelTranslator to expose a DOMTreeModel from LibWebView :^)
It allows you to select the currently inspected node, which causes
the engine to render a little box model overlay above the web content.
2022-12-25 07:58:58 -07:00
Andreas Kling
98b6aea234 Ladybird: Add a ModelTranslator to translate a GUI::Model to a Qt model
This will be used to expose the DOMTreeModel from LibWebView :^)
2022-12-25 07:58:58 -07:00
Andreas Kling
2a021084e5 Ladybird: Rename WebView to SimpleWebView
This will allow us to share code with LibWebView from SerenityOS.
(This would otherwise not work, since its "WebView" namespace collides
with our "WebView" class.)

Also, we should eventually move towards a more sophisticated
multi-process WebView like OOPWV.
2022-12-25 07:58:58 -07:00
Aaron Dewes
eecee7369f Ladybird: Clean up tab bar autohide
Qt has this feature built-in, so there's no need to create a custom
implementation
2022-12-25 07:58:58 -07:00
Aaron Dewes
bdce860ac5 Ladybird: Make Tab.cpp directly take a BrowserWindows as m_window 2022-12-25 07:58:58 -07:00
Linus Groh
445cc7c97d Ladybird: Remove redundant use of impl()
This blocks us from removing it upstream in LibWeb.
2022-12-25 07:58:58 -07:00
davidot
fdf69720d4 Ladybird/PageClient: Initialize the js console earlier during page setup 2022-12-25 07:58:58 -07:00
davidot
07a500e923 Ladybird/WebView: Ensure a console widget exists before storing messages
This makes sure that any console.log (and friends) called before ever
opening the JS Console are not lost.
2022-12-25 07:58:58 -07:00
Andreas Kling
3610ac5e19 Ladybird/WebView: Close top-level BC when the WebView is destroyed 2022-12-25 07:58:58 -07:00
Niek van der Maas
f043d4b654 Ladybird: Add macOS build instructions
Remove release build info, as per request of @bgianfo
2022-12-25 07:58:58 -07:00
ylluminate
ff9dfc89cc Ladybird: Add link to Serenity's LibWeb
library path for easier reference and finding.
2022-12-25 07:58:58 -07:00
Diego Iastrubni
8acdb403c3 Ladybird: Add instructions for building on Fedora
closes #49
2022-12-25 07:58:58 -07:00
Diego Iastrubni
d579ed7e46 Ladybird: Don't propagate unrecognized button clicks to the web engine
There are a lot of unsupported mouse click events that the engine
cannot handle. It such event (0) reaches the web engine - it will
assert.

Don't even propagate them - this is the safe way. As of today!

I also added back/forward buttons to the translation.

Should fix #27
2022-12-25 07:58:58 -07:00
Andreas Kling
561303829e Ladybird/WebView: Plumb visibility state changes from Qt to LibWeb 2022-12-25 07:58:58 -07:00
Matheus Vinicius
d007160ad6 Ladybird: Add --needed option on pacman dependencies command 2022-12-25 07:58:58 -07:00
Andreas Kling
e73c2c7029 Ladybird/WebView: Move WebSocket stuff to its own files 2022-12-25 07:58:58 -07:00
Andreas Kling
4cc82ac638 Ladybird/WebView: Move our PageClient to its own file
And rename it to PageClientLadybird while we're at it, it's not
"headless" by any means.
2022-12-25 07:58:58 -07:00
Andreas Kling
97964bc710 Ladybird/BrowserWindow: Add UI for switching preferred CSS color scheme 2022-12-25 07:58:58 -07:00
Julen Ruiz Aizpuru
98bf0107ce Ladybird/Tab: Conditionally enable back/forward buttons 2022-12-25 07:58:58 -07:00
Julen Ruiz Aizpuru
ea3e9a3102 Ladybird/Tab: Make back/forward keyboard shortcuts platform-specific
This commit changes how we set the back and forward button key bindings
to use platform-specific standard key sequences.

For example, in Mac OS X, the back action will be now triggered via
Cmd+← and Cmd+[, whereas previously the action was mapped to Alt+←,
which is not standard in Mac OS X.
2022-12-25 07:58:58 -07:00
Andreas Kling
617aba2420 Ladybird/FontPluginQt: Initialize the default fixed-width font 2022-12-25 07:58:58 -07:00
Andreas Kling
3628eda0db Ladybird/FontPluginQt: Implement default font virtuals 2022-12-25 07:58:58 -07:00
Andreas Kling
c230264c63 Ladybird/WebView: Ensure JS console is initialized before handling input 2022-12-25 07:58:58 -07:00
Andreas Kling
6ee92a1fd0 Ladybird/WebView: Implement page_did_request_scroll_into_view()
This makes #foo links actually scroll the #foo element into view.
2022-12-25 07:58:58 -07:00
Andreas Kling
345faff586 Ladybird/WebView: Notify LibWeb whenever the viewport is scrolled 2022-12-25 07:58:58 -07:00
Andrew Kaster
488da351c0 Ladybird/CMake: Install resources and Lagom libraries alongside ladybird
This setup should allow the package maintainers who are looking to
distribute ladybird on their distributions to use CMake to install
ladybird using cmake install rules rather than having to write their own
2022-12-25 07:58:58 -07:00
Andrew Kaster
3403b1fd77 Ladybird/WebView: Search for resources using installed location
Reorganize the logic for initializing s_serenity_resource_root.

Now, we initialize it in platform_init(), and move platform_init to the
top of initialize_web_engine.

Add a branch at the end of the function to check
``QApplication::applicationDirPath()`` for the location of the
executable, and base the location of resources on that.
In an installed configuration, this will be /some/path/bin, with the
resource root set to /some/path/share/, looking for files in
/some/path/share/res/resource-type.

This matches up with some upcoming CMake changes to install resources in
CMAKE_INSTALL_DATADIR.
2022-12-25 07:58:58 -07:00
Diego Iastrubni
0a38d246f9 Ladybird: Fix some crashes related to keyboard events
Don't try to get the unicode value of an empty string.
2022-12-25 07:58:58 -07:00