1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:17:36 +00:00
Commit graph

43313 commits

Author SHA1 Message Date
Aliaksandr Kalenik
aa08c825ec LibWeb: Support box-sizing in BFC
Add support for box-sizing in block formatting context, support
for Flex Formatting Context and Grid Formatting Context is missing
2022-11-22 12:43:36 +01:00
Names4Noobs
610f1a5aab 3DFileViewer: Propagate key events to the window
Before this, shortcuts would not work due to key events not
being propagated to the window.
2022-11-22 11:23:44 +00:00
martinfalisse
0c577b4b3b Base: Add test for multiple line names in CSS Grid 2022-11-21 21:48:25 +00:00
martinfalisse
513a123728 LibWeb: Handle multiple line names in the CSS Grid
Prevent crashing when multiple line names are declared in the
grid-template-* CSS properties by skipping over the character separating
each line name.
2022-11-21 21:48:25 +00:00
Andreas Kling
849499988e LibJS+LibWeb: Make JS::ExecutionContext protect its Web::HTML::ESO owner
We can't be nuking the ESO while its owned execution context is still on
the VM's execution context stack, as that may lead to a use-after-free.

This patch solves this by adding a `context_owner` field to each context
and treating it as a GC root.
2022-11-21 19:22:09 +00:00
Timothy Flynn
1fdce71483 WebContent: Implement WebDriver's implicit timeout for finding elements 2022-11-21 18:54:22 +00:00
Timothy Flynn
297186c68a WebContent: Don't assume start nodes for finding elements remain valid
When timeouts are implemented, the start node used to find elements may
not remain valid for the entire duration of the timeout. For example,
the active document element may change, or the start node may be removed
from the DOM.

To handle this, we will need to re-evaluate the start node on each
iteration of the find() operation. This patch wraps the steps to do so
in a lambda to be executed on each iteration.
2022-11-21 18:54:22 +00:00
Timothy Flynn
061bca99a9 AK: Define a convenience alias for a Function's return type
This is nice when the return type is long and needs to be specified as
a lambda's return type many times to resolve ambiguity.
2022-11-21 18:54:22 +00:00
Baitinq
2f16198bd6 LibWeb: Remove unused should_invalidate_styles_on_attribute_changes()
This getter and setter were previously labelled as a "hack" and used to
disable style invalidation on attribute changes during the HTML parsing
phase (as it caused big sites's loading to be slow). These functions
are currently not used, so they can be removed:^)
2022-11-21 10:12:07 +01:00
Andreas Kling
e54ae1bd11 LibWeb: Don't implement bogus assertion in prepare-the-script-element
The HTML spec is asking us to make a possibly-bogus assertion, so let's
disable it for now.

Spec bug: https://github.com/whatwg/html/issues/8534
2022-11-21 10:08:50 +01:00
Andreas Kling
b21b27fda3 LibWeb: Update the HTML parser part that deals with text in <script>
This commit adds inline spec comments to the part of the parser that
ends up calling HTMLScriptElement::prepare().

The code is tweaked to match the spec more closely.
2022-11-21 10:08:50 +01:00
Andreas Kling
1aac1085b3 LibWeb: Update HTMLScriptElement prepare and execute to latest HTML spec
The net result is some nice simplification of the prepare algorithm
and a bit of initial scaffolding for import maps support.
2022-11-21 10:08:50 +01:00
Andreas Kling
7d45927d41 LibWeb: Rename HTMLScriptElement "non-blocking" to "force async"
This has been renamed in the spec, so let's do it here too.
2022-11-21 10:08:50 +01:00
Andreas Kling
7b9138be55 LibWeb: Add spec links to HTMLScriptElement member variables
This makes it much easier to see which members represent something in
the spec, and which ones are LibWeb implementation details.
2022-11-21 10:08:50 +01:00
Andreas Kling
db91552621 AK: Fix memory corruption due to BumpAllocator mmap reuse
There was a subtle mismatch between the obviously expected behavior
of BumpAllocator::for_each_chunk() and its actual implementation.

