Commit graph

50294 commits

Author SHA1 Message Date
Luke Wilde
036e1e1bcf LibWeb: Implement performance.{measure,clearMeasures} 2023-05-13 16:31:10 +02:00
Luke Wilde
d088619560 LibWeb: Capture realm in dictionary to C++ conversion
Some types use the realm when converting to C++, such as unions.
2023-05-13 16:31:10 +02:00
Luke Wilde
f62bcba56a LibWeb: Specify snake case names for navigation timing entries too
This will be used by performance.measure to read the value of a given
entry in the NavigationTiming interface.
2023-05-13 16:31:10 +02:00
MacDue
404804db36 Ladybird: Add common handy actions to context menu
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-13 15:54:34 +02:00
Timothy Flynn
2b269cf425 Base: Add a test page to load a video element with <source> children
This verifies we cycle through the source children until we land on one
with a video we can play.
2023-05-13 15:51:44 +02:00
Timothy Flynn
05019746d2 LibWeb: Partially implement HTMLSourceElement's insertion/removal steps
This implements the substeps which concern HTMLMediaElement parents.
2023-05-13 15:51:44 +02:00
Timothy Flynn
c161a0fc49 LibWeb: Implement the HTMLMediaElement child <source> selection steps
Rather than setting the src attribute on the HTMLMediaElement, websites
may append a list of HTMLSourceElement nodes to the media element. There
is a series of "try the next source" steps to attempt to fetch/load each
source until we find one that works.
2023-05-13 15:51:44 +02:00
Timothy Flynn
5bc386cc96 LibWeb: Change Document::parse_url to accept a StringView
There's no need for this to require a DeprecatedString - the method it
wraps around already only expects a StringView. This allows passing a
String instance without any conversion.
2023-05-13 15:51:44 +02:00
thankyouverycool
7fa8fae786 FontEditor: Allow application to launch without a font
Since LibFSAC requires a reified window before loading a font, it
makes sense to have a safe null state for the app.

This lets us stay alive after a failed file request on startup,
handle failure at any point during initialization, and claw back
memory from all our font RefPtrs.

A default startup font or none at all can now be set in FontEditor.ini
2023-05-13 12:53:49 +02:00
thankyouverycool
aaf60053f1 LibGUI: Use ColorRole::DisabledText when AbstractView is disabled
And only paint GlyphMapWidget's frame if disabled
2023-05-13 12:53:49 +02:00
thankyouverycool
ec29d3abae LibGUI: Allow setting and clearing text in SpinBox 2023-05-13 12:53:49 +02:00
thankyouverycool
24046f9adf FontEditor: Let GlyphEditorWidget initialize a null BitmapFont
And remove public reference getters as there is no guarantee they are
nonnull.
2023-05-13 12:53:49 +02:00
thankyouverycool
0ad5e85163 LibGUI+Applications: Let GlyphMapWidget initialize a null Font
FontEditor will need to clear references to its mutable font in
the future while CharacterMap has no use for the highlights clone,
so let's convert GlyphMapWidget's set_font wrapper into a separate
initialize function for the editor and stop hiding the base function
for others. Setting font null in either ultimately points the map to
the system's default font.
2023-05-13 12:53:49 +02:00
thankyouverycool
cf4ddd1dcf FontEditor: Move common restoration work into restore_state() 2023-05-13 12:53:49 +02:00
thankyouverycool
c7eee16292 FontEditor: Use resultant FSAC filename when Saving-as
Fixes desync between file and title.
2023-05-13 12:53:49 +02:00
thankyouverycool
a0f160bfc4 FontEditor: Use fallible {Input,Message}Boxes
And replace DeprecatedString and fix misnamed argument in show_error()
2023-05-13 12:53:49 +02:00
thankyouverycool
6212e5b1f0 FontEditor: Don't crash on missing icons
Instead of crashing on failed icon loading with TRY(), let's report
missing but non-critical resources in detail and gracefully move on.
2023-05-13 12:53:49 +02:00
thankyouverycool
ea8bcb2f30 FontEditor: Rename m_edited_font => m_font and remove getter
Pithier and it matches the naming convention used in FontEditor's
child widgets. Since it was never used outside MainWidget and there
will soon be no guarantee that m_font is nonnull, the public
BitmapFont& getter has also been removed.
2023-05-13 12:53:49 +02:00
thankyouverycool
1ee78c40ae FontEditor: Remove unnecessary call to hide() NewFontDialog
This workaround has not been needed since 5c92397
2023-05-13 12:53:49 +02:00
thankyouverycool
e2762d8956 FontEditor: Remove unnecessary setters and getters
As these were only used internally, let's simplify things and prevent
potential desync between widget state and saved settings by moving the
logic into their respective actions.
2023-05-13 12:53:49 +02:00
thankyouverycool
e8f2192aca FontEditor: Remove unnecessary deferred invokes
Since moving initialization out of the constructor and recalculating
GlyphMap's content size on range and font changes, these deferrals are
no longer needed.
2023-05-13 12:53:49 +02:00
thankyouverycool
3264b5cab2 FontEditor: Make update_title() private 2023-05-13 12:53:49 +02:00
thankyouverycool
ed3f9347f3 FontEditor: Tighten lambda captures 2023-05-13 12:53:49 +02:00
thankyouverycool
36641187d1 FontEditor: Propagate errors formatting preview text 2023-05-13 12:53:49 +02:00
thankyouverycool
5ec9654477 FontEditor: Propagate errors when loading GML 2023-05-13 12:53:49 +02:00
thankyouverycool
1a30439b11 FontEditor: Port some instances of DeprecatedString 2023-05-13 12:53:49 +02:00
thankyouverycool
0e276e0458 FontEditor: Iterate slope and weight lists by size() 2023-05-13 12:53:49 +02:00
thankyouverycool
2d2133b229 FontEditor: Convert Model lists to Vector<String>
And propagate errors while building them.
2023-05-13 12:53:49 +02:00
thankyouverycool
e4ab9a799d LibGfx: Convert FontStyleMappings to Arrays
This will let us neatly ensure capacities, do unchecked appends, and
iterate by size() on FontEditor's models.
2023-05-13 12:53:49 +02:00
thankyouverycool
8dda4e4ab5 LibGUI: Add fallible factories to ItemListModel 2023-05-13 12:53:49 +02:00
thankyouverycool
023c1dffab LibGUI: Ignore Alt+{Left,Right} key events in GlyphMapWidget
Fixes seek actions not activating by keyboard shortcut when
GlyphMapWidget has focus.
2023-05-13 12:53:49 +02:00
Aliaksandr Kalenik
d187862f76 LibWeb: Return grid container width from automatic_content_width in GFC
automatic_content_width() should return grid container width that is
supposed to be set by determine_intrinsic_size_of_grid_container().
2023-05-13 12:53:25 +02:00
Aliaksandr Kalenik
644e4f4c99 LibWeb: Implement grid container intrinsic sizes calculation
When a width/height constraint is applied to GFC it should set its own
width/height to the sum of track sizes according to the spec.

