Commit Graph

28481 Commits

Author SHA1 Message Date
MacDue
b340a85523 LibWeb: Make StackingContext functions static where possible
These don't need to be member functions, and this will make it easier
to use these to paint <mask> elements (into an off-screen mask bitmap).
2023-09-19 10:46:05 +02:00
MacDue
dc58b5f418 LibWeb: Add CSS mask property and make it form a stacking context 2023-09-19 10:46:05 +02:00
MacDue
b69e8ee893 LibGfx: Add Gfx::Bitmap::apply_mask()
This allows applying an alpha or luminance mask to a bitmap (of the same
size) inplace.
2023-09-19 10:46:05 +02:00
Kemal Zebari
93e230ba58 LibWeb/URL: Use the correct spec URL comment for URL::port()
Since in the previous snapshot we were using the hostname setter's
spec URL.
2023-09-19 08:18:45 +02:00
Andreas Kling
9ccf25fdbe LibJS: Avoid StringView->DeprecatedFlyString conversions in FDI 2023-09-19 07:17:27 +02:00
Andreas Kling
e32a597d78 LibJS: Fix VariableNameToInitialize name spelling 2023-09-19 07:11:17 +02:00
Andreas Kling
e03f43e1b5 LibJS: Remove unused HashTable in function_declaration_instantiation() 2023-09-19 07:06:50 +02:00
Aliaksandr Kalenik
edd2f8b37f LibJS: Run reusable steps of FunctionDeclarationInstantiation only once
This change moves steps that can be executed only once and then reused
in subsequent function instantiations from
`function_declaration_instantiation` to the ECMAScriptFunctionObject:
- Determine if there are any parameters with duplicate names.
- Determine if there are any parameters with expressions.
- Determine if an arguments object needs to be created.
- Create a list of distinct function names for which bindings need to
  be created.
- Create a list of distinct variable names for which bindings need to
  be created.

This change makes React-Redux-TodoMVC test in Speedometer
run 10% faster :)
2023-09-19 06:54:10 +02:00
Bastiaan van der Plaat
aed25991e6 Maps: Add MapsSettings with multiple tile providers options 2023-09-18 12:46:41 -06:00
Bastiaan van der Plaat
264782557e Maps: Fix bug when opening attribution url by adding launch unveil 2023-09-18 12:46:41 -06:00
Tim Ledbetter
9cd3477763 GameOfLife: Replace DeprecatedString with String 2023-09-18 11:12:25 -06:00
Bastiaan van der Plaat
e3cd789ea8 Maps: Add context menu to the map widget 2023-09-18 11:12:04 -06:00
Bastiaan van der Plaat
9939b028c6 LibWeb: Add basic Navigator send beacon support 2023-09-18 11:08:26 -06:00
Hendiadyoin1
d262670729 LibWeb: Use more CSSPixelFractions in GFC::expand_flexible_tracks
Also contains a drive-by expression simplification, and accidental
double truncation fix.
2023-09-18 18:02:51 +02:00
Tim Ledbetter
9b30dea889 LibGUI: Remove Action::try_create_checkable() 2023-09-18 18:00:45 +02:00
Tim Ledbetter
f570a0f0b8 LibGUI: Remove ItemListModel::try_create() 2023-09-18 18:00:45 +02:00
Tim Ledbetter
a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +02:00
Aliaksandr Kalenik
a4a94de942 LibJS: Get initial_value from local variables if id represents a local
If identifier represents local variable we should get its value from
`local_variables` in `ExecutionContext` instead of environment.
2023-09-18 17:57:56 +02:00
Andreas Kling
675d919dd2 LibWeb: Handle custom ident values for the CSS font-family property
We were parsing these all right, but ignoring them in StyleComputer.

No test unfortunately, since we don't currently have a way to delay
the load event until a @font-face has been fully loaded. (Any test
of this right now would be flaky.)
2023-09-18 16:34:01 +02:00
Andreas Kling
1f69e9cddf LibWeb: Remove Layout::Node::m_visible and compute it on the fly
This fixes an issue where the value would be out of sync with reality
in anonymous wrapper block boxes, since we forgot to compute m_visible
after assigning the computed values to them.

