Commit Graph

41501 Commits

Author SHA1 Message Date
Sam Atkins
8ce38fddd9 LibWeb: Move CSS TokenStream to its own file
This lets us use TokenStream in StyleComputer without every user of
StyleComputer pulling in the entire CSS Parser.
2022-09-27 19:36:31 +02:00
Nico Weber
bf6d5fce18 LibWeb: In MimeType serialization, put just one \ in front of each " 2022-09-27 15:47:54 +01:00
Timothy Flynn
7178c31f1c LibTimeZone: Update to TZDB version 2022d
https://mm.icann.org/pipermail/tz-announce/2022-September/000073.html
2022-09-27 15:16:09 +01:00
Thomas Voss
80b56ced93 Meta: Update my email-address 2022-09-27 15:15:36 +01:00
Linus Groh
0b52b883af LibWeb: Implement '5.5. Response class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
Linus Groh
9fb672e981 LibWeb: Implement '5.4. Request class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
Linus Groh
5ad6283331 LibWeb: Implement '5.3. Body mixin' from the Fetch API :^)
This will be used to share functionality between Request and Response.
2022-09-27 14:56:17 +01:00
Linus Groh
afe2563e2b LibWeb: Make HeaderList ref-counted
This is needed to eventually share a header list between a Request or
Response object's internal infra request/response and the object's
exposed Header object.
2022-09-27 14:56:17 +01:00
Linus Groh
2d57d47132 LibWeb: Make Fetch::Infrastructure::Request::m_method default to "GET"
ByteBuffer has an inline capacity of 32 bytes, so this isn't fallible
and can be done inline.
2022-09-27 14:56:17 +01:00
Linus Groh
924d7721f0 LibWeb: Stub out Fetch::Infrastructure::Body::fully_read_as_promise() 2022-09-27 14:56:17 +01:00
Linus Groh
a7164f2674 LibWeb: Stub out Fetch::Infrastructure::Body::clone() 2022-09-27 14:56:17 +01:00
Linus Groh
ef5e2eb794 LibWeb: Implement Fetch::Infrastructure::Response::clone() 2022-09-27 14:56:17 +01:00
Linus Groh
b5e8e9b30b LibWeb: Support ReadonlyBytes as argument for extract_body()
This now matches the spec's requirement of "a byte sequence or BodyInit
object object".
2022-09-27 14:56:17 +01:00
Linus Groh
426e32e5c0 LibWeb: Add WebIDL::ExceptionOr constructor for wrapped ValueType
This is copied from JS::ThrowCompletionOr and will allow using them
interchangeably with types wrapped by JS::Value such as JS::Object*.
2022-09-27 14:56:17 +01:00
Linus Groh
4461234898 LibWeb: Support plain (throw) JS::Completion in WebIDL::ExceptionOr
This makes it possible to propagate exceptions from a function that
returns JS::ThrowCompletionOr via TRY() in another function that returns
WebIDL::ExceptionOr.
2022-09-27 14:56:17 +01:00
Linus Groh
b9d626d6b2 LibWeb: Don't always assign values to nullable IDL dictionary members
IDL dictionary members are nullable by default (unless marked as
`required`) and should not get any value assigned unless one was
provided by the userland code that isn't undefined, or if the member has
a default value.

This is so that we can use Optional<T> in the internal representation
and check for "is present" via Optional::has_value().
2022-09-27 14:56:17 +01:00
Linus Groh
d38f1fb5b2 LibWeb: Fix bindings codegen for IDL enums with only one member
The SourceGenerator's @else@ mapping is only set in the second iteration
of the loop, causing the generated return for unrecognized values to not
be guarded by an else statement.
We can simply use a hardcoded 'else' here, @else@ is only to create the
first comparison as a plain 'if' and subsequent ones as 'else if'.
2022-09-27 14:56:17 +01:00
Linus Groh
fd52119ca3 LibWeb: Add getters and setters for Fetch::Header's members 2022-09-27 14:56:17 +01:00
Linus Groh
dc6fb43d26 LibWeb: Add referrer policy to Fetch::Infrastructure::Request
The enum is in its own directory and namespace as there's a standalone
spec for it, that will later also house AOs.

