Commit Graph

47742 Commits

Author SHA1 Message Date
Luke Wilde
9acc542059 LibWeb: Propagate Realm instead of VM more through Fetch
This makes Fetch rely less on using main_thread_vm().current_realm(),
which relies on the dummy execution context if no JavaScript is
currently running.
2023-03-07 11:51:12 +00:00
Luke Wilde
f7ff1fd985 LibWeb: Remove CSS::Parser::ParsingContext's default constructor
This relied on pulling the current realm from the main thread VM, which
requires an execution context to be on the VM's stack. This heavily
relied on the dummy execution context that is always on the stack, for
example, when parsing the UA style sheets where no JavaScript is
running.
2023-03-07 11:51:12 +00:00
Aliaksandr Kalenik
54a1ec2f10 Browser: Handle close event in WebContentView 2023-03-07 11:34:11 +00:00
Aliaksandr Kalenik
59752807c4 Ladybird: Handle close event in WebContentView 2023-03-07 11:34:11 +00:00
Aliaksandr Kalenik
cc41233be4 LibWebView+WebContent: Propagate close from WebContent to LibWebView 2023-03-07 11:34:11 +00:00
Mathis Wiehl
f276e70ac9 Help: Don't defer tree view selection updates
It is unsafe to defer this selection update, because ::open_url itself
is called when users make selection updates, creating a race.

This fixes and infinite selection change loop one could easily reproduce
by holding an up or down arrow key in the tree view while clicking on a
tree view item a couple of times.
2023-03-07 09:50:50 +01:00
Andreas Kling
4797fad91c Shell: Fix bogus C-style casts from NonnullOwnPtr<T>* to T*
Thanks UBSAN for spotting this!
2023-03-07 09:42:20 +01:00
Linus Groh
2258fc273c LibWeb/HighResolutionTime: Add IDL typedef for DOMHighResTimeStamp
We already have this for C++ code in DOMHighResTimeStamp.h, but let's
also avoid using plain 'double' in IDL code.
2023-03-06 23:57:25 +00:00
Sam Atkins
ca30914fe9 LibWeb: Propagate errors from CSS Parser construction
This requires Parser to be movable, so we remove the `default`
destructors from Parser and TokenStream, and give them both move
constructors. Since TokenStream only holds a reference to its tokens,
(and it needs to, to avoid copying when given eg a function's contents,)
we add a manual move constructor for Parser which creates a new
TokenStream from the new Parser's tokens, and then manually copies the
old TokenStream's state.
2023-03-07 00:43:36 +01:00
Sam Atkins
235018046e LibWeb: Use free functions for parsing in @Supports 2023-03-07 00:43:36 +01:00
Sam Atkins
84af8dd9ed LibWeb: Propagate errors from CSS Tokenizer 2023-03-07 00:43:36 +01:00
Sam Atkins
17618989a3 LibWeb: Propagate errors from CSS Tokenizer construction
Instead of constructing a Tokenizer and then calling parse() on it, we
now call `Tokenizer::tokenize(...)` directly. (Renamed from `parse()`
because this is a Tokenizer, not a Parser.)
2023-03-07 00:43:36 +01:00
Mathis Wiehl
98ee2fcd1b man: Skip shellrc when invoking pager using sh
man invokes the pager command via `sh` which, since
beaae6b420 launches `Shell` in posix mode.
As the referenced commits message indicates, launching `Shell` in posix
mode while interactive, makes it choke on the default `.shellrc`. This
made `man` spew out some shell syntax errors to stderr every time it
invoked the pager.

To fix that, invoke `sh` with `--skip-shellrc` for now as suggested by
the aforementioned commit.
2023-03-07 00:42:32 +01:00
Andreas Kling
d1371d66f7 Kernel: Use non-locking {Nonnull,}RefPtr for OpenFileDescription
This patch switches away from {Nonnull,}LockRefPtr to the non-locking
smart pointers throughout the kernel.

I've looked at the handful of places where these were being persisted
and I don't see any race situations.

Note that the process file descriptor table (Process::m_fds) was already
guarded via MutexProtected.
2023-03-07 00:30:12 +01:00
Andreas Kling
36b0ecfe9e Kernel: Remove two outdated FIXMEs about the file descriptor table mutex
These functions cannot be called without already holding the relevant
mutex these days, since m_fds is a MutexProtected object. :^)
2023-03-06 23:46:36 +01:00
Andreas Kling
5aa12da959 AK+Kernel: Remove all the Nonnull*PtrVector classes 2023-03-06 23:46:36 +01:00
Andreas Kling
be91020d0b Settings: Remove outdated comment about NonnullPtrVector 2023-03-06 23:46:36 +01:00
Andreas Kling
2973298df1 Assistant: Remove outdated comment about NonnullPtrVector 2023-03-06 23:46:36 +01:00
Andreas Kling
b4022dc844 Screensaver: Remove outdated comment about NonnullPtrVector 2023-03-06 23:46:36 +01:00
Andreas Kling
f484952167 LibCpp: Remove Nonnull*PtrVector from list of known SerenityOS types 2023-03-06 23:46:36 +01:00
Andreas Kling
d57b09b7cf AK: Remove specialized shuffle for NonnullPtrVector 2023-03-06 23:46:36 +01:00
Andreas Kling
7369d0ab5f Kernel: Stop using NonnullLockRefPtrVector 2023-03-06 23:46:36 +01:00
Andreas Kling
21db2b7b90 Everywhere: Remove NonnullOwnPtr.h includes 2023-03-06 23:46:35 +01:00
Andreas Kling
359d6e7b0b Everywhere: Stop using NonnullOwnPtrVector
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
2023-03-06 23:46:35 +01:00
Andreas Kling
689ca370d4 Everywhere: Remove NonnullRefPtr.h includes 2023-03-06 23:46:35 +01:00
Andreas Kling
4c75d4af28 LibWeb: Stop using NonnullRefPtrVector for StyleValueVector 2023-03-06 23:46:35 +01:00
Andreas Kling
8a48246ed1 Everywhere: Stop using NonnullRefPtrVector
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.

