Commit graph

36608 commits

Author SHA1 Message Date
djwisdom
dc203a6682 Base: Add new glyphs to Satori Mono Regular
Control Pictures
 2400-2426

Miscellaneous Symbols
 2644,2645,2647-264A,264C-2653,268A-2693,
 26A5,26A6,26A8-26AF
2022-03-31 13:22:22 -04:00
djwisdom
29fde9bc29 Base: Add new glyphs to Satori Mono Bold
Control Pictures
 2400-2426

Miscellaneous Symbols
 2644,2645,2647-264A,264C-2653,268A-2693,
 26A5,26A6,26A8-26AF
2022-03-31 13:22:22 -04:00
djwisdom
e7d4d6a318 Base: Add new glyphs to Satori Bold
Control Pictures
 2400-2426

Miscellaneous Symbols
 2644,2645,2647-264A,264C-2653,268A-2693,
 26A5,26A6,26A8-26AF
2022-03-31 13:22:22 -04:00
Itamar
9cd27d1e15 LanguageServers/Cpp: Add SemanticType::PreprocessorMacro
This adds a new semantic token type, PreprocessorMacro.

Calls to preprocessor macros will now be highlighted when semantic
highlighting is enabled in Hack Studio.
2022-03-31 19:10:15 +02:00
Itamar
597ca68e2d LibCpp: Fix parsing of macro calls
Previously, macro calls with 0 arguments where incorrectly parsed as
calls to a macro with a single argument that doesn't contain any tokens.
2022-03-31 19:10:15 +02:00
Itamar
53c6c36fba LibGUI: Add AutocompleteProvider::TokenInfo::type_to_string() 2022-03-31 19:10:15 +02:00
Andreas Kling
3ab7388754 PixelPaint: Draw layer thumbnails with bilinear filtering
This makes them look a little nicer than basic nearest-neighbor.
2022-03-31 18:25:06 +02:00
Andreas Kling
7047a5ca59 LibJS: Allow JS::make_handle(T*) to be called with nullptr
Instead of asserting, just return an empty Handle.
2022-03-31 18:25:06 +02:00
Sahan Fernando
d98f12b928 3DFileViewer: Fix seam in normals of teapot.obj 2022-03-31 18:11:28 +02:00
Ali Mohammad Pur
7ea095feb0 LibJS: Don't assume that for-in/of target is a variable on LHS::Assign
e.g. `for ([foo.bar] in ...)` is actually a binding pattern.
2022-03-31 18:11:08 +02:00
Ali Mohammad Pur
56c0fdc1c4 LibJS: Implement codegen for MemberExpression binding patterns 2022-03-31 18:11:08 +02:00
Ali Mohammad Pur
007ffcd763 LibJS: Implement bytecode generation for all ObjectExpression properties 2022-03-31 18:11:08 +02:00
Matthew Olsson
698fb3957a LibPDF: Fix security-handler-related nullptr regression 2022-03-31 18:10:45 +02:00
Matthew Olsson
b69488031b LibPDF: Fix mismatched class/struct declaration 2022-03-31 18:10:45 +02:00
Matthew Olsson
6bed20f456 PDFViewer: Use ArgsParser 2022-03-31 18:10:45 +02:00
Matthew Olsson
468ceb1b48 LibPDF: Rename Command to Operator
This is the correct name, according to the spec
2022-03-31 18:10:45 +02:00
Matthew Olsson
49cb040c27 LibPDF: Fix some base-encoding-related crashes 2022-03-31 18:10:45 +02:00
Matthew Olsson
4d0f74a15c LibPDF: Add Type0 and TrueType fonts 2022-03-31 18:10:45 +02:00
Matthew Olsson
e831c374f4 LibPDF: Abstract Type1 font data
TTF font types will use the same data
2022-03-31 18:10:45 +02:00
Matthew Olsson
058cf5f7f7 LibPDF: Accept font size in PDFFont::get_char_width
This will be required for TTF fonts
2022-03-31 18:10:45 +02:00
Matthew Olsson
5f9d35909d LibPDF: Move font files into their own directory 2022-03-31 18:10:45 +02:00
Matthew Olsson
d2771eafc5 LibPDF: Use Font /Widths array to derive character widths
This makes the spacing between chars _much_ better!
2022-03-31 18:10:45 +02:00
Matthew Olsson
130846f337 LibPDF: Use AntiAliasingPainter in Renderer when possible 2022-03-31 18:10:45 +02:00
Matthew Olsson
8224ca6150 LibPDF: Fix more bad Renderer text positioning calculations 2022-03-31 18:10:45 +02:00
Matthew Olsson
34efc668d2 LibPDF: Handle SCN and scn operators 2022-03-31 18:10:45 +02:00
Matthew Olsson
e1115cfe48 LibPDF: Add basic ICCBased color space handling 2022-03-31 18:10:45 +02:00
Matthew Olsson
1238e65d30 LibPDF: Move color space creation from Renderer to ColorSpace 2022-03-31 18:10:45 +02:00
Linus Groh
8e175b4959 LibJS: Adjust ISO8601 representation for years between 1 BCE and 999 CE
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/39eeecd
2022-03-31 17:09:10 +01:00
Linus Groh
cfb04765fa LibJS: Correct PlainYearMonth arithmetic for non-ISO calendars
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/61e8dd0
2022-03-31 17:09:10 +01:00
Linus Groh
b020b8eea2 LibJS: Handle Etc/GMT timezones properly in TimeZone{IANA,Bracketed}Name
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/8c73780
2022-03-31 17:09:10 +01:00
Linus Groh
b5392f9e39 LibJS: Emit reference information for { calendarName: "always" } option
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/4f7519a
2022-03-31 17:09:10 +01:00
Linus Groh
29aa938fa5 LibJS: Fix Duration.compare() for dates with unusual number of hours
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/08bcd53
- https://github.com/tc39/proposal-temporal/commit/e962797
2022-03-31 17:09:10 +01:00
Linus Groh
b64080a913 Base: Add a <noscript> test page 2022-03-31 17:08:38 +02:00
Linus Groh
04e40b7aaa Browser+WebContent: Add a Debug menu action to disable scripting :^) 2022-03-31 17:08:38 +02:00
Linus Groh
780e5441b4 WebContent: Add plumbing for 'is scripting enabled' setting 2022-03-31 17:08:38 +02:00
Linus Groh
7bdbac7fd9 LibWeb: Add 'is scripting enabled' concept to EnvironmentSettingsObject
This is now the source of truth for 'user enabled/disabled scripting',
but it has to ask the window's page, which actually stores the setting.

