Commit Graph

11696 Commits

Author SHA1 Message Date
Andreas Kling
1b1537c5a6 LibWeb: Simplify type traits for SVGGraphicsElement 2020-07-26 17:51:00 +02:00
Andreas Kling
e0b8b4ac67 LibCore+LibGUI: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
71556e39a4 LibWeb: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
fe6474e692 Kernel: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
ce2c5b375c AK: Add global is<T>() and downcast<T>()
Let's unify the is<T>/to<T> implementations that currently exist in
separate versions in LibCore and LibWeb.
2020-07-26 17:51:00 +02:00
Andreas Kling
a565121793 LibWeb: Move HTML object model stuff into LibWeb/HTML/
Take a hint from SVG and more all the HTML classes into HTML instead of
mixing them with the DOM classes.
2020-07-26 17:51:00 +02:00
Paul Scharnofske
fbc54a2dba Documentation: Only install missing packages for Arch Linux.
By default `pacman -S` will reinstall all the packages that are already installed on the system.
2020-07-26 17:48:24 +02:00
asynts
707d92db61 Refactor: Change the AK::binary_search signature to use AK::Span. 2020-07-26 16:49:06 +02:00
asynts
ac9c2bc492 AK: Implement Span which represents a contiguous sequence of objects.
This makes it possible to pass one object rather than pointer and length
individually.
2020-07-26 16:49:06 +02:00
Andreas Kling
d43ddd6eb7 LibWeb: LayoutSVG should not claim to be a LayoutCanvas :^)
Also make the class_name() match the actual class name.
2020-07-26 14:59:43 +02:00
AnotherTest
ec0315883b LibHTTP: Be more tolerant about bad chunked encoding trailers
Some servers (*glares at cloudflare*) like to send two last chunks,
which is strictly against the spec. Let's be more tolerant of this
behaviour.
2020-07-26 14:55:47 +02:00
Matthew Olsson
49c5acaa3d LibM: Fix Lagom build
isnormal really messes up the build. Just remove it for now; it can be
addressed in a seperate commit. Additionally, conditionally add
`noexcept` to the math functions if we are in a C++ context.
2020-07-26 14:53:43 +02:00
Matthew Olsson
b1299f972c LibWeb: Refactor SVG files into their own directory; follow spec layout 2020-07-26 14:53:43 +02:00
Matthew Olsson
2e73082203 Base: Add SVG test file to welcome page 2020-07-26 14:53:43 +02:00
Matthew Olsson
943e4f8bf1 LibWeb: Abstract common operations of graphical SVG elements 2020-07-26 14:53:43 +02:00
Matthew Olsson
3206263c2d LibM: Evaluate math macros, add M_DEG2RAD and M_RAD2DEG 2020-07-26 14:53:43 +02:00
Matthew Olsson
9cce7f57dd LibGfx: Add FloatPoint methods
Adds some conversion constructors, as well as the missing arithmetic
operations.
2020-07-26 14:53:43 +02:00
Matthew Olsson
5985eac81d LibWeb: Add elliptical curve support to svg path elements 2020-07-26 14:53:43 +02:00
Matthew Olsson
1cffde7635 LibGfx: Add elliptical curves to Path 2020-07-26 14:53:43 +02:00
Matthew Olsson
22f0953fe2 LibWeb: Begin SVG element support
This commit starts adding a basic SVG element. Currently, svg elements
have support for the width and height properties, as well as the stroke,
stroke-width, and fill properties. The only child element supported
is the path element, as most other graphical elements are just shorthand
for paths.
2020-07-26 14:53:43 +02:00
thankyouverycool
bbcdab2baa Base+MenuApplet: Add new controls and icons for AudioApplet
Adds a classic volume slider to the AudioApplet. Percent text
and mute state can now be toggled via checkboxes. Left click opens,
right click mutes. Updates existing icons and adds unique icons for
muted vs zero volume states.
2020-07-26 11:32:12 +02:00
thankyouverycool
c50f258b7a LibGUI+WindowServer: Allow applets to retrieve their location
MenuApplet windows can now call rect_in_menubar to return their
location in the MenuBar.
2020-07-26 11:32:12 +02:00
thankyouverycool
030f4150b8 WindowServer: Adjust MenuApplet position on resize
Applet rects are now recalculated when changed.
2020-07-26 11:32:12 +02:00
Nico Weber
f6db97b8a9 LibX86: Support disassembling a few FPU opcodes better 2020-07-26 11:29:03 +02:00
Ben Wiederhake
d8c8820ee9 Kernel: Allow Thread::sleep for more than 388 days
Because Thread::sleep is an internal interface, it's easy to check that there
are only few callers: Process::sys$sleep, usleep, and nanosleep are happy
with this increased size, because now they support the entire range of their
arguments (assuming small-ish values for ticks_per_second()).
SyncTask doesn't care.

Note that the old behavior wasn't "cap out at 388 days", which would have been
reasonable. Instead, the code resulted in unsigned overflow, meaning that a
very long sleep would "on average" end after about 194 days, sometimes much
quicker.
2020-07-25 20:21:25 +02:00
Ben Wiederhake
76c135ddcf Kernel: Make clock_nanosleep aware of dynamic tick length
On my system, ticks_per_second() returns 1280.
So Serenity was very fast at sleeping! :P
2020-07-25 20:21:25 +02:00
Ben Wiederhake
4a5a7b68eb Kernel: Make usleep aware of dynamic tick length
On my system, ticks_per_second() returns 1280.
So Serenity was always 20% too fast when sleeping!
2020-07-25 20:21:25 +02:00
Ben Wiederhake
782db88e82 Shell: Don't crash when autocompleting a non-bare word
For example, type 'Hello?' without the quotation marks but with the
question mark, and press TAB.

