Commit Graph

13948 Commits

Author SHA1 Message Date
Brendan Coles
75dec15b43 LaunchServer: Add sheets=/bin/Spreadsheet file association to config 2020-11-01 10:33:20 +01:00
JetStarBlues
e5fc0f940c
Chess: Add the 'moderna' piece set (#3896) 2020-11-01 10:31:00 +01:00
Tom
7a4fb5deef Kernel: Don't remap IOAPIC registers every time we try to read/write
Remapping these registers every time we try to read from or write to
them causes a lot of SMP broadcasts and a lot of other overhead.
This improves boot time noticeably.
2020-11-01 10:30:20 +01:00
Brendan Coles
c1bfb8cb0e Meta: lint-shell-scripts: Exit if shellcheck is not installed 2020-11-01 10:29:33 +01:00
Brendan Coles
7c5e488de2 Games: Use GUI::Icon::default_icon to set application icon 2020-11-01 10:29:27 +01:00
Brendan Coles
27ead7e2c2 Demos: Use GUI::Icon::default_icon to set application icon 2020-11-01 10:29:14 +01:00
Brendan Coles
3482b9b937 LibWeb: Enforce Same-Origin Policy (SOP) for XMLHttpRequest requests
`DOM::XMLHttpRequest` now checks if the requested URL has the same
`Origin` as the requesting `Document`. If the requested URL is in
violation of SOP the request is rejected and an "error" `DOM::Event`
is dispatched.
2020-11-01 10:23:08 +01:00
Liav A
4007ba5137 Kernel: Reduce code duplication in the PCI IO access read helpers
We just call the early helpers as they do the same thing like the IO
access helpers.
2020-11-01 10:19:17 +01:00
Liav A
6131048a5f Kernel: Map PCI devices only once during boot
Instead of mapping a 4KB region to access device configuration space
each time we call one of the PCI helpers, just map them once during
the boot process.
Then, if we request to access one of those devices, we can ask the
PCI subsystem to give us the virtual address where the device's
configuration space is mapped.
2020-11-01 10:19:17 +01:00
Linus Groh
0aeef47abd LibMarkdown: Use JS::MarkupGenerator for "js" code blocks :^) 2020-10-31 20:52:54 +01:00
Linus Groh
10c19d5207 LibMarkdown: Replace inline styles in HTML with CSS in <head> 2020-10-31 20:52:54 +01:00
Linus Groh
e5ec4d35ea LibWeb: Don't use 'font-weight: lighter' for Csilla in Default.css
Base/res/fonts/CsillaThin7x10.font was renamed to
Base/res/fonts/CsillaRegular10.font in 5abc03d, breaking the default
styles of <code> and <pre>.
The font lookup should still find a font variant when a non-existent
weight is specified, but that's another issue for another day.
2020-10-31 20:52:54 +01:00
Linus Groh
d2a2d19a86 LibJS: Handle multi-line source code in MarkupGenerator
The previous approach (keeping track of the current source position
manually) was only working for single line sources (which is fair
considering this was developed for Browser's JS console).
The new approach is much simpler: append token trivia (all whitespace
and comments since the last token), then append styled token value.
2020-10-31 20:52:54 +01:00
Andreas Kling
39c9319b6d Terminal: Run clang-format 2020-10-31 19:54:23 +01:00
AnotherTest
1bd3a2d09f Spreadsheet: Add support for example views and hyperlinks in the docs
Now the functions can actually be demonstrated by small examples,
embedded right inside the documentation via:
spreadsheet://example/<page>#<example_name>

Also allows pages to link to each other via the same scheme:
spreadsheet://doc/<page>
2020-10-31 15:40:13 +01:00
Linus Groh
a598a2c19d LibJS: Function declarations in if statement clauses
https://tc39.es/ecma262/#sec-functiondeclarations-in-ifstatement-statement-clauses

B.3.4 FunctionDeclarations in IfStatement Statement Clauses

The following augments the IfStatement production in 13.6:

    IfStatement[Yield, Await, Return] :
        if ( Expression[+In, ?Yield, ?Await] ) FunctionDeclaration[?Yield, ?Await, ~Default] else Statement[?Yield, ?Await, ?Return]
        if ( Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] else FunctionDeclaration[?Yield, ?Await, ~Default]
        if ( Expression[+In, ?Yield, ?Await] ) FunctionDeclaration[?Yield, ?Await, ~Default] else FunctionDeclaration[?Yield, ?Await, ~Default]
        if ( Expression[+In, ?Yield, ?Await] ) FunctionDeclaration[?Yield, ?Await, ~Default]

This production only applies when parsing non-strict code. Code matching
this production is processed as if each matching occurrence of
FunctionDeclaration[?Yield, ?Await, ~Default] was the sole
StatementListItem of a BlockStatement occupying that position in the
source code. The semantics of such a synthetic BlockStatement includes
the web legacy compatibility semantics specified in B.3.3.
2020-10-31 15:25:12 +01:00
Andreas Kling
778011dac6 ping: Account for raw sockets now receiving IPv4 headers 2020-10-31 13:56:21 +01:00
Andreas Kling
e06d8d94da IPv4: Include IP headers when receiving from a raw socket
We were stripping the L3 headers from packets received on raw sockets.
This didn't match what other systems do, so let's adjust our behavior.

Thanks to @SpencerCDixon for noticing this! :^)
2020-10-31 13:56:21 +01:00
Andreas Kling
982e066100 LibGfx: Move FontDatabase from LibGUI to LibGfx
Not sure why I put this into LibGUI in the first place.
2020-10-31 13:56:21 +01:00
Brendan Coles
e569f7fd1c Applications: Use application icons for dialog windows 2020-10-31 13:48:15 +01:00
Brendan Coles
15b68b4653 Spreadsheet: Add Help menu 2020-10-31 13:39:18 +01:00
Uma Sankar Yedida
d2beff41c9 Profiler: Set window title based on the selected View
This will help us identify which View that we are currently looking at.
2020-10-31 13:38:51 +01:00
Andreas Kling
66a8e151fb LibGUI: Remove redundant scroll_into_view() calls in TableView
The calls to set_cursor() already take care of scrolling the new cursor
into view if needed.
2020-10-30 23:52:59 +01:00
Linus Groh
563d3c8055 LibJS: Require initializer for 'const' variable declaration 2020-10-30 23:43:38 +01:00
AnotherTest
812e3ecedd LibProtocol+LibGemini+LibHTTP: Provide root certificates to LibTLS
Now we (almost) verify all the sites we browse.
Certificate verification failures should not be unexpected, as the
existing CA certificates are likely not complete.
2020-10-30 23:42:03 +01:00
AnotherTest
37c089fb7b LibTLS: (Almost) verify certificate chain against root CA certificates
Also adds a very primitive systemwide ca_certs.ini file.
2020-10-30 23:42:03 +01:00
AnotherTest
34f8d55100 LibCrypto: Remove spammy ModPow debug log 2020-10-30 23:42:03 +01:00
AnotherTest
1746e6f9ca LibTLS: Also read out the Organisational Unit from the certificate
This needs to be read out if we want to actually verify the cert chain.
2020-10-30 23:42:03 +01:00
AnotherTest
a2186fd64a LibTLS: Move out Certificate to its own header file 2020-10-30 23:42:03 +01:00
AnotherTest
a461526b07 LibHTTP+ProtocolServer+LibGemini: Remove Request::schedule()
This API is only used for HttpRequest, but replicated in GeminiRequest
without an actual user, so remove it and construct the job like the rest
of the protocols.
2020-10-30 23:42:03 +01:00
Andreas Kling
b11b4b29e9 LibGUI: Add Widget::has_focus_within()
This returns true if the widget has focus, or if one of its descendant
widgets does. Use this in StackWidget and TabWidget.