Also use this new functionality in two places where it was previously
marked as a FIXME.
2022-03-31 17:08:38 +02:00
Linus Groh
f60a2a1d80 LibWeb: Remove Document::is_scripting_enabled() and use Node's
There's no need to have a custom is_scripting_enabled() for the
Document class, as it (indirectly) inherits from Node.
Also, let's not hardcode false here :^)
2022-03-31 17:08:38 +02:00
Hendiadyoin1
c79e4961f6 LibJS: Add explicit default copy+move constructors to ThrowCompletionOr
This stops clangd from complaining about not being able to determine the
copy-constructibility of ThrowCompletionOr and Completion.
2022-03-31 09:25:17 -04:00
kleines Filmröllchen
09a12247fb AK: Use bucket states with special bit patterns in HashTable
This simplifies some of the bucket state handling code, as there's now
an easy way of checking the basic category of bucket state.
2022-03-31 12:06:13 +02:00
kleines Filmröllchen
8dc24d0256 Tests: Test non-trivial re-hashing in HashTable
This caused a system-wide crash because of a previous bug relating to
non-trivial types in HashTable. Therefore, check that such types
actually work under various workloads.
2022-03-31 12:06:13 +02:00
kleines Filmröllchen
49d29c8298 AK: Rehash HashTable in-place instead of shrinking
As seen on TV, HashTable can get "thrashed", i.e. it has a bunch of
deleted buckets that count towards the load factor. This means that hash
tables which are large enough for their contents need to be resized.
This was fixed in 9d8da16 with a workaround that shrinks the HashTable
back down in these cases, as after the resize and re-hash the load
factor is very low again. However, that's not a good solution. If you
insert and remove repeatedly around a size boundary, you might get
frequent resizes, which involve frequent re-allocations.