Fixes #21106
2023-09-18 14:45:20 +02:00
Andreas Kling
0a133ccba4 LibWeb: Remove the HTML blink element
Support for this element has been removed from all major engines years
ago already, and it's currently the only reason we have a weird
"visible" flag on Layout::Node (which we toggle on a timer here..)
2023-09-18 14:45:20 +02:00
Daniel Bertalan
1f747b9132 CMake: Use CMAKE_POSITION_INDEPENDENT_CODE instead of explicit -fpic
This makes CMake pass `-fpie` instead of `-fpic` to the compiler when
building the Kernel and userland *executables*. This allows the compiler
to make certain optimizations based on the fact that the code will be
used in an executable, such as not having to emit `.localalias` symbols.
This leads to a 450 KiB decrease in the size of the Kernel binary.
2023-09-18 10:26:42 +02:00
Andrew Kaster
78c2fad89c LibTimeZone: Include generated files before checked-in files
This is a rickety solution to a problem when using LibTimeZone as a
static archive, like we do for Android. When pulling symbols from an
archive into a shared library, lld will pick the weak symbols for our
timezone helpers and keep them. Even if there's a strong symbol in
another object file in the same archive, it ignores them. However,
if we make sure that the strong symbols for the generated files are
first in the list, then we avoid the problem altogether by relying
on linker specifics.
2023-09-17 19:22:29 -06:00
Andrew Kaster
091a0e0b78 LibWeb: Report Android 10 as OS_STRING in user agent on Android
Some websites, such as m.youtube.com, sniff for a version after the
Android OS version. Chrome has recently taken to always reporting
Android 10, so let's follow suit.
2023-09-17 19:22:29 -06:00
Cubic Love
2767fa78f8 Solitaire: Rearrange Help Menu
Rearrange the Help menu actions so they're in the same order as other
application's Help menus.
2023-09-17 17:26:32 -06:00
Tim Ledbetter
784ac6b9f2 less: Allow quitting with uppercase 'Q' 2023-09-17 17:10:50 -06:00
Tim Ledbetter
c9e4a82c04 WebServer: Return 403 for a GET request to an inaccessible path
Previously, trying to access a non-readable file would cause a
connection reset in the browser; trying to access a non-executable
directory would show a completely empty directory listing.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
b2f0c50376 WebServer: Don't display file on directory listing if stat call fails
Previously, the program would crash when attempting to display a symlink
which pointed outside of the permitted directory.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
1dd0791c7e WebServer: Use human-readable sizes on directory listing
A size is no longer displayed for directories; previously, a size of
4096 was always shown.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
cbf39dfddd LibWeb: Use human-readable sizes on directory listing
A size is also no longer displayed for directories.
2023-09-17 17:10:04 -06:00
Tim Ledbetter
19dfdeeaec GameOfLife: Add a tick counter to the status bar
The counter is incremented after each new generation and reset
whenever any cell on the board is toggled. Resizing the board
does not reset the tick count.
2023-09-17 16:51:58 -06:00
Bastiaan van der Plaat
7e9ea964a8 LibWeb: Use TRY in DOMMatrix and DOMPointReadOnly 2023-09-17 16:48:54 -06:00
Bastiaan van der Plaat
8e7d3a6acc LibWeb: Add missing Canvas Context2D transform functions 2023-09-17 16:48:54 -06:00
Tim Ledbetter
0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Liav A
b6b2c6f3e2 PackageManager: Create /usr/Ports directory when updating the ports list
When updating /usr/Ports/AvailablePorts.md, the file or even the entire
/usr/Ports directory might not exist.
To cope with this, we should be able to create it ourselves. To ensure
we are able to do this, we should unveil both /usr and /usr/Ports.
2023-09-17 16:38:21 -06:00
Liav A
4303965986 PackageManager: Inform the user if AvailablePorts.md doesn't exist
If we need to read from /usr/Ports/AvailablePorts.md, but the file does
not exist, then warn the user in an informative way.
2023-09-17 16:38:21 -06:00
Shannon Booth
77d32fcb5f LibWeb: Add an initial implementation for Web::FileAPI::FileReader
Some steps are still to be implemented, namely:
 * Properly aborting the read algorithm
 * Handling BinaryString type properly
 * Setting error on any error

