Commit Graph

27928 Commits

Author SHA1 Message Date
Sam Atkins
10e54a29b2 Base: Add several scaled images to test page
These look really bad with our current nearest-neighbor image scaling,
so they are a good test case to see how well other scaling algorithms
work.
2021-09-20 22:18:20 +02:00
Itamar
a3360bcee8 LibC+DynamicLoader: Store the auxiliary vector address at startup
Previously, getauxval() got the address of the auxiliary vector by
traversing to the end of the `environ` pointer.

The assumption that the auxiliary vector comes after the environment
array is true at program startup, however the environment array may
be re-allocated and change its address during runtime which would cause
getauxval() to work with an incorrect auxiliary vector address.

To fix this, we now get the address of the auxiliary vector once in
__libc_init and store it in a libc-internal pointer which is then used
by getauxval().

Fixes #10087.
2021-09-20 18:32:09 +02:00
Andreas Kling
01900801e3 LibWeb: Implement <script src> execution for non-blocking scripts 2021-09-20 17:22:25 +02:00
Andreas Kling
c34da16089 LibWeb: Make <script src> loads partially async (by following the spec)
Instead of firing up a network request and synchronously blocking for it
to finish via a nested event loop, we now start an asynchronous request
when encountering <script src>.

Once the script load finishes (or fails), it gets executed at one of the
synchronization points in the HTML parser.

This solves some long-standing issues with random unexpected events
getting dispatched in the middle of parsing.
2021-09-20 17:22:25 +02:00
Andreas Kling
e11ae33c66 LibWeb: Pop entire stack of open elements at the end of parsing 2021-09-20 17:22:25 +02:00
Andreas Kling
398692722b LibWeb: Implement an ad-hoc version of EventLoop::spin_until(condition)
This doesn't follow the exact spec steps but instead simply makes a
nested Core::EventLoop and spins it while a periodic timer tests the
goal condition.
2021-09-20 17:22:25 +02:00
Andreas Kling
60d0f041b7 LibWeb: Use Document::realm() in HTMLScriptElement::prepare_script() 2021-09-20 17:22:25 +02:00
Karol Kosek
bcfb07bc30 WidgetGallery: Crop animated cursors
Selecting the wait cursor displayed the full sprite image.

This has been borrowed from the MouseSettings.
2021-09-20 15:59:34 +02:00
Karol Kosek
d1846867cd WidgetGallery+MouseSettings: Use LexicalPath::basename() 2021-09-20 15:59:34 +02:00
Karol Kosek
9ddd2fdcc5 WidgetGallery: Simplify cursor change code
The code here wasn't updated when a new file icons appeared, so double-
-clicking a cursor didn't always set it to the correct one.

Also, the cursor list is sorted alphabetically, by the file name.
So if a theme used a different file naming in Config.ini, then
the previous code would also be incorrect.

Here we will just take the bitmap icon from the model.

Closes: #10142
2021-09-20 15:59:34 +02:00
Karol Kosek
38bc81015b LibGUI: Update the window cursor if it was provided as a bitmap
This condition rejected almost every bitmap cursor change.
2021-09-20 15:59:34 +02:00
Kenneth Myhra
3b901e5b2b LibC: Spec compliant IN6_IS_ADDR_V4MAPPED
An IPv4 mapped IPv6 address consist of 80 "0" bits, followed by 16 "1"
bits, followed by the 32-bit IPv4 address.

Example of IPv4 mapped IPv6 address:
IPv4 address: 169.219.13.133
IPv6 address: 0000:0000:0000:0000:FFFF:A9DB:0D85
Simplified  : ::FFFF:A9DB:0D85
2021-09-20 15:26:46 +02:00
Ben Wiederhake
f84a7e2e22 LibPDF: Replace Value class by AK::Variant
This decreases the memory consumption by LibPDF by 4 bytes per Value,
compensating exactly for the increase in an earlier commit. :^)
2021-09-20 17:39:36 +04:30
Ben Wiederhake
d344253b08 LibPDF: Extract reference bitpacking into dedicated class 2021-09-20 17:39:36 +04:30
Ben Wiederhake
da170997d5 LibPDF: Move inline function definition
This breaks the dependency cycle between Parser and Document.
2021-09-20 17:39:36 +04:30
Ben Wiederhake
edc0cd29f8 LibPDF: Break weird dependency cycle
Old situation:
Object.h defines Object
Object.h defines ArrayObject
ArrayObject requires the definition of Object
ArrayObject requires the definition of Value
Value.h defines Value
Value requires the definition of Object

