Skipping all stacking contexts with a size larger than 10000px in one
dimension was a mistake because it also affects pages that are simply
tall due to having a lot of content. Instead, we only need to skip if
the stacking context requires the allocation of a framebuffer that
could possibly fail.
Fixes https://github.com/SerenityOS/serenity/issues/23397
By caching the layout node and its computed values in locals, we can
avoid the small amount of redundant work needed to look them up every
single time.
This removes indirection when asking if a paintable is positioned,
floating, etc.
Removes a bunch of 1-1.5% items in the profile when hovering links
on ziglang.org.
Update to the latest version of the spec which was refactored to use
time zone methods record. This requires updating a whole bunch of
callers to pass through a record too.
This also ends up improving exceptions on a missing
getOffsetNanosecondsFor method.
This can be perfectly valid, and depends on the property being animated.
For example, interpolating between the StyleValue "none" (an identifier)
and a TransformationStyleValue is perfectly defined.
In the upcoming commits where we properly handle transformation
interpolation, it actually becomes easier to change this back to custom,
so lets do that since its more correct anyways.
Introduces CIDIterator, an iterator type for iterating over CIDs.
Also introduces Type0CMap which can return a CIDIterator given some
bytes.
The existing code of treating the bytes as an identity map of
big-endian u16s is now implemented in IdentityType0CMap.
No behavior change.
Since commit e6df1c9988 which switched us
over to using the syscall/sysret instruction the second syscall
argument changed from rcx to rdi. Update strace as well to print the
actually correct values for the second arg.
...to avoid allocating a copy of glyph run for painting commands. We
can't simply save pointers to a glyph run in layout/paintable tree
because it should be safe to deallocate layout and paintable trees
after painting commands are recorded, if in the future we decide to
move command execution to a separate thread.
Instead of allocating a new glyph run to scale glyph positions and
fonts, a scale factor could be encoded in a paint command and applied
later during command execution.
Instead of allocating a new glyph run solely to shift each glyph by the
painter's offset, this offset could be encoded in a paint command and
applied later during command execution.
Every single client of this function was immediately calling paintable()
on the result anyway, so there was no need to return a layout node!
This automatically leverages the cached containing block pointer we
already have in Paintable, which melts away a bunch of unnecessary
traversal in hit testing and painting. :^)
This will allow us to get at the font's glyphs as paths, which will
eventually enable us to implement glyph rotation. We'll have to do our
own caching then, but we can then hopefully share the caching across the
Type0 / Type1 / TrueType codepaths.
It also gives us access to a font's glyphs by glyph id, which will help
us implementing looking up glyph ids by postscript name. (Else we'd
have to plumb through a whole Painter::draw_glyph_by_postscript_name()
API just for LibPDF.)
No behavior change.
It's like ScaledFont::with_size(), except that it guarantees that the
result is non-null and ScaledFont. (Smart pointers don't allow
covariant return types, else we could just narrow down the return
type of with_size() while still overriding the base method.)
No behavior change.
`var` declarations can have duplicates, but duplicate `let` or `const`
bindings are a syntax error.
Because of this, we can sink `let` and `const` directly into the
preferred_dst if available. This is not safe for `var` since the
preferred_dst may be used in the initializer.
This patch fixes the issue by simply skipping the preferred_dst
optimization for `var` declarations.
Liberation Sans still doesn't have the vast majority of the
Zapf Dingbats glyphs, but now we map the Zapf Dingbats names to good
unicode values. So we only need to use a different font and all should
work. (And Liberation Sans has _some_ of the glyphs, like 13 of the
223.) And we now render empty squares instead of wrong glyphs for the
ones we don't have.
I haven't seen any PDFs using ZapfDingbats in the wild, but they
probably exist somewhere.
(Tests/LibPDF/standard-14-fonts.pdf is a synthetic PDF using it.)
Turns out there's a spec that goes with the table.
The big change here is that we can now map `uni1234` to 0x1234 and
`u123456` to 0x123456.
The parts where we split a name on `_` and map each component
and the part where we're supposed to allow multiple groups of 4
after `uni` aren't implemented yet.
The ZapfDingbats lookup is also still missing.
I haven't seen this have an effect in practice, but it's easy to
construct a PDF with a custom encoding where it would make a
difference.