But as it stands, this is enough functionality for the basic case of
reading the contents of a blob using the FileReader API.
2023-09-17 16:37:31 -06:00
Shannon Booth
47616210b6 LibWeb: Add HTML::EventNames::loadend 2023-09-17 16:37:31 -06:00
Shannon Booth
3a6339f3dd LibWeb: Mark Blob::get_stream as public
This algorithm may be called from outside of Blob.
2023-09-17 16:37:31 -06:00
Shannon Booth
132b17406b LibWeb: Add missing String.h include to MimeSniff/MimeType.h
This doesn't cause any compiler errors, but clang-tidy in my editor
certainly complains that this include is missing.
2023-09-17 16:37:31 -06:00
Tobias Soppa
9267e24741 LibJS+LibWeb: Track SharedArrayBuffers' shared state
ArrayBuffer no longer stores a plain ByteBuffer internally, but a
DataBlock instead, which encapsulated the ByteBuffer together with
information if it is shared or not.
2023-09-17 16:29:21 -06:00
Sam Atkins
f0a4baabc7 LibWeb: Support quotes in content values
This adds initial support for `open-quote`, `close-quote`,
`no-open-quote` and `no-close-quote`. We don't yet track the "nesting
level" so we always use the first pair of quotes from the `quotes`
property.
2023-09-17 15:45:52 -06:00
Sam Atkins
dc7a52957e LibWeb: Parse and compute CSS quotes property 2023-09-17 15:45:52 -06:00
Tim Ledbetter
1bc081398e find: Add -uid option to filter by owning user ID 2023-09-17 15:29:44 -06:00
Tim Ledbetter
d3da8f978e find: Add -gid option to filter by owning group ID 2023-09-17 15:29:44 -06:00
Sönke Holz
a65d6e5e50 LibELF: Use the first PT_LOAD element to calculate base address
Other element types (like `PT_RISCV_ATTRIBUTES`) might not have
a correct `p_vaddr`.
2023-09-17 15:25:24 -06:00
Tim Ledbetter
a95c2ed978 find: Add the -maxdepth and -mindepth options
The `-maxdepth` option limits the number of levels `find` will descend
into the file system for each given starting point.

The `-mindepth` option causes commands not to be evaluated until the
specified depth is reached.
2023-09-17 15:20:49 -06:00
nipos
0dfd6994e3 LibCore: Use BSD implementation of anon_create() on Haiku 2023-09-17 13:38:12 -06:00
nipos
45e38c99c2 LibWeb: Add Haiku platform string to ResourceLoader 2023-09-17 13:38:12 -06:00
nipos
0fa00a1b1e LibCore: Don't implement adjtime on Haiku 2023-09-17 13:38:12 -06:00
nipos
1e25ab956c LibCore: Use void* instead of FlatPtr for ioctl() arg on Haiku 2023-09-17 13:38:12 -06:00
nipos
a1572555c2 LibCore: Implement current_executable_path() on Haiku 2023-09-17 13:38:12 -06:00
nipos
ae34c35d64 LibCore: Add standard paths for Haiku 2023-09-17 13:38:12 -06:00
nipos
e028d43c67 LibCore: Enable receive_fd and send_fd on Haiku 2023-09-17 13:38:12 -06:00
nipos
cecedc57eb LibCore: Use BSD implementation of Process::get_name() on Haiku 2023-09-17 13:38:12 -06:00
nipos
0816bbe727 LibCore: Use accept instead of accept4 on Haiku 2023-09-17 13:38:12 -06:00
nipos
ee5b851f70 LibCore: Make Group::add_group() unavailable on Haiku 2023-09-17 13:38:12 -06:00
nipos
cf6781cdee LibCore: Use DirectoryEntry::from_stat on Haiku 2023-09-17 13:38:12 -06:00
nipos
1d475e9312 LibCore: Don't include crypt.h and shadow.h in Account.cpp on Haiku 2023-09-17 13:38:12 -06:00
Aliaksandr Kalenik
3c675e3f25 Userland+Ladybird: Always specify url to be about:srcdoc in load_html()
After moving to navigables, we started reusing the code that populates
session history entries with the srcdoc attribute value from iframes
in `Page::load_html()` for loading HTML.

This change addresses a crash in `determine_the_origin` which occurred
because this method expected the URL to be `about:srcdoc` if we also
provided HTML content (previously, it was the URL passed along with the
HTML content into `load_html()`).
2023-09-17 21:08:59 +02:00
Aliaksandr Kalenik
8e832a174e LibWeb: Update determine_the_origin to match the latest spec 2023-09-17 21:08:59 +02:00
Andreas Kling
e33145aa4b LibJS: Use OrderedHashMap for the Shape property table
This allows us to get rid of property_table_ordered() which was a
heavy-handed way of iterating properties in insertion order by first
copying them to a sorted Vector.

Clients can now simply iterate property_table() directly.

3% speed-up on Kraken/ai-astar.js :^)
2023-09-17 21:00:11 +02:00
Shannon Booth
8ce9e51c97 LibWeb: Port Node interface from DeprecatedString to String
Which is fortunately quite straight forward :^)
2023-09-17 20:29:18 +02:00
Aliaksandr Kalenik
a76ef04ae6 LibWeb+WebContent: Create WebContentConsoleClient for every document
Fixes regression introduced in b4fe118dff

The `WebContentConsoleClient` needs to be created not just once, but
for every new document. Although the JS Console window allows
communication only with the active document associated with the
top-level browsing context, we still need a console client for each
iframe's document to ensure their console logs are printed.

In the future, we might consider adding the ability to switch which
document the JS Console window communicates with.