Therefore, a file with the single line "#include <Value.h>" used to
raise compilation errors; certainly not something that one might expect
from a library.

This patch splits up the definitions in Object.h to break the cycle.
Now, Object.h only defines Object, Value.h still only defines Value (and
includes Object.h), and the new header ObjectDerivatives.h defines
ArrayObject (and includes both Object.h and Value.h).
2021-09-20 17:39:36 +04:30
Ben Wiederhake
7ddd11729d LibPDF: Add missing headers in Value.h 2021-09-20 17:39:36 +04:30
Ben Wiederhake
35674b8a42 LibPDF: Fix math error in comments 2021-09-20 17:39:36 +04:30
Ben Wiederhake
750bed254f LibPDF: Switch to automatic ref counting, fix memory leak
At least `Value::operator=` didn't properly unref the `PDF::Object` when
it was called. This type of problem is removed by just letting `RefPtr`
do its thing.

This patch increases the memory consumption by LibPDF by 4 bytes (the
other union objects) per value.
2021-09-20 17:39:36 +04:30
Ben Wiederhake
05006e63c4 LibPDF: Add missing headers to XRefTable.h 2021-09-20 17:39:36 +04:30
Ben Wiederhake
6089c4d97d LibPDF: Add missing headers to Reader.h 2021-09-20 17:39:36 +04:30
Ben Wiederhake
6836ca2136 LibPDF: Add missing headers to Forward.h 2021-09-20 17:39:36 +04:30
Ben Wiederhake
de15a6a657 Kernel: Clean up PCI::Device namespace formatting 2021-09-20 16:00:43 +03:00
Marcus Nilsson
f9e0815c3b PixelPaint: Move Tools to it's own subdirectory
The PixelPaint source directory was getting a bit large, let's move all
the Tools to it's own subdirectory. Also remove some unused includes.
2021-09-20 03:04:24 +00:00
Andrew Kaster
61ad239ee0 AK: Remove unnecessary include of <new> for non-__serenity__ builds
We already include `<new>` in AK/kmalloc.h when KERNEL is not defined,
which applies to all non-`__serenity__` builds.
2021-09-20 00:39:46 +00:00
Andrew Kaster
da87497e61 AK+LibC: Remove SERENITY_LIBC_BUILD guard around <initializer_list>
This was required before commit 5f724b6ca1
when we were building LibC before libstdc++ headers were available in
the sysroot. However as noted in that commit, we never actually needed
to be building LibC before libstdc++, so we can go ahead and remove this
ancient hack.
2021-09-20 00:39:46 +00:00
Andrew Kaster
210b0b883b AK: Remove unused ifdef for BUILDING_SERENITY_TOOLCHAIN
The only use of this define was removed in commit
5f724b6ca1, over a year ago.

