Commit Graph

47331 Commits

Author SHA1 Message Date
Nico Weber
4bf639b635 LibGfx: Drop tags of unknown type instead of writing invalid icc files
We could make UnknownTagData hold on to undecoded, raw input data and
write that back out when serializing. But for now, we don't.

On the flipside, this _does_ write unknown tags that have known types.
We could have a mode where we drop unknown tags with known types.
But for now, we don't have that either.

With this, we can for example reencode
/Library/ColorSync/Profiles/WebSafeColors.icc and icc (and other
tools) can dump the output icc file. The 'ncpi' tag with type 'ncpi'
is dropped while writing it, while the unknown tag 'dscm' with
known type 'mluc' is written to the output. (That file is a v2 file,
so 'desc' has to have type 'desc' instead of type 'mluc' which
it would have in v4 files -- 'dscm' emulates an 'mluc' description
in v2 files.)
2023-02-24 19:42:00 +01:00
Kenneth Myhra
fa1ba7fadf LibWeb: Mark JS::Promise* return value for digest() with JS::NNGCPtr 2023-02-24 19:24:39 +01:00
Kenneth Myhra
f783af05ed LibWeb: Port SubtleCrypto to new String
The algorithm comparison in digest() is done using a StringView to avoid
complex error handling and promise rejection.
2023-02-24 19:24:39 +01:00
Kenneth Myhra
a8cef1fa06 LibWeb: Port Crypto to new String 2023-02-24 19:24:39 +01:00
Kenneth Myhra
450ffbe612 Ports: Update curl to 7.88.1 2023-02-24 19:20:53 +01:00
Nico Weber
b161f5ea05 LibGfx: Make ICC reader check that profile size is a multiple of 4
With this, I would've found e8bd067ce5 earlier.

(If this turns out to be too strict in practice, we can always relax
it again.)
2023-02-24 19:17:20 +01:00
timre13
d7f348ab50 VideoPlayer: Add button and menu item to toggle fullscreen
Add a button to the bottom toolbar and a menu item to toggle fullscreen.
Also implement toggling fullscreen mode by double-clicking the video.
2023-02-24 19:16:46 +01:00
Andreas Kling
1379720742 Ladybird: Consider HTTP response a success if it has a status code
The QNetworkReply::NetworkError enum mixes all kinds of errors into one
enum, HTTP errors, network errors, proxy errors, etc.

Instead of caring about it, we now say that HTTP requests were
successful if their response has any HTTP status code attached.

This allows LibWeb to display error pages when using Qt networking.
2023-02-24 19:15:49 +01:00
Andreas Kling
3435820e1f LibWeb: Render HTML content if present for HTTP error pages
If an HTTP response fails with an error code (e.g 403) but still has
body content, we now render the content.

We only fall back to our own built-in error page if there's no body.
2023-02-24 19:15:49 +01:00
Itamar
47f5a3ea9a HackStudio: Add 'pause debuggee' button
This button sends a SIGSTOP to the debugged process, which pauses it.
The debuggee can be resumed with the 'continue' button.
2023-02-24 19:09:27 +01:00
Itamar
91224d47d2 SystemMonitor: Add "Debug In HackStudio" action to process context menu
This action launches HackStudio with its debugger attached to the
selected process.
2023-02-24 19:09:27 +01:00
Itamar
6e5b1f5819 HackStudio: Add progress bar to Debugger initialization
During Debugger initialization, most of the time is spent creating
DebugInfo objects for the libraries that the program has loaded.
2023-02-24 19:09:27 +01:00
Itamar
0896c03744 HackStudio: Add commandline option to debug a running process 2023-02-24 19:09:27 +01:00
Itamar
58c4fe52d4 HackStudio: Fix event loop usage in debugger callbacks
These callbacks are called from a different thread than the UI thread,
so we need to explicitly use the Application's event loop to perform GUI
logic.
2023-02-24 19:09:27 +01:00
Itamar
ff6fb2cb10 HackStudio: Add ability to attach debugger to a running process 2023-02-24 19:09:27 +01:00
Itamar
eb16513165 LibDebug: Remove file path fixup for library sources
It's no longer needed as the file paths we get for libraries in the
current build process is canonical.
2023-02-24 19:09:27 +01:00
Andrew Kaster
35b07048ef CI: Make sure to brew update in macOS Azure setup
This picks up any upstream brew changes that haven't been pulled into
the default Azure VMs. For example, the ffmpeg dependency of qt is
currently broken in the 8 day old brew commit they are using.
2023-02-24 02:39:26 -07:00
Andrew Kaster
1b24fa5829 CI+Lagom: Use the same options for running test-wasm in ctest and CI
Make sure that we set SERENITY_SOURCE_DIR in ctest, and make sure to
pass the test root to the CI job.

