Commit graph

47359 commits

Author SHA1 Message Date
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
Kenneth Myhra
9b190b9509 LibWeb: Make factory method of Geometry::DOMRectList fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
4de5dc7a86 LibWeb: Make factory method of Geometry::DOMPointReadOnly fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
530ec85c4a LibWeb: Make factory method of Geometry::DOMPoint fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
459959b297 LibWeb: Make factory method of HTML::BrowsingContext fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
3f50025126 LibWeb: Make factory method of Fetch::Response fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
54913adf37 LibWeb: Make factory method of Fetch::Request fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
d7446089ae LibWeb: Make factory method of Encoding::TextEncoder fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
77e4432367 LibWeb: Make factory method of DOMParsing::XMLSerializer fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
f918d12655 LibWeb: Make factory methods of WebGL::WebGLContextEvent fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
ff92324fa5 LibWeb: Make factory method of DOM::ElementFactory fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
a2381a672d LibWeb: Make factory method of Fetch::HeadersIterator fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
b3734627a1 LibWeb: Make factory method of URL::URLSearchParamsIterator fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
e776171d8f LibWeb: Allow prototype.{entries keys,value} to propagate errors
This allows the prototype.{entries keys,value} native functions
generated by the BindingsGenerator to propagate errors if needed.
2023-02-22 09:55:33 +01:00
Kenneth Myhra
1f48081ee4 LibWeb: Make factory methods of IDLEventListener and NodeFilter fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
3689d58c64 LibWeb: Allow EventListener/NodeFilter path to propagate errors
This allows the EventListener/NodeFilter path of the BindingsGenerator
to propagate errors if needed.
2023-02-22 09:55:33 +01:00
Kenneth Myhra
e57461b89e LibWeb: Make factory methods of UIEvents::WheelEvent fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
587cf355ed LibWeb: Make factory methods of UIEvents::UIEvent fallible
This affects calls to FocusEvent::create() since FocusEvent does not
implement its own create() method.
2023-02-22 09:55:33 +01:00
Kenneth Myhra
a401cff4e2 LibWeb: Make factory methods of UIEvents::KeyboardEvent fallible 2023-02-22 09:55:33 +01:00
Kenneth Myhra
b91d599177 LibWeb: Make factory method of UIEvents::FocusEvent fallible 2023-02-22 09:55:33 +01:00
Lucas CHOLLET
ad13c45c28 LibGfx: Log the underlying error when failing to decode a macroblock 2023-02-22 09:22:45 +01:00
Lucas CHOLLET
cf6bceeb2c LibGfx: Don't assume that scans are always full when filling macroblocks
In other words: only consider coefficient of the current scan when
adding coefficients to a macroblock. Information about which
coefficients are present in the stream are passed through the spectral
information in the context.
2023-02-22 09:22:45 +01:00
Lucas CHOLLET
d421967394 LibGfx: Save spectral information in the context
These variables are useless for baseline JPEG, but they will become
useful for other encodings.
2023-02-22 09:22:45 +01:00