- https://w3c.github.io/webappsec-referrer-policy/
- https://www.w3.org/TR/referrer-policy/
2022-09-27 14:56:17 +01:00
Linus Groh
a602a4c780 LibWeb: Heap-allocate returned Fetch::Infrastructure::{Request,Response}
A Request/Response instance should always be heap-allocated and have
clear ownership, so let's also wrap it in a NonnullOwnPtr instead of
putting them on the stack.
2022-09-27 14:56:17 +01:00
Linus Groh
88ee15a497 LibWeb: Mark two Fetch::Infrastructure::Request getters as const 2022-09-27 14:56:17 +01:00
Linus Groh
37972e9f0c LibWeb: Implement most WebIDL promise operations 2022-09-27 14:56:17 +01:00
Linus Groh
e68e92b304 LibJS: Make JS::NativeFunction use JS::SafeFunction internally
This still needs a project-wide cleanup to remove handles captured in
lambdas, which is now longer required.
For now, this will be used in the next commit implementing promise AOs
from Web IDL, which make heavy use of deferred callbacks.
2022-09-27 14:56:17 +01:00
Linus Groh
00fa71725b LibWeb: Implement JS value <-> JSON parsing/serialization AOs 2022-09-27 14:56:17 +01:00
Linus Groh
4e536eaf98 LibJS: Add JSON.stringify function to the intrinsics
This is needed for some Web APIs.
2022-09-27 14:56:17 +01:00
Linus Groh
b42b950688 LibWeb: Implement MimeType serialization 2022-09-27 14:56:17 +01:00
ne0ndrag0n
d463b8e6fb SQLStudio: Save and load blank files without failing assertion 2022-09-27 14:38:50 +01:00
kleines Filmröllchen
5294fd671e PixelPaint: Use the parallel ImageProcessor to apply filters
The main advantage of this change is that heavy-weight filters do not
lock up the GUI anymore.

This first cut has several flaws:
- We do not account for modification of the referenced images while the
  filter is running. Depending on the exact filter behavior this might
  have all sorts of weird effects. A simple fix would be to show a
  progress dialog to the user, preventing them from performing other
  modifications in the meantime.
- We do not use the image processor for previews. Preview behavior has a
  couple of other considerations that are intentionally not addressed in
  this commit or pull request.
2022-09-27 14:23:11 +01:00
kleines Filmröllchen
ade868aa56 PixelPaint: Add a general-purpose parallel image processing pipeline
The ImageProcessor singleton is intended to be used by all sorts of
image processing which might take some time to complete; or other
background actions. We're not using BackgroundTask here because this
system is specifically designed to work with task queues and PixelPaint
interaction; e.g. it provides common image processing tasks such as
filter application.
2022-09-27 14:23:11 +01:00
kleines Filmröllchen
9483adee46 PixelPaint: Expose the GUI event loop from the ImageEditor
This allows processing threads to call back into the GUI.
2022-09-27 14:23:11 +01:00
kleines Filmröllchen
056b081e2d PixelPaint: Reference-count filters
For multi-threading filter application, shared ownership is much easier
to work with.
2022-09-27 14:23:11 +01:00
Marco Santos
5f76ab9836 Spreadsheet: Add toolbar actions to change the cell style 2022-09-27 13:38:11 +03:30
Marco Santos
a0598aaef7 Icons: Add icon to represent text color changes 2022-09-27 13:38:11 +03:30
Sam Atkins
42f36d4865 LibGUI: Make "Home" key behavior comfier on wrapped lines :^)
There's a big comment explaining it because it's somewhat confusing, but
the behavior I'm copying from other editors is, when you repeatedly
press the `Home` key:

1. Go to the start of the visual line, where it wraps.
2. Go to the first non-whitespace character on the logical line, which
   is what happens in non-wrapped lines.
3. Go to column 0.
4. GOTO 2
2022-09-26 23:12:31 +02:00
Enver Balalic
55c099c953 LibHTTP: Null out on_ready_to_read on socket close
This fixes the segfault reported in #15283.

