Commit graph

52307 commits

Author SHA1 Message Date
Andrew Kaster
d185217599 Meta: Add gn linter
This just calls ``gn format`` on any .gn or .gni files, but it matches
the pattern of the other linters.
2023-07-13 14:07:25 -06:00
Andrew Kaster
a21a08cc9d Meta: Format LibWeb gn files
This was missed when merging the initial set. Linter should be next :^)
2023-07-13 14:07:25 -06:00
Andrew Kaster
9061ea4e90 Meta: Add a macOS bundle to gn build for ladybird
This allows opening the ladybird.app app bundle on macOS, using Xcode
tools like Instruments on the applications in the app bundle, and even
installing the app bundle into /Applications :^)
2023-07-13 14:07:25 -06:00
Andrew Kaster
18a4e882dc Meta: Setup rpath/install_name for macOS libraries and binaries in gn 2023-07-13 14:07:25 -06:00
Andrew Kaster
8475ccc232 Meta: Port c0f985ffcf to gn build 2023-07-13 14:07:25 -06:00
Andrew Kaster
2f16aa45b7 Meta: Port dd073b2711 to gn build 2023-07-13 14:07:25 -06:00
Andreas Kling
a3e4535f34 LibJS: Resolve rope strings directly to UTF-16 when preferable
When someone calls PrimitiveString::utf16_string() on a rope string,
we know for sure that the client wants a UTF-16 string and may not
be interested in a UTF-8 version at all.

To avoid round-tripping through UTF-8 in this scenario, callers can
now inform resolve_rope_if_needed() about their preferred encoding,
should rope resolution take place. The UTF-16 case is actually a lot
simpler than the UTF-8 case, since we can simply ask for UTF-16 data
for each fiber of the rope, and then concatenate all the fibers.

Since LibJS always uses UTF-16 for regular expression matching, this
avoids round-tripping through UTF-8 whenever the input to a regex test
is already UTF-16. :^)
2023-07-13 20:53:54 +02:00
Nico Weber
e78ea08ed9 pdf: Make --dump-contents print all objects referenced by page too 2023-07-13 20:29:58 +02:00
Nico Weber
ca433befa0 LibPDF: Add method to Document to dump a Page and all related objects
...except for the /Parent object, else we'd print all pages :)
2023-07-13 20:29:58 +02:00
Nico Weber
b4c5a7d1a0 LibPDF: Make Object::to_deprecated_string() look more like PDF source
- No , between array or dict elements
- `stream` goes in front of stream data, _after_ the stream dict

Also, print string contents as ASCII if the string data is mostly ASCII.
2023-07-13 20:29:58 +02:00
Aliaksandr Kalenik
cf47e130ae LibWeb: Print FIXME instead of crashing if fill is url() in svg text 2023-07-13 18:43:21 +02:00
Aliaksandr Kalenik
ca50da63e4 LibWeb: Do not crash if "fill: none" is specified for svg text 2023-07-13 18:43:21 +02:00
Aliaksandr Kalenik
e2c5e31292 LibWeb: Adjust grid columns size to fit spanning items
This change implements following paragraph from placement algorithm in
the spec:
"If the largest column span among all the items without a definite
column position is larger than the width of the implicit grid, add
columns to the end of the implicit grid to accommodate that column
span."

There were places in the grid implementation code with copies of this
text, but those were completely unrelated to the code where they were
being pasted so I removed them.
2023-07-13 16:54:53 +02:00
Andreas Kling
c0f985ffcf LibJS/Bytecode: Don't reparse regular expressions on instantiation
The RegExpLiteral AST node already has the parsed regex::Parser::Result
so let's plumb that over to the bytecode executable instead of reparsing
the regex every time NewRegExp is executed.

~12% speed-up on language/literals/regexp/S7.8.5_A2.1_T2.js in test262.
2023-07-13 13:30:49 +02:00
Andi Gallo
a098f38cab LibWeb: Compute border rectangles using CSSPixels
Defer conversion to device pixels until we need to paint. This
helps borders of cells with different spans align, since rounding early
makes addition non-associative.
2023-07-13 11:22:45 +01:00
Shannon Booth
e838b6c8cc patch: Add the beginnings of a patch utility
This is still very bare bones, and there is _much_ more to still
handle. However, this implements enough functionality to parse a single
unified patch read from stdin, and apply it to a file.
2023-07-13 10:29:30 +01:00
Shannon Booth
828d791a4f LibDiff: Add Diff::apply_patch
Given a set of lines from the file we are patching, and a patch itself,
this function will try and locate where in the file to apply that patch,
and write the result of patching that file (if successful) to the output
stream.
2023-07-13 10:29:30 +01:00
Shannon Booth
efb26b1781 LibDiff: Implement ability to parse a patch header
This is a somewhat naive implementation, but it is enough to parse a
simple unified patch header.