You'd think it would invoke the callback with the address of each chunk,
but actually it also took the liberty of adding sizeof(ChunkHeader) to
this address. UniformBumpAllocator::destroy_all() relied on this to
get the right address for objects to delete.

The bug happened in BumpAllocator::deallocate_all(), where we use
for_each_chunk() to walk the list of chunks and munmap() them.

To avoid memory mapping churn, we keep a global cache of 1 chunk around.
Since we were being called with the offset chunk address, it meant that
the cached chunk shifted 16 bytes away from its real address every time
we re-added it to the cache.

Eventually the cached chunk address would leave its memory region
entirely, and at that point, any attempt to allocate from it would yield
an address outside the region, causing memory corruption.
2022-11-21 12:37:49 +03:30
Aliaksandr Kalenik
767cdf7b11 LibWeb: Return content box position from calculate_static_position
This change makes calculate_static_position to return content box
for both x and y (at least for the case when children are not inline).
It makes it possible to be consistent about x and y when calculating
box offset inside layout_absolutely_positioned_element.
2022-11-20 21:54:39 +01:00
Jonah
b45225dbac LibJS/Temporal: Unroll the loop in to_temporal_time_record
This is an editorial change in the Temporal spec.
See: tc39/proposal-temporal@8e80575
2022-11-20 11:56:56 +00:00
Jonah
00da2e86e6 LibJS/Temporal: Unroll the loop in to_temporal_duration_record
This is an editorial change in the Temporal spec.
See: 8e80575
2022-11-20 11:56:56 +00:00
Jonah
912867526b LibJS/Temporal: Unroll the loop in to_temporal_partial_dictation_record
This is an editorial change in the Temporal spec.
See: 8e80575
2022-11-20 11:56:56 +00:00
Jonah
381b36b83f LibJS/Temporal: Rename ToIntegerWithRounding to ToIntegerIfIntegral
This is an editorial change to the Temporal spec.
See: 1dceb57
2022-11-20 11:56:56 +00:00
Jonah
1cd0b5ad8a LibJS/Temporal: Reorder Tables by Order of Magnitude
This is an editorial change in the Temporal spec.
See: f2d5642 and
07673d3
2022-11-20 11:56:56 +00:00
Zaggy1024
7aabda37d1 LibVT/LibLine: Delete words when pressing Ctrl+Backspace in Terminal 2022-11-20 03:57:17 +03:30
Andreas Kling
f7a252ae85 LibJS: Fix UTF-16 corruption in String.prototype.replace()
We were mistakenly trying to append UTF-16 code units to a StringBuilder
via the append(char) API. This patch fixes that by accumulating the
result in a Vector<u16> instead.

This'll be a bit worse for performance, since we're now doing additional
UTF-16 string conversions, but we're going for correctness at this stage
and can worry about performance later.
2022-11-19 11:30:06 -07:00
Sam Atkins
c279fd1097 cksum: Manually count file size instead of using stat()
`stat()` doesn't work for stdin, but this does.
2022-11-19 17:00:10 +00:00
Sam Atkins
b8a1d04a49 xml: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
fde9cba2a0 Utilities/w: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
8d798c2716 utmpupdate: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
6d7435d251 test-fuzz: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
f7fa88976f sysctl: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
722879e2b9 strace: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
4c3d2267db sql: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
f22d7ddd98 shot: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
84e817a9f2 route: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
97ef1ac260 pmap: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
bc76a4d787 nproc: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
c8b3e68c6e netstat: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
b5f4e96e71 mount: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
9d34a1f4a7 md: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
14ce07dd52 markdown-check: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
ccebf8bf59 man: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
75208f2333 lsusb: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
880b35739e lspci: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
376b5731a2 lsof: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
9e4689f4c8 lsirq: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
2be7f9f42d lscpu: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
03a3b6f91c lsblk: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
8d7179766a js: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
f6884235e2 LibCore: Add a ConfigFile::open() overload for Core::Stream::File
Core::Stream is already used internally, but ironically you could not
open a ConfigFile using one!
2022-11-19 17:00:10 +00:00
Sam Atkins
678b4983cb json: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins
1d67a1e73f ifconfig: Port to Core::Stream and Core::System 2022-11-19 17:00:10 +00:00