Commit graph

52113 commits

Author SHA1 Message Date
Lucas CHOLLET 05c8ad4e91 LibGfx/JPEG: Write quantization tables in the zigzag ordering
This is clearly something I missed during the first implementation. The
specification is crystal clear about it: "The quantization elements
shall be specified in zig-zag scan order."

This patch fixes the weird behavior we had when using the quantization
table.
2023-07-04 00:01:06 +02:00
MacDue c63d66e32f Base: Add high-quality vectorized Buggie .tvg file
I could not find a vector graphic of Buggie, so I've now made one
and am adding it exclusively as a .tvg :^)

Should be easy to convert to an SVG too :)
2023-07-03 23:54:51 +02:00
MacDue c04e0494df Tests: Add simple .tvg decoding test
yak.tvg is the Twemoji bison we all know and love.
2023-07-03 23:54:51 +02:00
MacDue dfcd7b3ca5 Ladybird: Replace forward/back/reload SVGs with TVGs
Doing this removes the qt6-svg dependency and allows our rasterizer to
be used for these little icons (and happens to be a fair bit smaller
than the old SVGs).
2023-07-03 23:54:51 +02:00
MacDue bb5db0835d LibGfx: Allow loading a Bitmap (from bytes) with an ideal size 2023-07-03 23:54:51 +02:00
MacDue 7a0e3474d6 Base: Setup file associations for .tvg 2023-07-03 23:54:51 +02:00
MacDue ee09ecaf42 Userland: Register MIME type/extension for .tvg
These both come from the specification.
2023-07-03 23:54:51 +02:00
MacDue ae18186905 LibGfx: Implement image decoder for TinyVG (.tvg)
This adds a decoder for the TinyVG vector format (https://tinyvg.tech/).
TinyVG is a very simple binary vector format, but it is good enough to
represent a lot of SVGs, without needing the full web engine.

The main use case for Serenity is for scalable icons (which .tvg easily
handles).
2023-07-03 23:54:51 +02:00
MacDue e7cddda7e1 LibGfx: Allow passing an ideal size to image decoders
The ideal size is the size the user will display the image. Raster
formats should ignore this parameter, but vector formats can use
it to generate a bitmap of the ideal size.
2023-07-03 23:54:51 +02:00
Lucas CHOLLET ff47223301 LibCore: Make NetworkJob::start() take a Stream::BufferedSocketBase&
It used to take a plain `Socket` and cast it to a `BufferedSocketBase`,
which can lead to unpleasant result when used with a non-buffered
`Socket`.
2023-07-03 23:29:28 +02:00
Lucas CHOLLET 5fc873f53b LibCore: Don't implement pure virtual methods in NetworkJob 2023-07-03 23:29:28 +02:00
Lucas CHOLLET 9581fe1d7d LibTLS: Remove unused methods
Affected methods are:
 - can_read_line
 - can_read
 - read_line
2023-07-03 23:29:28 +02:00
Lucas CHOLLET b46667639f LibHTTP: Make HttpRequest return its method name as a StringView 2023-07-03 23:29:28 +02:00
Timothy Flynn 163ddf1d73 LibWeb: Display the media volume in a tooltip while it is changing 2023-07-03 19:07:26 +02:00
Timothy Flynn 720d8889ad LibWeb: Allow changing media volume with keyboard controls
This allows increasing and decreasing the media volume by 10% with the
up and down arrow keys, respectively. This also allows toggling the mute
state with the M key.
2023-07-03 19:07:26 +02:00
Timothy Flynn 6a5229c2cb LibWeb: Allow seeking media elements with keyboard controls
This allows seeking backwards and forwards by 5 seconds with the left
and right arrow keys, respectively. This also allows seeking to the
beginning and end of the media track with the home and end keys.
2023-07-03 19:07:26 +02:00
Timothy Flynn a4070b1452 LibWeb: Allow toggling playback of media elements with keyboard controls
This allows pausing/playing media elements with the space bar.
2023-07-03 19:07:26 +02:00
Timothy Flynn 2c5c815f44 LibWeb: Toggle media playback when clicking anywhere on the control box
Feels nicer to click anywhere on the control box to toggle playback,
rather than needing to accurately click the playback button. Note this
does not affect other behavior-specific buttons; i.e. if the mute button
is pressed, we won't reach the playback toggle..
2023-07-03 19:07:26 +02:00
Timothy Flynn c2357a059e LibWeb: Mark media elements as focusable
This allows focusing media elements for keyboard control.
2023-07-03 19:07:26 +02:00
Timothy Flynn 3793b7c6bd LibWeb: Move helper to toggle a media element's playback to the element
This will be needed elsewhere.
2023-07-03 19:07:26 +02:00
Timothy Flynn 435ced70b8 LibWeb: Update the media element's display in a couple situations
Mostly seen on macOS, but when we toggle playing a media element, we
need to update its layout node's display to ensure the change is
reflected on the playback button. Further, when setting the element's
display time, we need to update the display to ensure the change is
refelected on the media timeline.
2023-07-03 19:07:26 +02:00
Timothy Flynn b57199ccb9 Ladybird: Propagate "empty" key events to the WebContent process
We currently drop events which do not have text associated with them.
This prevents e.g. arrow keys from being able to be handled by web
elements. We now match Browser's behavior on Serenity, where these key
events are already propagated.
2023-07-03 19:07:26 +02:00
Timothy Flynn 27ca90646d WebContent: Clear Serenity's audio buffers when seeking
Without this, the already-buffered audio may continue playing after a
seek. The SoundPlayer application does the same operation here.
2023-07-03 19:07:26 +02:00
Andreas Kling 21260ea2ef LibWeb: Merge did_remove_attribute() into attribute_changed()
Instead of having two virtuals for attribute change notifications,
there is now only one. When the attribute is removed, the value is null.
2023-07-03 19:04:45 +02:00
Andreas Kling 5a74486b59 LibWeb: Rename DOM::Element::parse_attribute() => attribute_changed()
This is a first step towards merging attribute change and removal
notifications into a single function.
2023-07-03 19:04:45 +02:00
Ali Mohammad Pur e1e04884b9 LibLine: Handle any errors propagated through refresh_display()
This can only realistically happen when the terminal no longer exists,
so quitting with an error here is the better solution as the application
will soon be killed anyway.
Fixes #19742.
Fixes #19017.
2023-07-03 19:07:33 +03:30
Hendiadyoin1 b26dad3d62 LibJS: Handle Calls argument range during EliminateLoads pass
Otherwise we could forget to emit stores those registers, thinking that
they are only directly accessed.
2023-07-03 16:55:13 +02:00
Lucas CHOLLET f52e3e540f LibGfx/JPEG: Add a fast path for sequential JPEGs
Decoding progressive JPEGs involves a much more complicated logic than
sequential JPEGs. Thanks to template specialization, this patch allow us
to skip the additional cost of progressive images when it's not needed.

It gives a nice 10% improvements on sequential JPEGs :^)
2023-07-03 14:26:15 +02:00
Andreas Kling 510dfbb7e6 LibWeb: Update anonymous wrappers when applying style changes
Anonymous wrapper boxes inherit style from their layout tree parent,
and since style data is per-layout-node, we have to manually sync them
from parent to anonymous children when something changes.