Previously, this would crash the Shell. Now, it merely refuses
to make any suggestions.

We could do better, but that is too hard for now.
2020-07-25 19:11:10 +02:00
Andreas Kling
4ad6315fda Meta: Add Matthew Olsson to the contributors list :^) 2020-07-25 15:22:23 +02:00
Andreas Kling
0d3d22f464 WindowServer: Use WindowManager::window_title_font() in one place
If we use this everywhere, it may one day become possible to change the
window title font.
2020-07-25 13:45:52 +02:00
Andreas Kling
0aef87b82c WindowServer: Center the window titlebar icons vertically
This feels a bit tricksy, but at least makes window icons look much
better with the "Basalt" theme. :^)
2020-07-25 13:43:56 +02:00
Andreas Kling
e2f45a4b0e WindowServer: Relayout window buttons immediately on theme change 2020-07-25 13:35:16 +02:00
Andreas Kling
3ee6ed965f LibJS: Use allocate_without_global_object for primitive cell types
More steps towards multiple global object support. Primitive cells
like strings, bigints, etc, don't actually have any connection to
the global object. Use the explicit API to clarify this.
2020-07-25 13:12:17 +02:00
Tom
3fdacef07f LibCrypto: Optimize UnsignedBigInteger import_data/export_data
No need to do complicated math to import or export numbers,
just convert the byte stream to words and vice versa.
2020-07-25 12:53:02 +02:00
Luke
08221139a5 test-web: Add ability to change page mid-test
This allows you to not have to write a separate test file
for the same thing but in a different situation.

This doesn't handle when you change the page with location.href
however.

Changes the name of the page load handlers to prevent confusion
with this.
2020-07-25 12:35:15 +02:00
Benoît Lormeau
1d6a3a5e8f Base: Complete the french keymap and fix the numeric keypad
Accentuated letters and other characters from the Unicode Block
"Latin-1 Supplement" were added; they weren't supported in the past.
Regarding the numpad: there was a `"", ` too much in the keymap, which
was shifting the keys when pressed (e.g. I would get a '9' instead of a '+')
2020-07-25 12:34:54 +02:00
Ben Wiederhake
b3472cb4a7 Kernel: Allow process creation during low-entropy condition
Fixes #2871.

Ignoring the 'securely generated bytes' constraint seems to
be fine for Linux, so it's probably fine for Serenity.

Note that there *might* be more bottlenecks down the road
if Serenity is started in a non-GUI way. Currently though,
loading the GUI seems to generate enough interrupts to
seed the entropy pool, even on my non-RDRAND setup. Yay! :^)
2020-07-25 12:34:30 +02:00
Ben Wiederhake
8c14219fb1 AK: Fix print_double
Fixes #2776.

This fixes, among other things, JSON serialization.

The underlying bug was that 'print_double' defined fraction_length
as a function argument with a default value, whereas
printf_internal *always* provided a value, even if nothing was read.
The 'use 6 by default' logic has been moved to printf_internal instead.
2020-07-25 12:32:55 +02:00
AnotherTest
9685080bd4 PixelPaint: Add a bunch of spatial filters
This patchset adds a generic convolution matrix spatial filter, and a
few named derivatives such as BoxBlur, Laplacian, Sharpen and
GaussianBlur.
2020-07-25 02:13:43 +02:00
AnotherTest
9d349ac646 LibGfx: Add a generic Matrix variant 2020-07-25 02:13:43 +02:00
AnotherTest
2d96437bbb LibGfx: Add Matrix4x4::elements() getters 2020-07-25 02:13:43 +02:00
Andreas Kling
d1fdc1a2cf LibWeb: Use [Reflect] for Element.id and Element.className :^) 2020-07-24 13:25:42 +02:00
Andreas Kling
8f31331e68 LibWeb: Allow specifying a custom attribute name for [Reflect]
Sometimes the IDL attribute and the DOM attribute don't have the same
exact name. In those cases, we can now do this:

    [Reflect=foobar] attribute DOMString fooBar;
2020-07-24 13:23:47 +02:00
Andreas Kling
cb35a8ea83 LibWeb: Add HTMLElement.lang (and make HTMLElement.title reflecting) 2020-07-24 13:16:11 +02:00
Andreas Kling
ea451cea6a LibWeb: Add HTMLImageElement.src and HTMLImageElement.alt
These are reflecting attributes! :^)
2020-07-24 13:12:14 +02:00
Andreas Kling
3eff6024b1 LibWeb: Add code generation for reflecting IDL attributes
You can now tag reflecting attributes with [Reflect] to generate code
that does basic DOM element attribute get/set.

(This patch also makes it easy to add more extended attributes like
that going forward.)

From the HTML spec:

"Some IDL attributes are defined to reflect a particular content
attribute. This means that on getting, the IDL attribute returns
the current value of the content attribute, and on setting,
the IDL attribute changes the value of the content attribute
to the given value."
2020-07-24 13:06:02 +02:00
Andreas Kling
dc4327c54b Build: Remove two unnecessary CXXFLAGS
Seems like we can build without these two flags now:

    -Wno-sized-deallocation
    -fno-sized-deallocation

I don't remember why they were needed in the first place.
2020-07-24 02:57:11 +02:00
Andreas Kling
cd4bc81dbb AK: Add a couple more helper templates to StdLibExtras 2020-07-24 02:38:17 +02:00
Andreas Kling
a655cf5b41 LibGUI: Break up Window::event() into many smaller functions
This function was unbearably huge. Handle each event type in its own
function instead so you can see what's going on.
2020-07-24 01:03:24 +02:00
Nico Weber
3f45e9ab1e Lagom: Add LibGemini, LibGfx
They are dependencies of LibWeb and might be useful for
running test-web on GitHub actions one day.
2020-07-23 23:02:28 +02:00