The define was there to prevent the LibC build we built before libstdc++
from complaining about missing libgcc symbols. However, as noted in that
commit, we never actually needed to build LibC at all.
2021-09-20 00:39:46 +00:00
Ali Mohammad Pur
b946a1ce48 Shell: Make ArgsParser not exit on failure in builtin_exit()
Fixes #10128.
2021-09-20 03:31:57 +04:30
Tobias Christiansen
f6ffa09437 Meta: Add section to CLion Configuration Docs about including headers 2021-09-19 22:57:58 +02:00
Sam Atkins
0cedb7a7c4 LibWeb: Give InlineNodes borders :^) 2021-09-19 22:53:35 +02:00
Sam Atkins
e1f3fb0146 LibWeb: Move border-painting code out of Box
The logic here is needed by InlineNode too. Moving it into a
`paint_all_borders()` function makes it available to them both, as well
as anyone else who wants it. :^)
2021-09-19 22:53:35 +02:00
Sam Atkins
eb07668589 LibGfx: Add per-side overloads of Rect::inflate() and ::shrink()
These are in CSS order (top, right, bottom, left) since LibWeb is the
reason I'm adding these. :^)
2021-09-19 22:53:35 +02:00
Sam Atkins
0712036485 LibWeb: Give InlineNodes a box-shadow :^) 2021-09-19 22:53:35 +02:00
Sam Atkins
912596fae8 LibWeb: Give InlineNodes a background
This now uses the same code as Box, so images, repeat-rules, and
anything that's added in the future will work for `display: inline`
elements too. :^)
2021-09-19 22:53:35 +02:00
Sam Atkins
14dc20118c Base: Add page for testing styling on display: inline elements 2021-09-19 22:53:35 +02:00
Sam Atkins
abc22b727c LibWeb: Move background painting from Box to its own file
This makes the code accessible to things that aren't a Box, such as
InlineNode.
2021-09-19 22:53:35 +02:00
Sam Atkins
b047c1bc97 LibWeb: Move box-shadow painting out of Box to its own file
This makes the code accessible to things that aren't a Box, such as
InlineNode.
2021-09-19 22:53:35 +02:00
Sam Atkins
3b6325e787 LibWeb: Move InlineNode background code from paint_fragment -> paint
`paint_fragment()` seems to never get called. Moving the painting to
`paint()` fixes the background.
2021-09-19 22:53:35 +02:00
Sam Atkins
aaf12929d5 LibWeb: Extract border-radius normalization code from Box
This is going to be needed by InlineNodes too!

`BorderPainting.{h,cpp}` might not be the best place for it, but it
works for now.
2021-09-19 22:53:35 +02:00
Sam Atkins
b88641e44b LibWeb: Stop painting backgrounds for TextNodes
Doing so was causing the background to be painted twice, which looks
ugly if the background is semi-transparent. The painting is a bit of a
hack, as some situations apparently relied on it. This commit is ripping
the band-aid off to find where those are and fix them. :^)
2021-09-19 22:53:35 +02:00
Andreas Kling
7ef4d75716 LibWeb: Implement XMLHttpRequest.getAllResponseHeaders() 2021-09-19 22:34:44 +02:00
Andreas Kling
95559c4277 LibWeb: Implement basic support for MessageChannel and MessagePort
This patch adds a basic initial implementation of these API's.

Since LibWeb currently doesn't support workers, this implementation of
messaging doesn't bother with serializing and deserializing messages.
2021-09-19 22:34:44 +02:00
Andreas Kling
c7aa32b90f LibWeb: Add missing #include to MainThreadVM.h 2021-09-19 22:34:44 +02:00
Andreas Kling
68d1f5965a LibWeb: Add HTML::Task::Source::PostedMessage
This is the task source used by MessagePort.postMessage().
2021-09-19 22:34:44 +02:00
Andreas Kling
dd29abe4d6 Meta: Bump default VM memory size to 1 GiB 2021-09-19 22:34:43 +02:00
David Isaksson
122f440672 AudioApplet: Refactor window resizing 2021-09-19 21:52:32 +02:00
David Isaksson
df32f1b7de AudioApplet: Get values from AudioServer instead of the config file 2021-09-19 21:52:32 +02:00
David Isaksson
bd48abab8b AudioApplet: Make sure to set the internal volume on slider change
This fixes the issue that the percent label doesn't update.
2021-09-19 21:52:32 +02:00
David Isaksson
3f6ccf63fe AudioApplet: Round the volume to the nearest integer 2021-09-19 21:52:32 +02:00
David Isaksson
c1458e8061 AudioApplet: Update the volume slider on update from audio server 2021-09-19 21:52:32 +02:00