Commit graph

42805 commits

Author SHA1 Message Date
Liav A d69a0380e1 Kernel: Add copy_typed_from_user for non-const Userspace<T*> 2022-11-05 18:00:58 -06:00
Oleg Kosenkov 46c6176fad Games: Add BrickGame 2022-11-05 16:35:13 -06:00
Dan Klishch 73f4cfa930 AK: Introduce fixed-width floating point types (f32, f64, f80 and f128) 2022-11-05 16:04:12 -06:00
Christopher Wales 266882937d Toolchain: Disable makeinfo for binutils
This is necessary to build on MacOS. As discussed in #15530, Serenity
no longer appears to build on MacOS Ventura. This attempts to fix that
by enforcing it at the command level.
2022-11-05 14:23:21 -06:00
Andreas Kling 5839ef2ed8 LibWeb: Render text inside <input type=password> as asterisks (*)
This makes it possible to enter passwords while recording YouTube
videos. :^)
2022-11-05 18:54:39 +01:00
Andreas Kling b33a2eb9b1 LibWeb: Inherit style across shadow tree boundaries
This makes the text in <input> inherit style from the <input> element.
2022-11-05 18:54:39 +01:00
Andreas Kling 87b0ddb354 LibWeb: Add DOM::Node::parent_or_shadow_host_element()
This will be used in style computation to inherit style across shadow
tree boundaries.
2022-11-05 18:54:39 +01:00
Andreas Kling 9c46fb7337 Kernel: Make sys$msyscall() not take the big lock
This function is already serialized by the address space lock.
2022-11-05 18:54:39 +01:00
Timothy Flynn cfa5e03108 WebContent: Capture horizontal overflow in full document screenshots
The full-page screenshot was missing horizontal overflow content on most
web pages. Change the dimensions of the captured screenshot to match the
actual content size.
2022-11-05 17:21:30 +00:00
Timothy Flynn 2f5ceeac62 WebContent: Store and provide access to web page content size 2022-11-05 17:21:30 +00:00
Smrtnyk 2ba2e6ca0a LibJS: Rename ToShowTimeZoneNameOption to ToTimeZoneNameOption
This is an editorial change in Temporal spec.

See: ab5b1ba910
2022-11-05 15:44:49 +00:00
MacDue 6c6c94f05a LibWeb: Use relative units for gradients until painting
This commit tweaks gradients so resolve_color_stop_positions() no
longer cares about the actual length of the gradient. All stops
are resolved to relative positions along the gradient line
(between 0 and 1), and are only scaled back to pixels (if required)
during the actual painting.

This has no immediate benefit right now, but it might make using
CSS pixels for gradients easier :^)

This also includes some mild refactoring.
2022-11-05 14:12:23 +00:00
Easton Pillay 22d54cd446 LibGUI: Hold down Alt when clicking TreeView to expand full subtree
On other operating systems, if you hold down Alt when you click to
expand part of a tree, it expands all of the children of the node
you clicked. This commit makes our TreeView act the same way :)
2022-11-05 14:49:22 +01:00
Andreas Kling 7809cc6557 LibWeb: Use preferred flex item sizes as min/max-content contribution
When a flex item has a specific preferred size, that size should be its
contribution to the containers intrinsic sizes.

This fixes an issue on Patreon where the logo would cover the entire
viewport since the SVG had a large intrinsic size but the flex item
containing it had a small specified size in CSS.
2022-11-05 11:42:19 +01:00
Timothy Flynn ea7ce76d20 Browser: Add a context menu item to take a full document screenshot 2022-11-05 09:29:28 +01:00
Timothy Flynn 95e591b61b LibWebView+WebContent: Add an IPC to take a full document screenshot 2022-11-05 09:29:28 +01:00
Timothy Flynn 59b1dfa4e5 Browser: Rename "take screenshot" action to "take visible screenshot"
This is to differentiate between this and an upcoming action to take a
screenshot of the entire document.
2022-11-05 09:29:28 +01:00
Jelle Raaijmakers f652c75f34 CI: Check out PR merge branch instead of source 2022-11-05 00:20:58 -04:00
Linus Groh b667cd69ca Browser: Add a banner to tabs controlled by WebDriver
From https://www.w3.org/TR/webdriver/#security:

