Commit graph

3739 commits

Author SHA1 Message Date
Idan Horowitz
37903db2b4 LibWeb: Remove double comma in FrameLoader debug logging 2021-05-05 16:37:26 +01:00
Linus Groh
346560d7c8 LibJS/Tests: Use hasOwnProperty() for duplicate test check
The current way of doing this would also traverse the prototype chain,
and therefore yield false positive results for keys like "toString".
2021-05-05 15:58:53 +01:00
Linus Groh
d9702ff561 Spreadsheet: Use shrink-to-fit for cell fg/bg color input layout
This fixes an issue where the bottom of both color inputs was cut off
due to insufficient, hardcoded height.
2021-05-05 15:30:45 +01:00
setepenre
580b335053 Userland: Add groups program 2021-05-05 15:12:30 +01:00
setepenre
56010379f9 LibCore: Call setgrent before looping on groups in get_extra_gids 2021-05-05 15:12:30 +01:00
Luke
2cc6b919f7 LibWeb: Implement EventTarget.dispatchEvent
Used by Web Platform Tests to test events
2021-05-04 23:41:44 +01:00
Luke
7f6baf8b17 LibWeb: Add Document.{images,embeds,plugins,links,forms,scripts} 2021-05-04 23:40:43 +01:00
Luke
19731fc14c LibWeb: Use HTML-uppercased qualified name for the Element node name
For regular elements, this is just the qualified name.
However, for HTML elements in HTML documents, it is the qualified name
uppercased.

This is used by jQuery to determine the document is an HTML document.
Not having this made jQuery assume the document was XML, causing
weird behaviour.

To do this, an internal string of qualified name is created.
This is to prevent constantly regenerating it. This is allowed by
the spec.

This is the same for the HTML-uppercased qualified name.
2021-05-04 23:24:03 +01:00
Luke
7c6c7ca542 LibWeb: Add createDocument and createDocumentType for DOMImplementation
Both required for the acid3 test.
createDocument is used extensively in Web Platform Tests.
2021-05-04 22:59:15 +01:00
Luke
5952bc1ea4 LibWeb: Add support for extended attributes on IDL parameters
Also adds support for [LegacyNullToEmptyString] for parameters.
2021-05-04 22:59:15 +01:00
Luke
b816000d47 LibWeb: Expose HTMLInputElement.name 2021-05-04 22:03:14 +01:00
Sergey Bugaev
7f98aaa65a Userland: Pledge wpath & cpath in strace
...while we open the output file.
2021-05-04 22:36:58 +02:00
Sergey Bugaev
72125827da Userland: Refactor head(1) to not use stdio
This fixes extensive copying data around, and also makes head(1) in
bytes mode read exactly as much data as it needs.

Also, rename --characters to --bytes: that's exactly what it does
(actual character counting is way more complicated), and that's what
the option is called in GNU coreutils.

Fixes https://github.com/SerenityOS/serenity/issues/6852
2021-05-04 22:36:58 +02:00
Andreas Kling
dbbc6096a9 Profiler: Move everything into the "Profiler" namespace 2021-05-04 20:59:32 +02:00
Andreas Kling
04c3cddb1e Snake: Spruce up the GUI a tiny bit
Give the game window a GUI::Frame appearance, and make sure the
menus have Alt shortcuts. :^)
2021-05-04 17:32:19 +02:00
Andreas Kling
d136fafde7 LibGUI: Make GUI::Widget ignore wheel events by default
This makes wheel events bubble up to parent widgets, which is useful
in case they care about wheel events even if their children don't.
2021-05-04 17:32:19 +02:00
Timothy Flynn
9a69b9112b LibWeb: Compute intrinsic height of absolute replaced elements
Previously, the method for computing the height of absolutely positioned
replaced elements only invoked the method for non-replaced elements.
That method is now implemented fully enough that it sometimes computed a
height of 0 for replaced elements. This implements section 10.6.5 rule 1
of the CSS spec to avoid that behavior.
2021-05-04 15:36:07 +01:00
Linus Groh
7d40a4a4e7 LibCore: Avoid unnecessary Vector copy in Account ctor 2021-05-04 15:16:28 +01:00
Linus Groh
d224610ecf LibCore: Don't include user GID in Account::extra_gids()
The user's GID is already available via gid(), and it's not "extra", so
don't include it in extra_gids() again. Also rename the internally used
function from get_gids() to get_extra_gids() to make its purpose more
clear.
2021-05-04 15:16:19 +01:00
Gunnar Beutner
3b759451c6 LibC: setspent() should not print to stderr 2021-05-04 13:45:49 +01:00
Gunnar Beutner
3cab91e8d7 LibCore: Let Account::from_* succeed if /etc/shadow is unreadable
This previously worked and was broken by 302f9798e.
2021-05-04 13:45:49 +01:00
Andreas Kling
19bef3877a Profiler: Don't link against LibCoreDump 2021-05-04 14:38:43 +02:00
Andreas Kling
f7de453716 LibGUI: Rename ScrollableWidget.cpp => AbstractScrollableWidget.cpp 2021-05-04 14:38:43 +02:00
Brian Gianforcaro
cc94495a29 Profiler: Print addresses in debug log in hex. 2021-05-04 10:57:55 +02:00
Gunnar Beutner
a3baf06549 WindowServer: Ignore mouse clicks we're not handling
This ignores unhandled mouse clicks for the window buttons. Right now
right-clicking on the window buttons animates them as if some action
were to occur when the mouse button is released.
2021-05-04 08:40:00 +02:00
Linus Groh
aa70a56174 LibGUI: Fix off-by-one in Scrollbar::scrubber_rect()
Recent changes in the button painting code made this unnecessary. For
the case of value() == max(), the scrubber button would overlap the
increment button.

