Commit Graph

532 Commits

Author SHA1 Message Date
Sam Atkins
aae7905369 Applications: Use native style sheet for WebViews where appropriate 2023-08-25 20:30:20 +01:00
Timothy Flynn
18bbbab78c Browser: Do not visualize trailing whitespace in the source viewer
Trailing whitespace in the source view is not actionable, so there's no
benefit to showing it.
2023-08-25 05:39:32 +02:00
Timothy Flynn
d56f127c80 Ladybird+LibWebView: Rename some "on get" notifications to "on received"
The old names sounded like awkward English to me, as they implied the
WebContent process is asking for information. In reality, WebContent is
*providing* the information.
2023-08-23 12:07:02 -04:00
Timothy Flynn
ebdcba8b3b Ladybird+LibWebView: Migrate dialog APIs to LibWebView callbacks 2023-08-23 09:59:04 -04:00
Timothy Flynn
9608bfb576 LibWebView+Ladybird: Remove duplicate WebContent callback
We have on_navigate_back + on_back_button and on_navigate_forward +
on_forward_button. Remove the *_button variants.
2023-08-19 05:15:35 +02:00
camc
d978dd4af8 LibGUI: Add deprecated suffix to {set_,}tooltip in Widget 2023-08-18 10:43:37 +01:00
Cameron Youell
d972338208 Browser: Add more intuitive search 2023-08-17 15:30:23 +01:00
Andreas Kling
bd61e75e0b LibGUI: Remove Window::try_add_menu()
And fall back to the infallible add_menu().
2023-08-14 14:57:54 +02:00
Andreas Kling
eec328e2ab LibGUI: Remove Menu::try_add_submenu()
And fall back to the infallible add_submenu().
2023-08-14 14:57:54 +02:00
Andreas Kling
58e482a06d LibGUI: Remove Layout::try_add_spacer()
And fall back to the infallible add_spacer().

Work towards #20557.
2023-08-14 14:57:54 +02:00
kleines Filmröllchen
1e67435ff5 Meta: Rename compile_gml to stringify_gml
This is what this function really does, it doesn't compile anything.
2023-08-11 21:33:48 +02:00
Timothy Flynn
3e2449d1fe Browser+WebDriver: Set the initial URL to about:blank from WebDriver
We already do this for headless-browser. There's no need to open any URL
other than about:blank when starting a WebDriver session. We should also
do this from WebDriver code, rather than in special logic in Browser's
main.cpp.
2023-08-09 05:33:24 +02:00
Andreas Kling
2eaa528a0e LibJS: Rip out the AST interpreter :^)
This has been superseded by the bytecode VM, which is both faster
and more capable.
2023-08-08 13:07:13 +02:00
Andreas Kling
99ac34eeae Ladybird+LibWebView+Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling
4eb43cc107 Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Jelle Raaijmakers
14091f32c6 Browser: Synchronize database statements used for cookies
Since SQLServer is inherently asynchronous, database statements can run
in parallel. Our `CookieJar` did not require synchronous actions on the
database for its cookies, resulting in cookies not being set
immediately. This resulted in a bug that could be exposed by setting
`document.cookie` and immediately querying its value, revealing that the
cookie was not yet persisted.

Solve this by requiring all database statements to be executed
synchronously. Ideally SQLServer has a mechanism to determine interquery
dependencies and blocks until dependent queries are fully executed, but
until we have that, this works around that limitation.
2023-08-08 06:25:11 -04:00
Lucas CHOLLET
3f35ffb648 Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
2023-08-08 07:37:21 +02:00
Andreas Kling
34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
Karol Kosek
49df2e1e3a Ladybird+Browser: Update zoom text on menu after clicking zoom button 2023-08-04 15:16:48 +02:00
Shannon Booth
8751be09f9 AK: Serialize URL hosts with 'concept-host-serializer'
In order to follow spec text to achieve this, we need to change the
underlying representation of a host in AK::URL to deserialized format.
Before this, we were parsing the host and then immediately serializing
it again.

Making that change resulted in a whole bunch of fallout.

After this change, callers can access the serialized data through
this concept-host-serializer. The functional end result of this
change is that IPv6 hosts are now correctly serialized to be
surrounded with '[' and ']'.
2023-07-31 05:18:51 +02:00
Andreas Kling
a3e97ea153 Browser+LibWebView: Run with the JavaScript bytecode VM by default
The AST interpreter is still available behind a new `--ast` flag.
2023-07-25 20:00:46 +02:00
Ali Mohammad Pur
0c5c75e8a4 LibCore: Slightly rework the Core::Promise API
The previous iteration of this API was somewhat odd and rough in random
places, which degraded usability and made less than perfect sense.
This commit reworks the API to be a little closer to more
conventional promise APIs (a la javascript promises).