After parsing the patch header, the parser will be at the beginning of
the first hunks range, ready for that hunk to be parsed.
2023-07-13 10:29:30 +01:00
Shannon Booth
ef45221c21 LibDiff: Make parsing of unified hunks more robust
Parsing of the unified hunks now verifies that the expected number of
lines given by the unified location at the beginning of that hunk are
actually in that hunk. Furthermore, we no longer crash when given a
bogus unified range.

As a further benefit, this begins the scaffolding for a patch parser
which should assist us in parsing full patches - even when we are not
aware of the format that a patch has been written in.
2023-07-13 10:29:30 +01:00
Shannon Booth
b2d33c5689 LibFileSystem: Add FileSystem::is_regular_file 2023-07-13 10:29:30 +01:00
Shannon Booth
a5fd80a336 LibFileSystem: Add FileSystem::move_file
This is effectively a rename that falls back to a copy if the
destination is on a different mount point than the source.
2023-07-13 10:29:30 +01:00
Andreas Kling
640d48255b LibJS: Remove unhelpful environment lookup optimization for globals
This optimization was no longer helpful after the bug fix for missing
invalidation on global delete was introduced in 331f6a9e6, since we
now have to check bindings for presence in the global environment every
time anyway.

Since the bytecode VM now has fast GetGlobal in most cases, let's not
even worry about this and just remove the unhelpful "optimization".

In fact, removing this is actually an *optimization*, since we avoid
a redundant has_binding() check on every global variable access. :^)
2023-07-13 10:56:59 +02:00
Tim Ledbetter
6d2f9f0316 less: Replace LibC calls with their LibCore equivalents 2023-07-13 10:26:13 +02:00
Tim Ledbetter
e0fcfc8a99 less: Ignore SIGINT signals
This matches the behavior of less on Linux and FreeBSD.
2023-07-13 10:26:13 +02:00
Tim Ledbetter
7b0da10dd5 less: Restore original terminal state when SIGTERM is received 2023-07-13 10:26:13 +02:00
Andreas Kling
9e468579ce LibJS/Bytecode: Use malloc instead of mmap for BasicBlock buffers
Using mmap was quite punishing on inputs with lots of basic blocks,
such as test262 tests with eval() in a loop that goes 64k times..

~27% speed-up on language/literals/regexp/S7.8.5_A2.1_T2.js but
presumably everything everywhere will benefit from this. :^)
2023-07-13 10:19:10 +02:00
zhiyuang
ce6138fccd LibXML: Parser handle standalone declaration
Previously here missed a equal sign parsing
2023-07-13 09:11:51 +03:30
Ali Mohammad Pur
0c14698028 LibWeb: Fully implement CSS animation-timing-function
This implements all the timing functions, and hopefully all their
quirks.
Also changes the animation demo to use some funny cubic timing
functions.
2023-07-13 05:10:41 +02:00
Ali Mohammad Pur
efa55673cd Meta/CodeGenerators+LibWeb: Add support for 'easing-function' CSS values
This commit makes it possible to let properties accept easing functions
as values, which will be used in a later commit to implement
animation-timing-function.
2023-07-13 05:10:41 +02:00
Ali Mohammad Pur
dd073b2711 Meta/CodeGenerators+LibWeb: Implement parsing CSS easing functions
This only implements the parser bits, no functionality is implemented,
and no properties are parsed because of this.
2023-07-13 05:10:41 +02:00
Tim Schumacher
401544f68f Ports: Remove the separate branch for extracting .tar.gz files
This can just use the default `tar` invocation, which successfully
recognizes the type automatically. In fact, `.tar.gz` and `.tgz` are
already listed by that particular case anyways.
2023-07-13 05:09:46 +02:00
Tim Schumacher
58cf3b365e Ports: Don't import GPG keys on download
This was part of our setup for verifying GPG-signed files, but that is
no longer needed.
2023-07-13 05:09:46 +02:00
Tim Schumacher
b8cf8c6081 Ports: Remove the "no HTTPS" workaround
curl on SerenityOS now has HTTPS support, since we use the upstream
ca-certificates package.
2023-07-13 05:09:46 +02:00
Andreas Kling
158caf1b91 LibWeb: Include scrollable overflow in the "absolute paint rect"
This finally fixes the issue where stacking contexts that have either a
transform or opacity != 1 would clip their descendants to the root of
the stacking context.
2023-07-13 05:09:08 +02:00
Andreas Kling
bf25568703 LibWeb: Bring measuring of scrollable overflow closer to spec
Importantly, we now only consider overflow from descendants with
explicltly visible overflow, and only from descendants that have the
measured box as their containing block.