Fixes #6838.
2021-05-03 22:22:53 +01:00
Linus Groh
0c1d1d97d5 LibGUI: Remove unused Scrollbar::{de,in}crement_gutter_rect() 2021-05-03 22:21:21 +01:00
Andreas Kling
1ee31981da WindowServer: Close any open menus when starting window move/resize 2021-05-03 23:13:02 +02:00
Andreas Kling
1aa56f0129 WindowServer+LibGUI: Make much of window construction asynchronous
Most of the IPC that happens between clients and WindowServer when
creating and configuring windows can be asynchronous. This further
reduces the amount of ping-ponging played during application startup.
2021-05-03 21:56:19 +02:00
Andreas Kling
a8a899adbf WindowServer+LibGUI: Make much of menu construction asynchronous
Creating a menu/menubar needs to be synchronous because we need the
ID from the response, but adding stuff *to* menus (and adding menus
to menubars, and menubars to windows) can all be asynchronous.

This dramatically reduces the amount of IPC ping-pong played by
each GUI application during startup.

I measured how long it takes TextEditor to enter the main event loop
and it's over 10% faster here. (Down from ~86ms to ~74ms)
2021-05-03 21:56:13 +02:00
Gunnar Beutner
8a6db55e79 Userland: Add try_* IPC handlers
This enables calling auto-generated IPC methods in a way that doesn't
crash the client if the peer disconnects.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
34cf5cf07f IPCCompiler: Don't generate handlers for response messages
For some reason we had IPC handler methods for the return types. This
removes those handlers.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
9e22e9ce88 Userland: Use snake case names in .ipc files
This updates all .ipc files to have snake case names for IPC methods.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
eb21aa65d1 Userland: Make IPC results with one return value available directly
This changes client methods so that they return the IPC response's
return value directly - instead of the response struct - for IPC
methods which only have a single return value.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
5bb79ea0a7 Userland: Update IPC calls to use proxies
This updates all existing code to use the auto-generated client
methods instead of post_message/send_sync.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
78803ce384 Userland: Split IPC endpoints into proxies and stubs
This enables support for automatically generating client methods.
With this added the user gets code completion support for all
IPC methods which are available on a connection object.
2021-05-03 21:14:06 +02:00
Gunnar Beutner
065040872f Userland: Change IPC funcs to use plain arguments instead of a struct
Instead of having a single overloaded handle method each method gets
its own unique method name now.
2021-05-03 21:14:06 +02:00
Andreas Kling
d47f15ab8b LibGUI: Rename ScrollableWidget => AbstractScrollableWidget 2021-05-03 21:03:13 +02:00
Andreas Kling
62125796c3 Minesweeper: Tweak main UI layout a little bit
Move the clock/flag icons closer to their respective text labels.
2021-05-03 18:07:35 +02:00
Andreas Kling
6e4e3cefb2 Minesweeper: Add a tasteful separator line between menubar and UI 2021-05-03 17:08:28 +02:00
Andreas Kling
381dcca2f6 Revert "LibGfx: Add directional floating-point scaling to Painter"
This reverts commit ff76a5b8d2.
2021-05-03 16:37:05 +02:00
Andreas Kling
f43adb816e Revert "LibGfx: Re-add missing bounds-checks to Painter::draw_rect"
This reverts commit 4cf5514672.
2021-05-03 16:36:57 +02:00
Brian Gianforcaro
0726d39cb1 LibC: Fix invalid 1-byte read I introduced in dirent.
When attempting to fix the dirent code I also changed
this to use strlcpy instead of the custom string copy
loop that was there before. Looking over strlcpy it
looked like it should work when using a non null terminated
string, I obviously misinterpreted the implementation
as it will read till it finds a null terminator.

Manually null terminate the string to address this.

Gunnar found this after he fixed UserspaceEmulator.
I reproduced it locally using his branch, and also
found the memory leak I had in the unit test for the
scandir that I added, so lets fix that as well.

Reported-by: Gunnar Beutner <gbeutner@serenityos.org>
2021-05-03 09:47:05 +02:00
spigwitmer
3a5f9b2f7e LibDebug: add DW_LNS_set_basic_block support
This adds support for the basic_block register to the Dwarf line
number state machine.
2021-05-03 09:01:14 +02:00
Paul Berg
bd68ca362b TextEditor: Clear the selection before deleting it
This patches fixes a crash of the Userland/TextEditor where it would
crash when deleting a range spanning two lines. This was because the
TextEditor would delete the range and modify the cursor position
before clearing the selection. This would trigger a status bar update
with the invalid selection.
2021-05-03 08:45:32 +02:00
Carlos César Neves Enumo
97d0028098 LibGUI: Debounce TextDocument undo stack
This replaces the repeating 2-sec timer with a debounced single-shot
timer on user input.
2021-05-03 08:43:10 +02:00
Gunnar Beutner
824bfa9600 DynamicLoader: Fix compiler warning
math.cpp: In function 'int64_t __moddi3(int64_t, int64_t)':
math.cpp:168:13: error: 'r' may be used uninitialized
[-Werror=maybe-uninitialized]
  168 |     return ((int64_t)r ^ s) - s; // negate if s == -1
      |             ^~~~~~~~~~
2021-05-03 08:42:39 +02:00
Gunnar Beutner
a050b43290 LibELF: Implement x86_64 relocation support
There are definitely some relocations missing and this is untested
for now.
2021-05-03 08:42:39 +02:00
Gunnar Beutner
b613817bca Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
Gunnar Beutner
fdbe66a7b4 LibELF+LibC: Support building LibELF for 64-bit targets 2021-05-03 08:42:39 +02:00