More overhaul of test-js 'test root' finding is needed however.
2023-02-24 00:02:25 -07:00
Sam Atkins
0fb6f87d49 LibWeb: Add spec link to border-width: thin/medium/thick definitions
In the latest backgrounds-3 spec, these have official fixed values. :^)
2023-02-23 16:20:44 +00:00
Kenneth Myhra
e905f25911 LibWeb: Port Worker to new String 2023-02-23 15:48:38 +00:00
Kenneth Myhra
836cb73d29 BindingsGenerator: Release value setting members of dictionary
When a constructor has an optional dictionary as argument, and those
members are of type new string, make sure that we release_value()
setting the dictionary members.
2023-02-23 15:48:38 +00:00
Kenneth Myhra
98ef76b144 BindingsGenerator: Pass optional values as 'sv' to String::from_utf8()
Pass optional values as StringView to String::from_utf8(), otherwise
this would not compile.
2023-02-23 15:48:38 +00:00
Kenneth Myhra
be727ea871 LibWeb: Port WorkerGlobalScope to new String 2023-02-23 15:48:38 +00:00
Kenneth Myhra
9c5bdb0b86 LibWeb: Port WorkerLocation to new String 2023-02-23 15:48:38 +00:00
Kenneth Myhra
511ce240f2 BindingsGenerator: Allow stringifier to return DOMException if needed 2023-02-23 15:48:38 +00:00
Nico Weber
e8bd067ce5 LibGfx: Pad last element in ICC files to 4-byte boundary too
The spec wants that to happen.
2023-02-23 16:39:17 +01:00
Nico Weber
7853be7869 LibGfx: Implement serialization of LutAToBTagData and LutBToATagData
With this, we can write all tag types we can currently read :^)
2023-02-23 15:35:02 +01:00
Humberto Alves
d50b4f3581 LibGUI: Fix Action destructor to unregister itself correctly
Changed the Action destructor to fix an issue where global scoped
actions without shortcuts were not being properly unregistered from the
application. Previously, this could cause crashes when attempting to
open the command palette.
2023-02-23 12:41:47 +00:00
Humberto Alves
2df25f8edf LibGUI: Fix missing parent in LinkLabel open action
Fixed a bug where an action was being registered in the global shortcut
scope by mistake.
2023-02-23 12:41:47 +00:00
Liav A
b19dc8a9b6 Kernel: Prevent out-of-bounds read/write in VirtIO GPU3DDevice::ioctl
Before doing a check if offset_in_region + num_bytes of the transfer
descriptor are together more than NUM_TRANSFER_REGION_PAGES * PAGE_SIZE,
check that addition of both of these parameters will not simply overflow
which could lead to out-of-bounds read/write.

Fixes #17518.
2023-02-23 09:33:54 +00:00
MacDue
40bfaff133 Ladybird: Support inspecting the accessibility tree
This allows viewing the ARIA accessibility tree Epigenetic added
in #16430, but now in Ladybird!
2023-02-22 22:00:40 +00:00
MacDue
56d8e36698 Lagom: Include AccessibilityTreeModel in LibWebView
This will be needed for the accessibility inspector in Ladybird.
2023-02-22 22:00:40 +00:00
Linus Groh
007f23ab94 Meta: Mark myself as a CODEOWNER of Emoji.{cpp,h} in LibGfx 2023-02-22 21:55:59 +00:00
Timothy Flynn
fcd4535a55 LibGfx: Do not exclude all ASCII code points from emoji lookups
Keycap emoji, for example, begin with ASCII digits. Instead, check the
first code point for the Emoji Unicode property.