Changes in layout tests are improvement over what we had before.
2023-05-13 12:53:25 +02:00
Aliaksandr Kalenik
d0ce61bf13 LibWeb: Fix condition to determine auto tracks while sizing in GFC
This solves the issue when track with "fixed" min sizing function were
treated like "auto" during sizing.
2023-05-13 12:53:25 +02:00
Daniel Bertalan
2626136749 SpiceAgent: Gracefully handle the host clearing the clipboard
When the host clears the clipboard (e.g. by running `pbcopy </dev/null`)
the Spice server sends an empty string to us. Previously, we would crash
as `AnonymousBuffer::create_with_size` doesn't accept a size of 0. Fix
this by passing `{}` to `async_set_clipboard_data` in this case.
2023-05-13 10:19:28 +02:00
Andreas Kling
9d78619b59 LibWeb: Let HTMLImageElement delay the document load event again 2023-05-13 09:08:42 +02:00
Andreas Kling
c648e24cff LibWeb: Don't force HTMLImageElement to have a legacy ImageLoader
We achieve this by adding a new Layout::ImageProvider class and having
both HTMLImageElement and HTMLObjectElement inherit from it.

The HTML spec is vague on how object image loading should work, which
is why this first pass is focusing on image elements.
2023-05-13 09:08:42 +02:00
Andreas Kling
3cf73ca0b3 LibWeb: Implement enough of "update the image data" to load images
This first pass is enough to get us:
- Image loading via fetch
- Source selection via srcset and sizes attributes
2023-05-13 09:08:42 +02:00
Andreas Kling
6fe4fcb74b LibWeb: Add a class to represent the "source set" concept from HTML
Also comes with a little extra CSS parser helper for parsing "sizes"
attributes in images.
2023-05-13 09:08:42 +02:00
Andreas Kling
9281bf7a01 LibWeb: Add class to represent "list of available images" from HTML spec 2023-05-13 09:08:42 +02:00
Andreas Kling
596eabe9e6 LibWeb: Start fleshing out HTML "image requests" and "image data"
This patch adds HTML::ImageRequest and HTML::DecodedImageData.

The latter had to use a different name than "ImageData", as there is
already an IDL-exposed ImageData class in HTML.
2023-05-13 09:08:42 +02:00
Liav A
420952a433 Kernel/aarch64: Remove drawing of logo on the framebuffer during init
This logo was actually used as a first sign of life in the very early
days of the aarch64 port.
Now that we boot into the graphical mode of the system just fine there's
no need to keep this.
2023-05-13 07:56:00 +02:00
Ben Wiederhake
c5d3de3f7d LibDebug: Propagate errors around LineProgram
Found while playing Fixme-Roulette.
2023-05-13 07:54:34 +02:00
Fabian Dellwing
4093952a6e Ports: Update and fix nethack
This update fixes the broken build on newer (Ubuntu) systems.

It also contains a security fix.
2023-05-13 07:53:58 +02:00
Ben Wiederhake
960822ef74 LibCore: Remove unused API from DeprecatedFile
It looks like this migration it taking a while, so let's make sure noone
accidentally introduces new usages of this currently-unused API.
2023-05-13 07:53:13 +02:00
Ben Wiederhake
bc2a517ade Userland: Merge DEFAULT_PATH into LibFileSystem/FileSystem.h 2023-05-13 07:53:13 +02:00
Andreas Kling
0db94daf5e Ladybird: Disable SQL database by default (until we can trust it)
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-13 07:52:22 +02:00
Andreas Kling
c8cf599c44 LibWeb: Make PercentageOr<T> equality comparison work for calc() values
This makes hovering around on GitHub fast again, as it no longer
believes that the grid-template-areas property keeps changing
when it didn't :^)

Also made to_string() work for calc() values as well, since I stumbled
upon that while debugging this.
2023-05-13 07:38:08 +02:00
Aliaksandr Kalenik
d7ca52afaf LibWeb: Fix typo in containing_block_size_for_item in GFC 2023-05-13 06:48:55 +02:00
Aliaksandr Kalenik
4ef997c47c LibWeb: Align calculate_min/max_content_contribution with the spec
This change brings more spec compliant implementation of functions to
calculate min/max contributions of grid items in containing block size.
2023-05-13 06:29:42 +02:00