Commit graph

44712 commits

Author SHA1 Message Date
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
Andreas Kling ef757f33da Ladybird: Implement the Web::Platform::ImageCodecPlugin interface
...and move it to separate files while we're at it.
2022-12-25 07:58:58 -07:00
Andrew Kaster 4334929323 Ladybird/CMake: Link against LibSoftGPU to fix WebGL with serenity LibGL
In the future, ladybird should probably use a QOpenGLWidget or similar
platform plugin to use the native GL implementation instead of the one
in serenity.
2022-12-25 07:58:58 -07:00
Timothy Flynn 4850a2d272 Ladybird: Update pointer to current tab when the selected tab changes
This allows requests like dumping the DOM tree to be forwarded to the
correct tab. Otherwise, the event would be forwarded to the most
recently created tab.
2022-12-25 07:58:58 -07:00
Timothy Flynn e04db5efed Ladybird: Hook up the dump-cookies debug request to the cookie jar 2022-12-25 07:58:58 -07:00
Andreas Kling 0f1644f62d Ladybird: Switch to next/previous tab with Ctrl+PageDown/PageUp 2022-12-25 07:58:58 -07:00
Andreas Kling 27b9cd13ee Ladybird: Focus the location editor when creating a new tab
This lets you start typing a new URL right after pressing Ctrl+T.
2022-12-25 07:58:58 -07:00
Andreas Kling 031005de2d Ladybird: Remove some awkward camelCase signal names
We use snake_case for everything except when we're forced by Qt to use
their camelCase names.
2022-12-25 07:58:58 -07:00
Andreas Kling 0c4ae810d7 Ladybird: Hide the hovered URL label on startup 2022-12-25 07:58:58 -07:00
Andreas Kling 4e3e5149d5 Ladybird: Show tooltips for <a title> text 2022-12-25 07:58:58 -07:00
Andreas Kling ce38528fff Ladybird: Allow scrolling with arrow keys and PageUp/PageDown
This will need further work to integrate well with content that listens
for key events, but at least this is better than doing nothing.
2022-12-25 07:58:58 -07:00
Andreas Kling f4a9b382b1 Ladybird: Remove spacing between toolbar and web view 2022-12-25 07:58:58 -07:00
Andreas Kling d74802e4e2 Ladybird: Show hovered link URLs in a conditional UI label
The tooltips for hovered links were super awkward when in a tooltip
2022-12-25 07:58:58 -07:00
Andreas Kling aa27112d78 Ladybird: Tweak the QTabWidget look 2022-12-25 07:58:58 -07:00
Andreas Kling 8a657eaa34 Ladybird: Add a FontPlugin and try much harder to find suitable fonts
Instead of only looking at the SerenityOS default fonts, we now also
look recursively in /usr/share/fonts for suitable fonts that we can
load and use.
2022-12-25 07:58:58 -07:00
Andreas Kling 37d844fd66 Ladybird: Use only the Qt event loop to speed everything up :^)
This patch removes the dual-event-loop setup, leaving only the Qt event
loop. We teach LibWeb how to drive Qt by installing an EventLoopPlugin.

This removes the 50ms latency on all UI interactions (and network
requests, etc.)
2022-12-25 07:58:58 -07:00
Andreas Kling dcab11f5e9 Ladybird: Fix build after LibWeb+LibJS GC changes 2022-12-25 07:58:58 -07:00
Luke Wilde 9789d8b769 Ladybird: Turn initialize_global_object() into a regular initialize()
See: https://github.com/SerenityOS/serenity/commit/cfa5885
2022-12-25 07:58:58 -07:00
Luke Wilde 1e7d4bc089 Ladybird: Retrieve console object from the realm's intrinsic
See: https://github.com/SerenityOS/serenity/commit/867ad03
2022-12-25 07:58:58 -07:00
Andreas Kling ced442f426 Ladybird: Remove obsolete call to set_associated_realm() 2022-12-25 07:58:58 -07:00
Kemal Zebari 80edd654fa Ladybird: Fix a few typos in README 2022-12-25 07:58:58 -07:00
Luke Wilde c9e6967d7b Ladybird: Update for LibJS realm changes 2022-12-25 07:58:58 -07:00
Andreas Kling a14b00e046 Ladybird: Remove redundant subtraction of scrollbar from viewport rect 2022-12-25 07:58:58 -07:00
Andreas Kling b1acf17d3c Ladybird: Simplify awkward keyboard mapping code 2022-12-25 07:58:58 -07:00
Andreas Kling 90c0ae5e63 Ladybird: Update for LibJS global object construction changes 2022-12-25 07:58:58 -07:00
Andreas Kling b1cc1bd47b Ladybird: Remove unused PageClient override 2022-12-25 07:58:58 -07:00
Xexxa 5a5473a38e Ladybird/Meta: Use reverse domain name notation in property list files 2022-12-25 07:58:58 -07:00
Filiph Sandström 7ddb433f99 Ladybird/Meta: Enable macOS high-dpi support
This also adds an Info.plist file required to properly
build macOS applications.
2022-12-25 07:58:58 -07:00
Andreas Kling da23456f9e Ladybird: Try decoding images with Qt if LibGfx fails us
We might as well ask Qt if it can decode images in case our own decoders
don't succeed.
2022-12-25 07:58:58 -07:00
Andreas Kling 11e5be050f Ladybird: Enable HTTP pipelining 2022-12-25 07:58:58 -07:00