On a profile of scrolling around on the welcome page in the Browser,
this raises the runtime percentage of Font::glyph_or_emoji_width from
about 0.8% to 1.3%.
2023-02-22 21:51:09 +00:00
Timothy Flynn
f33ead7f5f LibGfx: Bail early from Emoji::emoji_for_code_point_iterator for ASCII
On a profile of scrolling around on the welcome page in the Browser,
this drops the runtime percentage of Font::glyph_or_emoji_width from
about 70% to 0.8%.
2023-02-22 21:11:48 +01:00
Timothy Flynn
fdf090a299 LibGUI: Wrap words at word break boundaries and don't break up emoji
We will currently only wrap "words" at ASCII spaces and, when wrapping,
will break up multi-code point emoji. This changes word wrapping to
behave as follows:

When the wrapping mode is "anywhere", use the iterator-based font width
computation overload. This will compute the width of multi-code point
emoji, whereas we currently only handle single-code point.

When the wrapping mode is "word", use the Unicode word segmentation
boundaries to break lines.
2023-02-22 15:24:16 +00:00
Timothy Flynn
2bc7c11e8d LibGfx: Consult Unicode data to decode emoji sequences
For example, consider the Pirate Flag emoji, which is the code point
sequence U+1F3F4 U+200D U+2620 U+FE0F. Our current emoji resolution does
not consider U+200D (Zero Width Joiner) as part of an emoji sequence.
Therefore fonts like Katica, which have a glyph for U+1F3F4, will draw
that glyph without checking if we have an emoji bitmap.

This removes some hard-coded code points and consults the UCD's code
point properties for emoji sequence components and variation selectors.
This recognizes the ZWJ code point as part of an emoji sequence.
2023-02-22 10:14:36 +01:00
Timothy Flynn
2eb2207f50 LibGUI: Convert mouse events from a visual to a physical position
When clicking a position within a TextEditor, we should interpret that
position as a visual location. That location should be converted to a
"physical" location before using it to set the physical cursor position.

For example, consider a document with 2 emoji, each consisting of 3 code
points. Visually, these will occupy 2 columns. When a mouse click occurs
between these columns, we need to convert the visual column number 1 to
the physical column number 3 when storing the new cursor location.
2023-02-22 10:14:36 +01:00
Timothy Flynn
b823f3d29f LibGfx: Consider multi-code point glyphs when computing text width
Currently, we compute the width of text one code point at a time. This
ignores grapheme clusters (emoji in particular). One effect of this is
when highlighting a multi-code point emoji. We will errantly increase
the highlight rect to the sum of all code point widths, rather than
just the width of the resolved emoji bitmap.
2023-02-22 10:14:36 +01:00
Timothy Flynn
a391ea3da3 LibGfx: Support computing a font's glyph width with code point iterators
This allows consideration of multi-code point glyphs.
2023-02-22 10:14:36 +01:00
Timothy Flynn
71967bc5de LibGfx: Implement Emoji::emoji_for_code_point_iterator for UTF-32 views 2023-02-22 10:14:36 +01:00
Timothy Flynn
832e9b8302 AK: Prepare Utf32View for use within templated LibGfx contexts
Forward declare its iterator and add a peek() method analagous to
Utf8CodePointIterator::peek().
2023-02-22 10:14:36 +01:00
Timothy Flynn
0f20586346 AK: Add formatters for Utf8View and Utf32View
Useful for debugging, especially in templated contexts.
2023-02-22 10:14:36 +01:00
Kenneth Myhra
385b880862 LibWeb: Make factory method of IntersectionObserver fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
f0fd1cae3d LibWeb: Make factory method of IdleDeadline fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
ff2a991e19 LibWeb: Make factory method of ResizeObserver::ResizeObserver fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
dcbe927b48 LibWeb: Make factory method of Selection::Selection fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
d69e863286 LibWeb: Propagate error in factory method of Streams::ReadableStream 2023-02-22 09:55:33 +01:00
Kenneth Myhra
07db02cd2c LibWeb: Make factory method of Geometry::DOMRectReadOnly fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
ec0049441c LibWeb: Make factory methods of Geometry::DOMRect fallible 2023-02-22 09:55:33 +01:00