It is also suggested that user agents make an effort to visually
distinguish a user agent session that is under control of WebDriver from
those used for normal browsing sessions. This can be done through a
browser chrome element such as a “door hanger”, colorful decoration of
the OS window, or some widget element that is prevalent in the window so
that it easy to identify automation windows.
2022-11-04 23:38:38 -04:00
Linus Groh 3ed1a14371 Browser: Refactor WebDriver flag activation into a single function 2022-11-04 23:38:38 -04:00
Timothy Flynn b0eb45f7c7 WebDriver+Browser: Implement GET /session/{id}/element/{id}/screenshot 2022-11-05 01:10:03 +00:00
Timothy Flynn 3c1c2994f1 LibWebView+WebContent: Add an IPC to take an element screenshot 2022-11-05 01:10:03 +00:00
Timothy Flynn 424e80ee75 LibWebView+WebContent: Add an IPC to scroll an element into view
Note that even though there is no response, this IPC has to be
synchronous to allow all scroll events to trigger before returning to
the calling WebDriver process.
2022-11-05 01:10:03 +00:00
Timothy Flynn 3510fbbea8 WebContent: Abstract calculating an element's absolute rect to a helper 2022-11-05 01:10:03 +00:00
Andreas Kling c79e8aab0a LibWeb: Make ON_WHITESPACE less heavy in HTML tokenizer
Once we know that the current code point is an ASCII character, we can
just check if it's one of the HTML whitespace characters.

Before this patch, we were using the generic StringView::contains(u32)
path that splats a code point into a StringBuilder and then searches
for it with memmem().

This reduces time spent in the HTML tokenizer from 16% to 6% when
loading the ECMA-262 spec.
2022-11-05 00:31:11 +01:00
Andreas Kling b400a34984 LibWeb: Cache the first <base href> (in tree order) in Document
When parsing relative URLs, we have to check the first <base href> in
tree order (if one is available). This was getting *very* costly on
large DOMs with many relative urls.

This patch avoids all that repeated traversal by letting Document cache
the first <base href> and invalidating the cache whenever a <base>
element is added/removed/edited in the DOM.

The browser was stuck doing this for a *very* long time when loading
the ECMA-262 spec, and this removes that problem entirely.
2022-11-05 00:30:10 +01:00
Linus Groh 0aca69853c LibWeb: Add abort algorithm after creating controller in fetch_impl()
This ensures that the controller GCPtr is non-null by the time we
capture a copy of it for the lambda passed to the request signal's
add_abort_algorithm() method. Currently, the VERIFY() would always fail
when aborting the signal. The alternative to this would be adding a cell
setter to Handle, and ensuring that null handles have a HandleImpl as
well; this seems not worth the hassle right now. Thanks to Lubrsi for
catching this!

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2022-11-04 22:35:45 +00:00
Linus Groh 6cd57d4c15 LibWeb: Properly copy method and headers from the input in Request()
We were accidentally copying these from the newly created Request
object's underlying request, to itself. Thanks to Lubrsi for catching
this!

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2022-11-04 22:35:45 +00:00
Smrtnyk 71228a8d86 LibWeb: Bring XHR::open() closer to spec
FIXME addressed in open method:
 10. If async is false, the current global object is a Window object,
 and either this’s timeout is not 0 or this’s response type is not the
 empty string, then throw an "InvalidAccessError" DOMException.
2022-11-04 21:32:18 +00:00
Timothy Flynn 8eec25b7ae LibJS: Use more accurate number-to-string method in Number toExponential 2022-11-04 21:12:10 +00:00
Timothy Flynn 5898db8c0f LibJS: Use more accurate number-to-string method in Number toPrecision 2022-11-04 21:12:10 +00:00
Timothy Flynn d56205f991 LibJS: Use more accurate number-to-string method in Intl.NumberFormat
Intl.NumberFormat only ever wants literal number-to-digits here, without
extra exponential formatting.
2022-11-04 21:12:10 +00:00
Timothy Flynn 9620a092de LibJS: Publicly expose double_to_string and rename it number_to_string
Rename it to match the name used by the spec.