Also adds a test to ensure the class even works.
2023-07-08 23:13:00 +01:00
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Jonah
afb07281ad Browser+LibWebView: Load and Display ARIA Properites and State
The inspector widget now has a new ARIA tab which displays an
individual element's ARIA properties and state. The view itself
is pretty basic for now, just being a table- there is definitely room
for some better UX here but it's enough for a first cut.
2023-07-06 11:21:36 +01:00
kleines Filmröllchen
33829f05fe Userland: Convert config listener callbacks to use StringView
The immutability of the string is not relevant here, since the string
we're given was allocated in the IPC serialization layer and will be
destroyed shortly afterwards. Additionally, noone relies on
DeprecatedString-specific functionality. This will make it easier to
convert the IPC layer itself to String later on.
2023-06-27 15:37:00 +01:00
Xexxa
e3a0f84ffb Browser: Change "Same Origin" to "Same-Origin" 2023-06-24 06:19:39 +02:00
Tim Ledbetter
1737a0d1d9 Browser: Set DownloadWidget progress bar minimum value correctly
This fixes a typo from #19462.
2023-06-19 18:50:52 +02:00
Timothy Flynn
2e5fbe8052 Ladybird: Add context menu items to directly open audio files
After commit 7ec7015, we can open audio documents directly. This adds
content menu items to do so, similar to images and videos.
2023-06-19 17:42:55 +02:00
Tim Ledbetter
1a17e08f87 Everywhere: Correctly report progress of downloads larger than 4GiB
This commit changes the variables used to represent the size and
progress of downloads from u32 to u64. This allows `pro` and
`Browser` to report the total size and progress of a download
correctly for downloads larger than 4GiB.
2023-06-19 06:13:19 +02:00
Timothy Flynn
9e95c9892c Ladybird+LibWeb+WebContent: Add context menu controls for muting audio 2023-06-16 19:34:42 +02:00
Timothy Flynn
b3bbdb1e2c Ladybird: Add a context menu for audio elements 2023-06-16 19:34:42 +02:00
Timothy Flynn
14ca04de25 Ladybird+LibWeb+WebContent: Generalize video context menus for all media
The data we want to send out of the WebContent process is identical for
audio and video elements. Rather than just duplicating all of this for
audio, generalize the names used for this IPC for all media elements.

This also encapsulates that data into a struct. This makes adding new
fields to be sent much easier (such as an upcoming field for muting the
element).
2023-06-16 19:34:42 +02:00
Karol Kosek
5234a30731 LibGUI+Userland: Port Action status tips to String 2023-06-15 13:53:22 +01:00
Karol Kosek
2029750519 LibGUI+Userland: Port StatusBar::text() and set_text functions to String 2023-06-15 13:53:22 +01:00
Ben Wiederhake
342e1c6eab Browser: Avoid unnecessary copies of temporary Storages 2023-06-15 08:07:17 +02:00
Sam Atkins
f33824d2e9 LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
Timothy Flynn
5a3825b561 Browser+Ladybird+LibWebView: Consolidate title handling in LibWebView
Namely, let's have empty titles behave the same in both Browser and
Ladybird (display the URL).
2023-06-08 07:21:08 +02:00
Ben Wiederhake
2420effa7d Browser: Store default config values in a single place
Note that this fixes contradictory default values for group
"Preferences", key "Home". This is exactly the kind of errors I want to
prevent with this new style.

The hope is that this can later be used to:
- verify that all accesses to the same key use the same default value,
- and extract the default values more easily.
2023-06-06 00:47:23 +02:00
Tim Ledbetter
556c4ac358 LibGUI: Allow FilteringProxyModel to optionally sort results by score
When the `FilteringOptions::SortByScore` flag is set, filtered indices
are sorted by match score in descending order, meaning the most
relevant results should appear first.

The default behavior of FilteringProxyModel is unchanged.
2023-05-29 10:47:48 -06:00
Ali Mohammad Pur
e47f81d954 Ladybird+Browser: Add a 'Dump All Resolved Styles' debug option
This option dumps all styles for all elements in the document; very
helpful for finding properties that have changed unintentionally :^)
2023-05-29 05:35:41 +02:00
sec05
6a886e4aac Browser: Download Widget file and directory text changes
fixes #18678

This is because the "From:" URL regularly overflows the line, leading
to an unreadable mess. Make sure that the labels for the widget
don't wrap as well, as the widget is fixed height and width.
2023-05-25 17:45:16 -06:00
kleines Filmröllchen
effcd080ca Userland: Remove remaining users of Duration::now_realtime()
This is a clear sign that they want to use a UnixDateTime instead.

This also adds support for placing durations and date times into SQL
databases via their millisecond offset to UTC.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
213025f210 AK: Rename Time to Duration
That's what this class really is; in fact that's what the first line of
the comment says it is.

This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
2023-05-24 23:18:07 +02:00
Jelle Raaijmakers
f391ccfe53 LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive
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-23 12:35:42 +02:00
Andreas Kling
8ce1b7ab7e Browser: Default to HTTPS instead of HTTP if no protocol is specified 2023-05-23 11:16:36 +02:00
Kemal Zebari
8f5cc613d2 Browser: Don't show error message box when canceling editor dialog
Currently, an error message box appears when a user tries to cancel
the editor dialog while editing or adding a bookmark.

This snapshot resolves this by having `add_bookmark()` and
`BookmarksBarWidget::edit_bookmark()` perform an if check on the
result of `BookmarkEditor::edit_bookmark()` to see if the dialog
was canceled.
2023-05-23 06:03:13 +02:00
thankyouverycool
02d94a303c Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars
for capitalization, ellipses and punctuation.

Rewords a few actions and dialogs to use uniform language and
punctuation.
2023-05-23 05:59:49 +02:00
Timothy Flynn
6970f1b6c1 Browser+Ladybird+LibWebView: Handle trivial content APIs in LibWebView
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-17 19:47:05 +02:00
Timothy Flynn
d8b14da380 Browser+Ladybird+LibWebView: Move some common functions to LibWebView
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-17 19:47:05 +02:00
Timothy Flynn
374284d0d8 Browser: Move screenshot context menu actions above inspector actions
Feels a bit more natural, at least to align with muscle memory from
other browsers.
2023-05-16 19:47:18 +02:00