This is not very elegant or efficient, so I've left a FIXME about
solving it in a nicer way.

This fixes horizontal dog alignment on https://waffles.dog/ :^)
2023-07-03 13:37:14 +02:00
Andreas Kling b918ce4022 LibWeb: Make Layout::TextNode::text_for_rendering() lazily computed
As it turns out, Layout::TreeBuilder never managed to wrap text within
table boxes in anonymous wrapper boxes, since it relied on checking
text_for_rendering(), and that was never initialized during that early
stage of tree building.

This patch fixes the issue by making text_for_rendering() compute the
(potentially collapsed) text lazily when called.

Note that the test included with this patch is still totally wrong,
but that is now a TFC problem rather than a TreeBuilder problem. :^)
2023-07-03 11:50:58 +02:00
Andreas Kling 5cdb394400 LibWeb: Make HTML parser flush all pending tokens in "in table text"
There were multiple bugs in the parsing algorithm for handling text
occurring inside a `table` element:

- When there was pending non-whitespace text inside a table, we only
  flushed one token instead of all pending tokens.

- Also, we didn't even flush one of the right tokens, but instead the
  token that caused the flush to happen.

- Once we started flushing the right tokens, it turned out we had not
  yet implemented character insertion points expressed as "before X".

- Finally, we were not exiting the "in table text" mode after flushing
  pending tokens, effectively getting us stuck in that mode until EOF.