This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-06 23:46:35 +01:00
Sam Atkins
104be6c8ac less: Stop adding extra blank lines
Each time we wrapped a line, we were appending an extra blank span which
wasn't needed. This was leading to an extra blank line after every
single line.
2023-03-06 21:44:28 +01:00
timre13
eef07a411b VideoPlayer: Create submenu to set sizing mode
Also add icon to the sizing mode cycling button.
2023-03-06 20:28:22 +00:00
Matthew Olsson
b33b950e45 Lagom: Add a tool to verify correctness of the LibJS GC
This is implemented as a Clang frontend tool, and currently does two
things:
  - Ensure for all fields wrapped in {Nonnull,}GCPtr<T>, T inherits from
    JS::Cell
  - Ensure for all fields not wrapped in {Nonnull,}GCPtr, that the type
    does not inherit from JS::Cell (otherwise it should be wrapped in a
    Ptr class).

In the future, this tool could be extended further. For example, we may
consider validating all implementations of Cell::visit_impl.
2023-03-06 13:05:43 +00:00
Matthew Olsson
176beeb08e LibJS: Enforce proper const-propogation with {Nonnull,}GCPtr 2023-03-06 13:05:43 +00:00
Matthew Olsson
c0b2fa74ac LibWeb: Fix a few const-ness issues 2023-03-06 13:05:43 +00:00
Matthew Olsson
70a2ca7fc0 LibJS: Handle both const and non-const Ts in Handle<T>::create()
Again, the const-ness only really involves Heap-internal metadata, so
the callers shouldn't care about mutations here.
2023-03-06 13:05:43 +00:00
Matthew Olsson
74e93a46ea LibJS: Fix a few const-ness issues 2023-03-06 13:05:43 +00:00
Matthew Olsson
5f0ccfb499 LibJS: Accept const GCPtrs in Cell::Visitor
The const_cast in these methods should be fine since the object really
only needs to be mutable so it's Heap-internal metadata can be altered.
2023-03-06 13:05:43 +00:00
Matthew Olsson
d4b08b7196 LibJS: Use a forwarding reference in ThrowCompletion constructor
This avoids compiler complaints when trying to use const types
2023-03-06 13:05:43 +00:00
Matthew Olsson
17a528c49e LibJS: Temporarily disambiguate const-ness of GCPtr constructors
Without this change, using {Nonnull,}GCPtr<T const> would complain that
there are multiple constructors which resolve to the same type (T& and
T const&). This removes that disambiguation and allows us to slowly fix
all of the constness issues surrounding GCPtrs. This change will not be
necessary in the future as we will be able to remove all of the const
qualifiers from the Ptr classes (they'll be in the template type
instead).
2023-03-06 13:05:43 +00:00
Matthew Olsson
a9372de972 WebContent: Add missing LibGfx include 2023-03-06 13:05:43 +00:00
Matthew Olsson
6003bcfd2d Browser: Add a missing include in InspectorWidget 2023-03-06 13:05:43 +00:00
Matthew Olsson
bab883bf8e LibJS+LibWeb: Add a bunch of missing includes 2023-03-06 13:05:43 +00:00
Matthew Olsson
8dc7810976 LibGfx: Remove unnecessary AK:: prefix in VectorN.h 2023-03-06 13:05:43 +00:00
Matthew Olsson
445011d50d LibWeb: Fix include cycle between ModuleScript.h and ModuleMap.h 2023-03-06 13:05:43 +00:00
nipos
1a29ecd648 LibCore: Don't use DT_WHT in DirectoryEntry on OpenBSD 2023-03-06 12:53:01 +00:00
Ryan Liptak
bf3d9a7372 Base: Improve a few ball emojis
🎱 U+1F3B1 - Pool 8 Ball
🏀 U+1F3C0 - Basketball
🏐 U+1F3D0 - Volleyball
🥎 U+1F94E - Softball
 U+26BE - Baseball
2023-03-06 06:29:56 -05:00
Linus Groh
1a6b61b0cc LibWeb/HTML: Move WindowOrWorkerGlobalScope code into a mixin class
This will allow us to easily share the implementations of these methods
between Window and WorkerGlobalScope. The mixin class mirrors what I
already did for the Fetch API's Body mixin in 5ad62833.
2023-03-06 11:02:25 +00:00
Linus Groh
b118cc782e LibWeb/HTML: Implement WorkerGlobalScope::cross_origin_isolated() 2023-03-06 11:02:25 +00:00
Linus Groh
ed15c34387 LibWeb/HTML: Implement WorkerGlobalScope::is_secure_context() 2023-03-06 11:02:25 +00:00
Linus Groh
d1a7c39e76 LibWeb/HTML: Implement WorkerGlobalScope::origin() 2023-03-06 11:02:25 +00:00
Andreas Kling
552895da60 LibGfx: Skip old-style emoji lookup for fonts that have color bitmaps
Ultimately, we should find a way to route all emoji access through
the font code, but for now, this patch adds a special case for fonts
that are known to have embedded color bitmaps so we can test them.
2023-03-06 10:52:55 +01:00
Andreas Kling
924d23353e LibGfx/OpenType: Support one specific type of embedded color bitmaps
This patch adds support for index format 1 and image format 17.
This is enough to get Noto Color Emoji working.
2023-03-06 10:52:55 +01:00