on_ready_to_read gets re-registered on every job start anyways.
I see no reason why this could be bad.
2022-09-26 23:11:28 +02:00
Liav A
3cf6ac1b3f Kernel: Fix typo in comment in Ext2FileSystem::read_bytes_locked method 2022-09-26 20:13:13 +01:00
Liav A
0a793a7fa3 Kernel/FileSystem: Remove the locking of a Inode mutex in InodeVMObjects
We no longer require to lock the m_inode_lock in the SharedInodeVMObject
code as the methods write_bytes and read_bytes of the Inode class do
this for us now.
2022-09-26 22:06:10 +03:00
Liav A
7d91724dd2 Tests/Kernel: Add tests to ensure we don't regress InodeVMObjects 2022-09-26 20:00:34 +03:00
Liav A
60b088b89a Kernel: Send SIGBUS to threads that use after valid Inode mmaped range
According to Dr. POSIX, we should allow to call mmap on inodes even on
ranges that currently don't map to any actual data. Trying to read or
write to those ranges should result in SIGBUS being sent to the thread
that did violating memory access.

To implement this restriction, we simply check if the result of
read_bytes on an Inode returns 0, which means we have nothing valid to
map to the program, hence it should receive a SIGBUS in that case.
2022-09-26 20:00:34 +03:00
Roberto Bampi
69f7a59a34 Magnifier: Add the option to save captures 2022-09-26 17:28:54 +01:00
Timothy Flynn
eb0657c23e LibWeb: Add WebIDL to the IDL generator's list of web namespaces
Without this, the generated DOMExceptionConstructor does not refer to
the WebIDL::DOMException with its fully qualified name. This caused an
ambiguity error on my machine.
2022-09-26 14:00:31 +01:00
Mykola
f6ee7a54ea Base: Add some more new emoji
Added:
🌰 - U+1F330 CHESTNUT
🥘 - U+1F958 SHALLOW PAN OF FOOD
🌄 - U+1F304 SUNRISE OVER MOUNTAINS
🌅 - U+1F305 SUNRISE
🌌 - U+1F30C MILKY WAY
🦺 - U+1F9BA SAFETY VEST
💹 - U+1F4B9 CHART INCREASING WITH YEN
🔧 - U+1F527 WRENCH
🪛 - U+1FA9B SCREWDRIVER
🪝 - U+1FA9D HOOK
🪣 - U+1FAA3 BUCKET
🪥 - U+1FAA5 TOOTHBRUSH
2022-09-26 09:13:35 +01:00
Kemal Zebari
296a689a2a Base: Remove period from TerminalSettings description
Given all of the other descriptions for each setting don't include a
period at the end, it won't hurt to have the TerminalSettings
description do the same for consistency.
2022-09-26 09:09:48 +01:00
MacDue
f6264523b9 LibWeb: Fix destination bitmap edge clip case in transform painting
This fixes an edge case, where the destination rect falls partly
outside the painter, so is clipped to a smaller size in
`get_region_bitmap()` (which needs to be accounted for with an extra
offset).
2022-09-26 01:38:30 +02:00
Linus Groh
bbaa05fcf9 LibWeb: Move DOMException from DOM/ to WebIDL/ 2022-09-25 19:13:31 +01:00
Linus Groh
ad04d7ac9b LibWeb: Move ExceptionOr from DOM/ to WebIDL/
This is a concept fully defined in the Web IDL spec and doesn't belong
in the DOM directory/namespace - not even DOMException, despite the name
:^)
2022-09-25 19:13:31 +01:00
MacDue
c0eda77928 Base: Add paint effects with opacity/transforms HTML test cases 2022-09-25 18:37:31 +02:00
MacDue
e3537e4374 LibWeb: Fix shadow painting when the target painter is translated 2022-09-25 18:37:31 +02:00
MacDue
3fad64dfbc LibWeb: Sample the destination when painting element opacity/transform
This now copies the area under the destination to a new bitmap, that
is then scaled to the size of the source. The element is then painted
into that bitmap, which is then scaled and painted back to
the destination. This is done as many effects such as shadows, border
radii, filters, etc require being able to read pixels from the painter.

This does work (and is not that noticeable in many cases), but it does
mean there may be a few scaling artifacts in the background
around transformed elements. Though that was already the case before
anyway for the elements (since it is just a bitmap scale).

What we really want is to (where possible) just scale the paintable
and its descendants, then paint things normally, which would give
much nicer results (but is much more tricky to achieve).

This also now makes it so only a bitmap of the size of the paintable is
copied/created, rather than the whole page.
2022-09-25 18:37:31 +02:00
MacDue
8967fe9d92 LibWeb: Add PaintableBox::absolute_paint_rect()
This method returns the total area this element will paint to.
Currently, this just means accounting for box-shadows, though
there are likely more effects that need to be accounted for here.
2022-09-25 18:37:31 +02:00