Commit Graph

27115 Commits

Author SHA1 Message Date
Andreas Kling
ecb72f3b57 LibWeb: Add a bare-bones HTML event loop with a task queue
This patch attaches a HTML::EventLoop to the main thread JS::VM used
for JavaScript bindings in the web engine.

The goal here is to model the various task scheduling mechanisms of the
HTML specification.
2021-09-09 02:18:31 +02:00
Andreas Kling
b76456f0ed LibJS: Add a way to attach custom data to a JS::VM instance
This will be used by LibWeb to attach web engine specific stuff that
LibJS doesn't need to know about.
2021-09-09 02:18:31 +02:00
Linus Groh
9661d15fe2 LibJS: Implement Temporal.PlainTime.prototype.toJSON() 2021-09-08 23:42:26 +01:00
Linus Groh
6987e326d8 LibJS: Implement Temporal.PlainTime.prototype.toLocaleString() 2021-09-08 23:42:26 +01:00
Linus Groh
9f78a957d5 LibJS: Implement Temporal.PlainTime.prototype.toString() 2021-09-08 23:42:26 +01:00
Linus Groh
81aaa9ccd5 LibJS: Replace String const& with StringView in various Temporal AOs
This is especially helpful where we already pass StringView literals
and only compare them with others, e.g. overflow and largest/smallest
unit, in which case there's no need to actually allocate a string.
2021-09-08 23:42:26 +01:00
Ben Wiederhake
9c3da7a3e3 Pong: Switch to global tracking
When I play Pong, I don't really pay attention to whether my mouse is in
the Pong window. That means that sometimes, annoyingly, the window loses
my mouse, and I lose control of the paddle. Gasp! D:

This commit teaches Pong the wonders of global mouse tracking, thus
enabling the player to focus solely on the game.
2021-09-08 23:59:08 +02:00
Timothy Flynn
4f2bcebe74 LibUnicode+LibJS: Store locale keyword values as a single string
Previously, LibUnicode would store the values of a keyword as a Vector.
For example, the locale "en-u-ca-abc-def" would have its keyword "ca"
stored as {"abc, "def"}. Then, canonicalization would occur on each of
the elements in that Vector.

This is incorrect because, for example, the keyword value "true" should
only be dropped if that is the entire value. That is, the canonical form
of "en-u-kb-true" is "en-u-kb", but "en-u-kb-abc-true" does not change
for canonicalization. However, we would canonicalize that locale as
"en-u-kb-abc".
2021-09-08 21:08:48 +01:00
Timothy Flynn
75657b79c6 LibUnicode: Update comment with link to related upstream issue
LibUnicode has to hard-code some aliases because the related data is not
available in the JSON export of CLDR. Turns out there is a ticket to add
this data in an upcoming CLDR release. Add a link to that ticket for
reference.
2021-09-08 21:08:48 +01:00
Timothy Flynn
32a2a02489 LibUnicode: Fix typo in listPatterns.json parsing method 2021-09-08 21:08:48 +01:00
Timothy Flynn
2ebafe000a LibJS: Fix typos in Intl.ListFormat comments 2021-09-08 21:08:48 +01:00
davidot
db0a48d34c LibJS: Restore the environment if an exception is thrown in 'with' block 2021-09-08 20:37:39 +01:00
Jack Delahunt
4175be6960 Base: Add PixelPaint (*.pp) file type icons 2021-09-08 20:15:08 +01:00
Luke Wilde
d943b8f100 LibJS: Implement Temporal.PlainTime.prototype.with
Ticks off one box in #8982 and fixes one test262 case.
2021-09-08 19:57:29 +01:00
Andreas Kling
b8d683c5fb LibWeb: Tweak for/event whitespace stripping in <script> to match spec
This is not a functional change, it merely reorders operations so that
we match spec language better.
2021-09-08 20:16:00 +02:00
Andreas Kling
917725ce67 LibWeb: Annotate HTMLScriptElement::prepare_script() with spec comments 2021-09-08 20:16:00 +02:00
Andreas Kling
6f2c7ecbbb Kernel: Make TextModeConsole store VGA window base as VirtualAddress 2021-09-08 20:16:00 +02:00
Andreas Kling
3e07b04564 Kernel: Remove some unused code in Graphics::TextModeConsole 2021-09-08 20:16:00 +02:00
Andreas Kling
524ef5e475 Kernel: Add KBuffer::bytes() and use it
(Instead of hand-wrapping { data(), size() } in a bunch of places.)
2021-09-08 20:16:00 +02:00
Idan Horowitz
bee2de4b31 Kernel: Use an IntrusiveRedBlackTree for storing the cr3 mappings
This ensures we don't allocate when intializing the PageDirectory.
2021-09-08 19:17:07 +03:00
Idan Horowitz
0279fb4dd3 AK: Add key getter to IntrusiveRedBlackTreeNode 2021-09-08 19:17:07 +03:00
Idan Horowitz
cb9720baab AK: Set IntrusiveRBTree Node key on insertion instead of construction
This makes the API look much nicer.
2021-09-08 19:17:07 +03:00
Idan Horowitz
1db9250766 AK: Make IntrusiveRedBlackTree capable of holding non-raw pointers
This is completely based on e4412f1f59
and will allow us to convert some AK::HashMap users in the kernel.
2021-09-08 19:17:07 +03:00
Idan Horowitz
7bb3b2839e Kernel: Fix a typo in LockRank::Process's comment 2021-09-08 19:17:07 +03:00
Ben Wiederhake
2572f5ebec Documentation: Fix broken link in Documentation 2021-09-08 16:48:33 +02:00
Liav A
666c0c5a08 Kernel/VirtIO: Determine names without PCI access in IRQ context
This is a fix so the VirtIO code doesn't lead to assertion because we
try to determine the name based on the PCI values of the VirtIO device,
because trying to read from the PCI configuration space requires to
acquire a Mutex, which fails in an IRQ context.

To ensure we never encounter a situation when we call a pure virtual
function in an IRQ context, let's make class_name() method to be a
non-pure virtual function, so it can be still called at anytime.
2021-09-08 16:47:01 +02:00
Dawid Wolosowicz
ac798da642 SystemMonitor: West Const to East Const refactor 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
484b9c1ba3 LibGUI: West Const to East Const refactor 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
ec7879f628 SystemMonitor: Remove an unnecessarily specific inline capacity 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
2d91ba2737 LibGUI: Remove an unnecessarily specific inline capacity 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
8419eef85e LibGUI: Sync the highlighting after each model update
Without this, the highlighting would stay on the initial index even if
the matching row is no longer there.
2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
d0e44993a1 LibGUI: Refactor AbstractView::do_search() into two standalone steps
This change splits the do_search() into find_next_search_match() and
highlight_search() to allow the given index be independently highlighted
when needed.
2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
cc93736f21 LibGUI: Remove barely used AbstractView::is_searching() 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
b775b1c199 LibGUI: Unify naming of searching timer related members 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
9225b45c2d LibGUI: Rename AbstractView::m_searching => m_highlighted_search 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
aeffd9024e LibGUI: Remove barely used AbstractView::is_highlighting_searching() 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
0cbc222c17 LibGUI: Remove barely used AbstractView::searching() 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
e96081ef8f LibGUI: Make AbstractView::is_searching protected 2021-09-08 15:48:02 +04:30
Dawid Wolosowicz
000c74e6a8 SystemMonitor: Make the process list searchable 2021-09-08 15:48:02 +04:30
Andreas Kling
52ed43d139 LibWeb: Scroll viewport to (0, 0) after loading a new document
This fixes a long-standing bug where the view wouldn't update when
navigating to a new page after looking at the ACID2 test. This happened
because ACID2 actually scrolls the viewport far down. We didn't reset
the scroll position upon navigation, and so the new page thought that
we were still scrolled very far down, and this broke the invalidation
rect calculations.
2021-09-08 11:56:50 +02:00
Andreas Kling
e91edcaa28 LibWeb: Rename InitialContainingBlockBox => InitialContainingBlock
The "Box" suffix added nothing here.
2021-09-08 11:27:46 +02:00
Andreas Kling
e90ccf6a20 LibWeb: Make BrowsingContext::m_top_level_browsing_context a WeakPtr
At the moment, nested browsing contexts expect that there's always a
top-level browsing context at some higher level. That's okay, but let's
keep the top-level pointer in a WeakPtr to make it easier to catch
mistakes (as this turns UAF into a null dereference.)
2021-09-08 11:19:27 +02:00
Andreas Kling
ef371596a4 LibWeb: Remove unnecessary DOM::Position destructor 2021-09-08 11:14:29 +02:00
Andreas Kling
3a7e26ef28 LibWeb: Rename frame_did_set_viewport_rect() => browsing_context_*()
Names are still catching up after the Frame => BrowsingContext rename.
2021-09-08 11:12:22 +02:00
Andreas Kling
9d9500989a LibWeb: Remove unused PageClient::is_multi_process() 2021-09-08 11:07:14 +02:00
Andreas Kling
a38aefed0b LibWeb: Remove bogus forward declaration for Web::StackingContext
The real class is Web::Layout::StackingContext.
2021-09-08 11:07:14 +02:00
Andreas Kling
76b0253b6b LibWeb: Convert BrowsingContext to east-const style 2021-09-08 11:07:14 +02:00
Andreas Kling
57fbeff925 LibWeb: Use delegating constructors in BrowsingContext
This avoids having two nearly-identical initializer lists and and an
awkward setup() function that every constructor must call.
2021-09-08 11:07:14 +02:00
Andreas Kling
9d03ea6f74 LibWeb+WebContent: Port DumpLayoutTree to OutOfProcessWebView
This required adding a simple OOPWV::dump_layout_tree() API that
synchronously requests a dump of the layout tree from the WebContent
process.
2021-09-08 11:07:14 +02:00
Ben Wiederhake
c6e56612f5 LibGUI+WindowServer: Remove now-obsolete cursor tracking feature
This feature was problematic for several reasons:
- Tracking *all* the user activity seems like a privacy nightmare.
- LibGUI actually only supports one globally tracking widget per window,
  even if no window is necessary, or if multiple callbacks are desired.
- Widgets can easily get confused whether an event is actually directed
  at it, or is actually just the result of global tracking.

The third item caused an issue where right-clicking CatDog opened two
context menus instead of one.
2021-09-08 10:53:49 +02:00