The new solution is an in-place rehashing algorithm that I came up with.
(Do complain to me, I'm at fault.) Basically, it iterates the buckets
and re-hashes the used buckets while marking the deleted slots empty.
The issue arises with collisions in the re-hash. For this reason, there
are two kinds of used buckets during the re-hashing: the normal "used"
buckets, which are old and are treated as free space, and the
"re-hashed" buckets, which are new and treated as used space, i.e. they
trigger probing. Therefore, the procedure for relocating a bucket's
contents is as follows:
- Locate the "real" bucket of the contents with the hash. That bucket is
  the starting point for the target bucket, and the current (old) bucket
  is the bucket we want to move.
- While we still need to move the bucket:
  - If we're the target, something strange happened last iteration or we
    just re-hashed to the same location. We're done.
  - If the target is empty or deleted, just move the bucket. We're done.
  - If the target is a re-hashed full bucket, we probe by double-hashing
    our hash as usual. Henceforth, we move our target for the next
    iteration.
  - If the target is an old full bucket, we swap the target and to-move
buckets. Therefore, the bucket to move is a the correct location and the
former target, which still needs to find a new place, is now in the
bucket to move. So we can just continue with the loop; the target is
re-obtained from the bucket to move. This happens for each and every
bucket, though some buckets are "coincidentally" moved before their
point of iteration is reached. Either way, this guarantees full in-place
movement (even without stack storage) and therefore space complexity of
O(1). Time complexity is amortized O(2n) asssuming a good hashing
function.

This leads to a performance improvement of ~30% on the benchmark
introduced with the last commit.

Co-authored-by: Hendiadyoin1 <leon.a@serenityos.org>
2022-03-31 12:06:13 +02:00
kleines Filmröllchen
e73e579446 Tests: Introduce a HashTable benchmark for "table thrashing"
Thrashing is what I call the situations where a table is mostly filled
with deleted markers, causing an increase in size (at least temporarily)
when a simple re-hash would be enough to get rid of those. This happens
when a hash table (especially with many elements) has a lot of deletes
and re-inserts done to it, which is what this benchmark does.
2022-03-31 12:06:13 +02:00
kleines Filmröllchen
bcb8937898 AK: Merge HashTable bucket state into one enum
The hash table buckets had three different state booleans that are in
fact exclusive. In preparation for further states, this commit
consolidates them into one enum. This has the added benefit on not
relying on the compiler's boolean packing anymore; we definitely now
only need one byte for the bucket state.
2022-03-31 12:06:13 +02:00
Brian Gianforcaro
7d667b9f69 LibELF: Remove unused m_program_interpreter member from DynamicLoader
While profiling I realized that this member is unused, so the
StringBuilder and String allocation are completely un-necessary.
2022-03-31 10:18:07 +02:00
Brian Gianforcaro
39f924a731 LibELF: Skip DynamicObject::dump() if logging isn't enabled
I noticed that we were populating this StringBuilder and then throwing
away the result while profiling `true` with UserSpace emulator.

Before:

    courage:~ $ time -n 1000 true
    Timing report: 3454 ms
    ==============
    Command:         true
    Average time:    3.45 ms (median: 3, stddev: 3.42, min: 0, max:11)
    Excluding first: 3.45 ms (median: 3, stddev: 3.42, min: 0, max:11)

After:

    courage:~ $ time -n 1000 true
    Timing report: 3308 ms
    ==============
    Command:         true
    Average time:    3.30 ms (median: 3, stddev: 3.28, min: 0, max:12)
    Excluding first: 3.30 ms (median: 3, stddev: 3.29, min: 0, max:12)
2022-03-31 10:18:07 +02:00
Idan Horowitz
1577bac6a5 LibWeb: Add the HTMLOrSVGElement IDL interface mixin 2022-03-31 01:10:47 +02:00
Idan Horowitz
46fa18657c LibWeb: Use a callback function in ResizeObserver IDL 2022-03-31 01:10:47 +02:00
Idan Horowitz
b267c4178a LibWeb: Use a callback function in IntersectionObserver IDL 2022-03-31 01:10:47 +02:00
Idan Horowitz
f45d361f03 LibWeb: Replace ad-hoc EventHandler type with callback function typedef 2022-03-31 01:10:47 +02:00
Idan Horowitz
1c4f128fd1 LibWeb: Add support for IDL callback functions 2022-03-31 01:10:47 +02:00