Also, we now measure scrollable overflow for all boxes, not just scroll
containers. This will allow us to fix a long-standing paint problem in
the next commit.
2023-07-13 05:09:08 +02:00
Andreas Kling
f23baf0a2d LibWeb: Add LineBox::absolute_rect()
Let's just calculate this once, at the end of a layout, and then never
have to worry about it again during painting.
2023-07-13 05:09:08 +02:00
Andreas Kling
d620dd516c LibGfx: Add Rect::unite_{horizontally,vertically}()
These functions unite the rect with another rect, but only in one axis.
2023-07-13 05:09:08 +02:00
Aliaksandr Kalenik
7af7e90e3f LibJS: Speed up has declaration check in ScopePusher
This change speeds up the process of checking variable declaration
within the scope by replacing the iteration through all declared
variables (without the ability to exit early from the loop) with hash
map lookups.

This change cuts google maps loading by 17s on my computer.
2023-07-13 04:58:16 +02:00
Nico Weber
62013f2008 pdf: Minorly tweak a help text 2023-07-13 04:53:59 +02:00
implicitfield
e504b63406 LibGUI: Make the calendar widget scrollable 2023-07-13 04:31:40 +03:30
implicitfield
28b5438395 ClockWidget: Deduplicate logic for updating calendar buttons 2023-07-13 04:31:40 +03:30
implicitfield
9a1018389c LibGUI+Calendar: Move date control logic to the calendar widget 2023-07-13 04:31:40 +03:30
Nico Weber
c625ba34fe LibPDF: Implement set_flatness_tolerance
We now track it in the graphics state. It isn't used for anything yet.
Fixes the one thing that rendering the first 100 pages of
pdf_reference_1-7.pdf complains about.
2023-07-12 18:22:52 -04:00
Nico Weber
52ff180ed4 pdf: Add --dump-contents flag
This dumps the /Content stream of a page, which is possibly useful for
debugging.
2023-07-12 18:22:35 -04:00
Nico Weber
16c1a6a447 pdf: Alphabetize options 2023-07-12 18:22:35 -04:00
Nico Weber
afb99a67b2 LibPDF: Tweak Page::page_contents() implementation for brevity
Also replace a FIXME with a spec comment that answers it.
2023-07-12 18:22:35 -04:00
Nico Weber
69c965b987 LibPDF: Move code to compute full page contents into Page
Pure code move, no behavior change.
2023-07-12 18:22:35 -04:00
Nico Weber
f4f8a6a1bf LibPDF: Move Page into its own file Page.h 2023-07-12 18:22:35 -04:00
Sebastian Zaha
88872ca42d LibIPC: Do not leak the Core::File fd by default
This prevents fd leaks when the user of the API forgets to pass
CloseAfterSending to IPC::File. Since we are calling leak_fd in the
constructor, we want it to also take care of closing.
2023-07-12 18:22:18 -04:00
Xexxa
318a3a0822 Base: Add more emoji
🧑‍🦽 - U+1F9D1 U+200D U+1F9BD PERSON IN MANUAL WHEELCHAIR
👨‍🦽 - U+1F468 U+200D U+1F9BD MAN IN MANUAL WHEELCHAIR
👩‍🦽 - U+1F469 U+200D U+1F9BD WOMAN IN MANUAL WHEELCHAIR
🕺 - U+1F57A MAN DANCING
🤹 - U+1F939 PERSON JUGGLING
🤹‍♂️ - U+1F939 U+200D U+2642 MAN JUGGLING
🤹‍♀️ - U+1F939 U+200D U+2640 WOMAN JUGGLING
🦣 - U+1F9A3 MAMMOTH
🎡 - U+1F3A1 FERRIS WHEEL
🛵 - U+1F6F5 MOTOR SCOOTER
💺 - U+1F4BA SEAT
🚳 - U+1F6B3 NO BICYCLES
🚯 - U+1F6AF NO LITTERING
2023-07-13 00:03:24 +02:00