This stops us from mangling our LLVM patch names and titles when using
`./package.sh dev`, as they like to put their category names in square
brackets.
It's not safe to capture `this` as a raw pointer here, since nothing
is guaranteed to keep the ResourceClient alive (even if the Resource
stays alive.)
Instead of creating a new HTMLCollection every time you access
.children, we now follow the spec and vend the same object.
This was annoyingly difficult before, and trivial now that the DOM is
garbage-collected. :^)
Some emojis were modified to be more in style with
the new calendar emoji.
Date has been changed from July 24 to October 10.
October 10 is the date of the first release of SerenityOS.
Modified:
📅 - U+1F4C5 CALENDAR
📆 - U+1F4C6 TEAR-OFF CALENDAR
New:
🗓 - U+1F5D3 SPIRAL CALENDAR
🌳 - U+1F333 DECIDUOUS TREE
🔪 - U+1F52A KITCHEN KNIFE
🪐 - U+1FA90 RINGED PLANET
🎶 - U+1F3B6 MUSICAL NOTES
🏷️ - U+1F3F7 LABEL
🧰 - U+1F9F0 TOOLBOX
Rather than invoking AK::Time::from_timestamp at runtime, we can do so
at compile time. This reduces invoking TimeZone::get_time_zone_offset
100,000 times in a loop from about 7 seconds to 30 milliseconds.
Instead of asking Gfx::FontDatabase for the "default font" and the
"default fixed-width font", we now proxy those requests out via
the Platform::FontPlugin. This will allow Ladybird to use other default
fonts as fallback.
We compute the effective overload sets for each argument count at build
time, to save us having to do it every time a function with overloads
is called.
This requires a little explanation. The overload resolution algorithm,
where this is used, repeatedly has steps like this:
> Otherwise: if V is a platform object, and there is an entry in S that
> has one of the following types at position i of its type list,
> - an interface type that V implements
> - object
> - a nullable version of any of the above types
> - an annotated type whose inner type is one of the above types
> - a union type, nullable union type, or annotated union type that has
> one of the above types in its flattened member types
> then remove from S all other entries.
So, the API here tries to match that. We save the matching entry when
checking through them and then use that in `remove_all_other_entries()`.
Removing all those entries when all we actually care about is looking at
that one matching entry feels silly, but sticking to the spec is more
important while things are still half-implemented. :^)
As part of this, I've moved a couple of methods for checking for
null/undefined from UnionType to Type, and filled in more of their
steps.
This now detects more, and so causes us to hit a `TODO()` which is too
big for me to go after right now, so I've replaced that assertion with
a log message.
Track the kind of Type it is, and use that to provide some convenient
`is_foo()` / `as_foo()` methods. While I was at it, made these all
classes instead of structs and made their data private.
IDL function overload resolution requires knowing each IDL function's
parameters and their types at runtime. The simplest way to do that is
just to make the types the generator uses available to the runtime.
Parsing has moved to LibIDL, but code generation has not, since that is
very specific to WrapperGenerator.
Destruction of `GL::GLContext` resulted in the destruction of
`GPU::Driver` _before_ the destruction of the allocated textures, which
in turn point to `GPU::Image` objects. Since the destruction of
`GPU::Driver` unloads the shared library, we were trying to invoke
non-existing code.
Fix this by moving `m_driver` up in `GLContext` so that it's last in
line for destruction.
conditionally_parse_page_tree_node used to assume that the xref table
contained a byte offset, even for compressed objects. It now uses the
common facilities for parsing objects, at the expense of some
performance.
When looking up differences in the specified encoding, we previously
didn't recognize a lot of characters, namely those that are referred to
by a string in the PDF itself, like "/germandbls".
We now create a mapping of those characters to the code points they are
referring to, and correctly look them up when needed.
As per spec, the positioning (or kerning) parameter of this operator
should translate the text matrix before the next showing of text.
Previously, this calculation was slightly wrong and also only applied
after the text was already shown.
Now, whenever the xref table points to a compressed object,
parse_object_with_index will look it up in the corresponding object
stream as if it were a regular object.
With this, our parser gains the bare minimum support for xref streams.
Since PDF version 1.5, a document may omit the xref table in favor of
a new kind of xref stream object. This is used to reference so-called
"compressed" objects that are part of an object stream.
With this patch we are able to parse this new kind of xref object, but
we'll have to implement object streams to use them correctly.
The Parser class is now a generic PDF object parser, of which the new
DocumentParser class derives. DocumentParser now takes over all
functions relating to linearization, pages, xref and trailer handling.
This allows the use of multiple parsers in the same document's
context, which will be needed in order to handle PDF object streams.
The test-case is heavily inspired by:
https://github.com/google/brotli/blob/master/tests/testdata/x.compressed.01
Or in words: A metadata meta-block containing `Y` (which should be
ignored), and then the actual data (a single `Z`). The bug used to skip
one metadata byte too few, and thus read garbage.