This also fixes HackStudio crashing on startup in StackWidget, due to
running before the window has a focused widget.
2020-10-30 23:40:23 +01:00
Andreas Kling
dee639f19b LibGUI: Improve TabWidget+StackWidget focus behavior further
When setting a new active widget, transfer focus if it's anywhere in
the old active widget's tree, not just at the immediate child.
2020-10-30 19:17:09 +01:00
Andreas Kling
b0cdb6b074 LibGUI: Deduplicate widgets with proxied focus in focus chain
When computing the chain of focusable widgets in a window, only include
each widget once (to avoid loops) and resolve focus proxies immediately
instead of lazily. This prevents the focus from getting stuck when
cycling backwards and hitting a proxy that points forward.
2020-10-30 19:17:09 +01:00
Uma Sankar Yedida
9ccae7a908 WindowServer+LibGfx: Added Crosshair cursor 2020-10-30 19:10:15 +01:00
Andreas Kling
ddad7575a9 LibGUI: Improve automatic focus guessing somewhat
When opening a new window, we'll now try to find a suitable widget for
initial focus by picking the first available mouse-focusable one.

Whenever you press the tab key in a window with no focused widget,
we'll attempt to find a keyboard-focusable widget and give it focus.

This should make all applications keyboard-interactive immediately
without having to manually place focus with the mouse.
2020-10-30 17:03:29 +01:00
Andreas Kling
28df2ede06 LibGUI: Use ToolBarButton helper class inside ToolBar 2020-10-30 17:03:29 +01:00
Andreas Kling
9baa649389 LibGUI: Fix null parent deref in AbstractButton::set_checked()
If a button is orphaned, there are no siblings anyway, so there's no
need to try to update them.
2020-10-30 17:03:29 +01:00
Andreas Kling
3f4df354cb LibGUI: Make TabWidget unfocusable when tab-less
If there are no tab buttons or tab children, don't participate in the
focus chain.
2020-10-30 17:03:29 +01:00
Andreas Kling
0b798a50dc LibGUI: Make StackWidget/TabWidget preserve focus in inactive windows
This one is a bit sketchy. While a window is inactive, none of its
widgets are considered focused (Widget::is_focused() will return false)
but this caused programmatic changes of the active widget in a tab
or stack widget to fail focus propagation from old child to new child.