Fixes https://github.com/SerenityOS/serenity/issues/21117
2023-09-17 19:58:28 +02:00
Gabriel Nava
9a61041941 LibWeb: Add CanvasPath arcTo support
Adds initial CanvasPath arcTo support for 2D rendering contexts
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-arcto
2023-09-17 17:22:52 +02:00
implicitfield
7cb80c67d8 checksum: Add support for BLAKE2b 2023-09-17 16:49:35 +03:30
implicitfield
1b3ad1c721 LibCrypto: Add support for BLAKE2b 2023-09-17 16:49:35 +03:30
Aliaksandr Kalenik
65eb0f32ad LibWeb: Add missing visit Node::m_pseudo_element_generator 2023-09-16 19:44:55 -06:00
Aliaksandr Kalenik
76d42aa2d5 LibWeb: Add missing visit Document::m_intersection_observers 2023-09-16 19:44:55 -06:00
Aliaksandr Kalenik
078489d9ee LibWeb: Add missing visit Document::m_target_element 2023-09-16 19:44:55 -06:00
Aliaksandr Kalenik
4446858401 LibWeb: Do not crash if parsing failed in load_document()
If `load_document()` is called with a response that has a mime type we
can't use to build a document, we should return nullptr as the spec
says, instead of crashing. Also we should not crash if error happened
during parsing.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
ead311eac7 LibWeb: Delete navigation id check in navigate_to_a_javascript_url
Adding this check was a mistake because although the navigation id
changes to null in step 2, it still has to proceed and apply the
history step.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
f01cbaf5fb LibWeb: Remove unused javascript: url navigation methods in Document
Those are superseded by methods to navigate `javascript:` url in
navigables.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
38461a7b86 LibWeb: Update EventHandler::handle_mouseup to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
69513de1ad LibWeb: Update IntersectionObserver::intersection_root() for navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
10b2ce49dc LibWeb: Invalidate style before running insertion steps
This fixes issue reproducing with following steps:
1. Node::insert_before() adopts a node into another document.
2. Node::insert_before() runs insertion steps for adopted node (adopted
   node style is not invalidated yet).
3. Insertion steps execute spin_until() on event loop.
4. The next task on event loop does Document::update_style() which
   requires layout tree rebuild.
5. Layout tree rebuild fails because there is a node with invalidated
   style.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
6736a76915 LibWeb: Update Window::name() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
5d12dea4c9 LibWeb: Update Window::set_name() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
c95215f829 LibWeb: Update Window::focus() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
e54071ce89 LibWeb: Update Window::parent() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
8d82dc3a9f LibWeb: Update Window::top() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
05cbc448b6 LibWeb: Update Document::update_layout() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
6411fea552 LibWeb: Update focus_chain() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
38034237c5 LibWeb: Update run_iframe_load_event_steps to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
76a97d8863 LibWeb: Update Document::completely_finish_loading() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
9b16e5373d LibWeb: Process session history queue after initial iframe navigation
This is not in the spec, but we need to make sure that "apply the
history step" for initial navigation to about:blank in iframe is
applied before subsequent navigations. Otherwise, "set ongoing
navigation" call during "about:blank" traversal might abort subsequent
ongoing navigation which is not expected to happen.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
0e0936e1ce LibWeb: Update Window::frame_element() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
67f5c027fe LibWeb: Use saved navigable pointer in destroy_the_child_navigable
During the destruction of a navigable, we need to use the pointer to
the navigable that was saved at the beginning of the function. This
is because `Node::navigable()` will return a nullptr in subsequent
steps after the navigable's document becomes inactive.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
cf985afdcb LibWeb: Look for targetStepSHE in parent while creating child navigable
Reported issue in the spec https://github.com/whatwg/html/issues/9686
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
cd75b1de3d LibWeb: Delete discard() in Document and BrowsingContext
Those are not used anymore after moving to navigables.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
180c3e2fef LibWeb: Remove unused BrowsingContext::close()
Was replaced by close_top_level_traversable()
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
d17b1d6b1f LibWeb: Update WebDriverConnection::close_window() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
df5db1631b LibWeb: Update WebDriverConnection::close_session() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
bf785fee34 LibWeb: Remove unused BrowsingContext::container_document() 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
57e53fa844 LibWeb: Update "has style sheet that blocking scripts" for navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
1f2ed7effc LibWeb: Remove outdated version of determine_the_origin() 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
7b91f79817 LibWeb: Delete unused BrowsingContext::is_child_of() 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
6942bdcfce LibWeb: Update top_level_browsing_context() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
fda420875d LibWeb: Delete BrowsingContext::set_active_document()
Superseded by Document::make_active()
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
2fbb6ae520 LibWeb: Add did_stop_being_active_document_in_navigable() 2023-09-16 16:53:32 +02:00