Add an override mode to skip formatting numbers with an exponential sign
(e.g. 1e23). This mode is needed by Number and Intl.NumberFormat, who
don't call out a specific number-to-string method to use (they just say
to make "the String consisting of the digits of n").
2022-11-04 21:12:10 +00:00
Smrtnyk efe82e5c91 LibJS: Rename ToShowCalendarOption to ToCalendarNameOption
This is an editorial change in the Temporal spec.

See: 2c9e2615f7
2022-11-04 21:00:25 +00:00
meiskam 71359ee453 LibCore: Handle resolving executable paths even when PATH is null
This fixes a crash when trying to run `Escalator Terminal` from Run
2022-11-04 11:40:41 -04:00
Andreas Kling 892a3e7d12 LibWeb: Replace <svg> sizing hack with slightly smaller hack
When the <svg> box has a definite size, we use the same size for its
geometry-box descendants. This was using the presence of `width` and
`height` attributes on the <svg> element as evidence that the size was
definite, but this made no sense. We now check if it's actually
definite instead.
2022-11-04 13:06:59 +01:00
Andreas Kling ac329d0a18 LibWeb: Make HTMLIFrameElement.contentWindow return the WindowProxy
This fixes an issue where contentWindow was not accessible immediately
after programmatically creating an iframe element.
2022-11-04 10:38:00 +01:00
Andreas Kling 4de3449ad6 LibWeb: Recurse into block-level children when hit testing a box
Otherwise, we always say you hit the parent, even when you're really
clicking on a child that's visually above the parent.
2022-11-04 10:38:00 +01:00
Andreas Kling 5aeb6fec68 LibWeb: Make hit testing traverse positioned descendants in right order
We were doing a forward traversal in hit testing which led to sometimes
incorrect results when multiple boxes were occupying the same X and Y
coordinate.
2022-11-04 10:38:00 +01:00
Gunnar Beutner f2ccb702e8 Meta: Make file-system resizing work on macOS
Previously we'd fail to execute the resize2fs tool which then results
in us recreating the image from scratch:

resizing disk image...
Image resized.
line 132: /usr/sbin/resize2fs: No such file or directory
failed, not using existing image
done
2022-11-04 09:05:36 +00:00
Timothy Flynn 558901acb4 LibTimeZone: Update to TZDB version 2022f
https://mm.icann.org/pipermail/tz-announce/2022-October/000075.html
2022-11-04 08:56:11 +00:00
Gunnar Beutner 0eb7d1e05c FileManager: Improve error handling when posix_spawn() fails
Previously we'd try to disown() the newly created process even if
posix_spawn() had failed.
2022-11-04 09:47:30 +01:00
Dan Klishch 59e87cc998 AK: Add static_assert to check for effective size of long double 2022-11-03 20:17:09 -06:00
Dan Klishch 56aa21a7dc LibJS: Implement precise double_to_string 2022-11-03 20:17:09 -06:00
Dan Klishch fdc53a5995 AK: Add framework for a unified floating point to string conversion
Currently, the floating point to string conversion is implemented
several times across the codebase. This commit provides a pretty
low-level function to unify all of such conversions. It converts the
given double to a fixed point decimal satisfying a few correctness
criteria.
2022-11-03 20:17:09 -06:00
Dan Klishch 17c9a3e8d9 AK+LibC+LibCrypto: Move FloatExtractor to AK/FloatingPoint.h 2022-11-03 20:17:09 -06:00
Timothy Flynn 2d75229192 WebDriver+Browser: Implement GET /session/{id}/element/{id}/selected 2022-11-03 19:40:43 -04:00
Timothy Flynn 4067138702 LibWebView+WebConent: Add an IPC to get an element's selected state 2022-11-03 19:40:43 -04:00
Timothy Flynn d907fb304e WebDriver: Pass StringView by value
See: 8b1108e485.
2022-11-03 19:40:43 -04:00
Timothy Flynn 92cb67522d WebDriver: Consolidate getting a known connected element to a helper
Instead of verbosely repeating the NOTE and to_int() checks, move this
step to a helper. When we have real connected elements, we can then just
fix this helper.
2022-11-03 19:40:43 -04:00