2023-07-03 11:50:58 +02:00
Andreas Kling 8c3e5137f7 LibWeb: Add spec comments to HTML parser "in table text" insertion mode 2023-07-03 11:50:58 +02:00
Andreas Kling 87f0c1c353 LibWeb: Add spec comments to HTML parser "in table" insertion mode
Also remove some overly anxious FIXMEs about slight variance in spec
language. :^)
2023-07-03 11:50:58 +02:00
Andreas Kling bac500b9ad LibWeb: Add spec comments to HTML parser "in row" insertion mode 2023-07-03 11:50:58 +02:00
Shannon Booth 8c8b24d877 diff: Add support for writing diffs in context format 2023-07-03 10:41:30 +02:00
Shannon Booth 44f141dd24 LibDiff: Add Diff::write_context_header
This is used to write a context patch header.
2023-07-03 10:41:30 +02:00
Shannon Booth f02cf2704c LibDiff: Add support for writing formatted context hunks
There is a little bit more complexity involved here than the other
formats. In particular, this is due to the need to determine whether
an addition line or removal line is just that, or a 'change'.
2023-07-03 10:41:30 +02:00
Andre Herbst 4bcf3ea0e1 Ports/libgd: Added --without-x to prevent linking against /usr/lib 2023-07-03 10:39:21 +02:00
Carwyn Nelson e7da956090 man: Change all uses of DeprecatedString to String 2023-07-03 02:05:32 +02:00
Carwyn Nelson e44abaa777 LibMarkdown: Convert render_to_terminal to String
This commit converts render_to_terminal from DeprecatedString to return
an ErrorOr<String>. This is to aid moving `man` away from
DeprecatedString.

I have opted not to convert render_to_html and render_to_inline_html for
now to keep this commit as small as possible.
2023-07-03 02:05:32 +02:00
Carwyn Nelson e247da507f LibCore: Add new String variants to ArgsParser
This commit adds the ability to use the String class with `add_option`
and `add_positional_argument`.

This should help with the transition away from DeprecatedString.
2023-07-03 02:05:32 +02:00
Daniel Bertalan d165590809 LibJS/Bytecode: Do not coerce the receiver to Object for internal_set
This makes the behavior of `Symbol` correct in strict mode, wherein if
the receiver is a symbol primitive, assigning new properties should
throw a TypeError.
2023-07-02 22:08:48 +01:00
Daniel Bertalan 0cd85ab0fc AK+LibJS: Make Number.MIN_VALUE a denormal
ECMA-262 implies that `MIN_VALUE` should be a denormalized value if
denormal arithmetic is supported. This is the case on x86-64 and AArch64
using standard GCC/Clang compilation settings.

test262 checks whether `Number.MIN_VALUE / 2.0` is equal to 0, which
only holds if `MIN_VALUE` is the smallest denormalized value.

This commit renames the existing `NumericLimits<FloatingPoint>::min()`
to `min_normal()` and adds a `min_denormal()` method to force users to
explicitly think about which one is appropriate for their use case. We
shouldn't follow the STL's confusingly designed interface in this
regard.
2023-07-02 21:19:09 +01:00
Cameron Youell 978fe3c6d5 Shell: Add option Produce symbolic output to umask
Its a standard posix option thats always nice to have :^)
2023-07-02 11:19:10 -06:00
Cameron Youell d9ff37e1b1 Utilities: Make mktemp follow the spec directory path resolution
Previously an input like this:

mktemp -d /tmp/dirtest_-XXXXX

Would result in an error when it should have created a temp directory
2023-07-02 11:19:10 -06:00
Cameron Youell 9630fe3ebc Utilities: Remove unused variable in mktemp 2023-07-02 11:19:10 -06:00
Shannon Booth ff23426b6e headless-browser: Write failed diffs in unified format with context 2023-07-02 11:18:11 -06:00
Shannon Booth 2c9db2de05 diff: Add support for writing diffs in unified format with context 2023-07-02 11:18:11 -06:00
Shannon Booth 55a3dfec10 LibDiff: Add support for generating diffs with surrounding context
While not used in normal diffs due to limitations in the format, this
may be used in context and unified format diffs.
2023-07-02 11:18:11 -06:00
Shannon Booth f528aedc85 LibDiff: Add Diff::write_unified_header
This is used to write a unified patch header.
2023-07-02 11:18:11 -06:00