Work around this by checking against Window::focused_widget() directly
instead of asking Widget::is_focused().
2020-10-30 17:03:29 +01:00
Andreas Kling
cf93c66e6e LibGUI: Make StackWidget set the active widget as its focus proxy
This transparently transfers focus to the active widget whenever the
stack widget is focused.
2020-10-30 17:03:29 +01:00
Andreas Kling
698490c565 LibGUI: Make TabWidget focusable and allow left/right arrow tab switch
You can now focus a TabWidget by tabbing (with the keyboard!) to it.
Once focused, you can switch the active tab by pressing the left/right
keyboard keys.
2020-10-30 17:03:28 +01:00
Andreas Kling
73ea191a05 LibGUI: TabWidget should not steal focus on programmatic tab switch
This matches the behavior of GUI::StackWidget.
2020-10-30 17:03:28 +01:00
Andreas Kling
aef56159a8 LibGUI: Add Widget focus policies
Every widget now has a GUI::FocusPolicy that determines how it can
receive focus:

- NoFocus: The widget is not focusable (default)
- TabFocus: The widget can be focused using the tab key.
- ClickFocus: The widget can be focused by clicking on it.
- StrongFocus: Both of the above.

For widgets that have a focus proxy, getting/setting the focus policy
will affect the proxy instead.
2020-10-30 17:03:28 +01:00
Andreas Kling
34014fa838 LibC: Use dbgln() in setlocale() 2020-10-30 17:03:28 +01:00
Andreas Kling
27a7ebe548 LibVT: Use dbgln() in TerminalWidget 2020-10-30 17:03:28 +01:00
Brendan Coles
d4c34d50c9 LibChess: Forbid King moving into check by a pawn on the home rank
A player can no longer move the King piece into any position on
their home rank if the move would place the King in check.

A player can also no longer ignore a check position when in check
by a pawn on their home rank. The player must now resolve the check
during their move.
2020-10-30 16:51:41 +01:00
Andreas Kling
6365b44773 HackStudio: Use GUI::TextDocument::span_at() 2020-10-29 23:52:31 +01:00
Andreas Kling
23c4f10027 LibGUI: Add TextDocument::span_at(TextPosition) 2020-10-29 23:52:07 +01:00
Andreas Kling
4e0ab1dd22 HackStudio: Remove ProcessStateWidget
This was a little banner that would pop up when running something in
the "Build" tab. It didn't look very good and it was mostly distracting
how it would pop in and out of the window.
2020-10-29 23:40:20 +01:00
Andreas Kling
18739ba87e LanguageServers/Cpp: Find the right token under the cursor
When the cursor is immediately to the right of a token, the cursor's
column will be token.end.column + 1, so take this into account when
choosing which token to autocomplete.
2020-10-29 23:32:18 +01:00