Commit Graph

10606 Commits

Author SHA1 Message Date
Andreas Kling
a64033e581 LibWeb: Generate Element bindings from IDL :^)
Had to do a bunch more hacking on WrapperGenerator to support this.
We now support attribute setters as well.
2020-06-21 11:39:32 +02:00
stelar7
5eb39a5f61 LibWeb: Update parser with more insertion modes :^)
Implements handling of InHeadNoScript, InSelectInTable, InTemplate,
InFrameset, AfterFrameset, and AfterAfterFrameset.
2020-06-21 10:13:31 +02:00
Emanuele Torre
8e24a17d0d Meta: default SUDO_UID and SUDO_GID to 0 in build-image-*.sh scripts
In the GNU coreutils version of chown, ":" is a valid argument
(the command will result in a no-op), but POSIX chown does not
consider that valid.

If the user who ran build-image-*.sh was root, SUDO_UID and SUDO_GID
would not be set and, if the version of chown installed on the system
did not allow passing just a ":" as argument, the script would fail.

Let's default the value of SUDO_UID and SUDO_GID to 0 just in case.
2020-06-21 10:13:04 +02:00
Emanuele Torre
22aa4cbf92 Build: rename image target => qemu-image
Also add a new `image` target which is just an alias to `qemu-image`.

This makes the CMakeLists.txt file more readable in my opinion.
2020-06-21 10:13:04 +02:00
Emanuele Torre
4a784d4d1b Meta: get rid of sync.sh using the technique used in the previous commit 2020-06-21 10:13:04 +02:00
Emanuele Torre
e42f4abd61 Meta: tweak build-image-grub.sh to allow running make grub-image..
without sudo.
2020-06-21 10:13:04 +02:00
Matthew Olsson
3f5c80e490 LibGfx: Add BMP suite html files 2020-06-21 10:08:25 +02:00
Matthew Olsson
4e093a7c23 LibGfx: Add BMP loader
Adds an *almost fully featured BMP loader to process .bmp files.

Features:
- All header formats are supported
- Full RLE4/8/24 support
- Color scaling (e.g. distributing a 5-bit color throughout the 8-bit
color spectrum, so 5-bit white is still 0xffffff)
- Full BITMASK/ALPHABITMASK support

*Not included:
- 1D Huffman compression. Good luck actually finding a bmp in the wild
that uses this
- Use of any field in the V4/V5 header. Color spaces? Endpoints? No
thanks :)

This loader was tested with the images at
https://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html. This
loader correctly displays 81 out of the 90 total images (for reference,
firefox displays 64 correctly). Note that not rendering the images at
the bottom is counted as displaying correctly.
2020-06-21 10:08:25 +02:00
stelar7
dfe5b232f4 LibWeb: Assume URLs ending in / serve html content :^) 2020-06-21 10:00:57 +02:00
Maciej Sobaczewski
a4fbc78f25 LibWeb: Respect display:none on <input> elements 2020-06-21 09:59:06 +02:00
Emanuele Torre
4bbe01def1
chown: Don't allow "invalid" uid/gid specs (#2596)
The usage message states that a uid/gid spec should be <uid[:gid]>.

Let's not allow `anon:`, `anon:users:hello` and `:users` then.
2020-06-21 09:54:07 +02:00
Andreas Kling
8edecbea4b LibWeb: Fix build after atob/btoa changes 2020-06-21 01:07:16 +02:00
Andreas Kling
bc4fa7a3c9 LibWeb: Expose Node.appendChild() to the web
This is a very barebones implementation of appendChild() that doesn't
take any of the idiosyncratic DOM behaviors into account yet.

Also teach the wrapper generator how to turn an Interpreter argument
into a Node&.
2020-06-21 01:01:50 +02:00
Andreas Kling
faff557400 LibWeb: Expose Document.body to the web
Also, make it return a HTMLElement since Document.body should actually
return the frameset element in a frame-based document.
2020-06-21 01:00:30 +02:00
Andreas Kling
319ef8aa86 LibWeb: Expose Document.createElement() to the web 2020-06-21 00:58:55 +02:00
Andreas Kling
246af7f0ff LibWeb: Fix missing snake_case-ificiation of function parameter names 2020-06-21 00:58:55 +02:00
Andreas Kling
fbfae033cc Meta: Tweak QtCreator .files sync script to include .idl files 2020-06-21 00:58:55 +02:00
Andreas Kling
94cf1f08ec LibWeb: Add Node.parentNode and Node.parentElement to DOM API :^) 2020-06-21 00:58:55 +02:00
Andreas Kling
94fdf4fa5a LibWeb+LibJS: Add a naive way to check if a wrapper "is" a certain type
Instead of only checking the class_name(), we now generate an is_foo()
virtual in the wrapper generator. (It's currently something we override
on Bindings::Wrapper, which is not really scalable.)

Longer term we'll need to think up something smarter for verifying that
one wrapper "is" another type of wrapper.
2020-06-21 00:58:55 +02:00
Andreas Kling
1ffffa0053 LibWeb: Start generating JS wrappers from (simplified) WebIDL :^)
This patch introduces a hackish but functional IDL parser and uses it
to generate the JS bindings for Node and Document.

We'll see how far this simple parser takes us. The important thing
right now is generating code, not being a perfect IDL parser. :^)
2020-06-21 00:58:55 +02:00
Andreas Kling
8d6910b78e Kernel: Use map_typed() in HPET code and add a register access helper 2020-06-21 00:58:55 +02:00
Joel Puig Rubio
1d59053494 LibWeb: Add atob/btoa to WindowObject 2020-06-20 19:38:49 +02:00
Andreas Kling
37598de582 Kernel: Remove DMI decoder from the kernel
As suggested by @supercomputer7, we can simply expose this as a blob
and decode it in userspace instead.

Fixes #2599.
2020-06-20 18:39:46 +02:00
Andreas Kling
42870a9494 LibWeb: Add some missing wrapper calls to base class initialize()
This is easy to forget, but the problem will go away once we start to
auto-generate this code.
2020-06-20 18:27:31 +02:00
Andreas Kling
3ba17d8df7 LibJS: Make Interpreter::construct() take a GlobalObject& 2020-06-20 17:53:33 +02:00
Andreas Kling
2fe4285693 LibJS: Object::initialize() overrides must always call base class 2020-06-20 17:50:48 +02:00
Andreas Kling
cc5cba90db LibWeb: Give the DOM Window object a (weak) pointer to its JS wrapper 2020-06-20 17:50:48 +02:00
Andreas Kling
8194dfb9f4 LibWeb: JS wrappers need to call base class initialize() 2020-06-20 17:50:48 +02:00
Andreas Kling
e1f9da142e LibJS: NativeProperty get/put should take a GlobalObject& 2020-06-20 17:50:48 +02:00
Andreas Kling
03da70c7d0 LibWeb: Split JS wrapper constructors into construct/initialize 2020-06-20 17:50:48 +02:00
Andreas Kling
06e29fac57 LibJS: Split more native object constructors into construct/initialize 2020-06-20 17:50:48 +02:00
Andreas Kling
9610d18ebb LibJS: Remove some Interpreter::global_object() calls in JSONObject 2020-06-20 17:50:48 +02:00
Andreas Kling
32c121a8f7 LibJS: Pass GlobalObject& to Reference get/put 2020-06-20 17:50:48 +02:00
Andreas Kling
8d56e6103e LibJS: Make Value::to_object() take a GlobalObject& 2020-06-20 17:50:48 +02:00
Andreas Kling
cd14ebb11f LibJS: More Interpreter::global_object() removal
Also let's settle on calling the operation of fetching the "this" value
from the Interpreter and converting it to a specific Object pointer
typed_this() since consistency is nice.
2020-06-20 17:50:48 +02:00
Andreas Kling
a9e4babdaf LibJS: Pass GlobalObject& when constructing an Accessor 2020-06-20 17:50:48 +02:00
LepkoQQ
1f584911b2 Base: Add some more characters to Katica and Csilla fonts 2020-06-20 17:04:03 +02:00
LepkoQQ
412e566967 Base: Fix slovenian keymap 2020-06-20 17:04:03 +02:00
LepkoQQ
b1c99c1891 AK: Fix JsonParser double encoding multibyte utf-8 chararcters 2020-06-20 17:04:03 +02:00
Andreas Kling
64513f3c23 LibJS: Move native objects towards two-pass construction
To make sure that everything is set up correctly in objects before we
start adding properties to them, we split cell allocation into 3 steps:

1. Allocate a cell of appropriate size from the Heap
2. Call the C++ constructor on the cell
3. Call initialize() on the constructed object

The job of initialize() is to define all the initial properties.
Doing it in a second pass guarantees that the Object has a valid Shape
and can find its own GlobalObject.
2020-06-20 15:46:30 +02:00
Andreas Kling
e4add19915 LibJS: Pass GlobalObject& to native functions and property accessors
More work towards supporting multiple global objects. Native C++ code
now get a GlobalObject& and don't have to ask the Interpreter for it.

I've added macros for declaring and defining native callbacks since
this was pretty tedious and this makes it easier next time we want to
change any of these signatures.
2020-06-20 15:45:07 +02:00
Andreas Kling
4aa98052ca LibJS: Remove some more use of Interpreter::global_object()
Let's do some more work towards supporting multiple global objects.
2020-06-20 15:45:07 +02:00
Nico Weber
ed0740d73c LibC: In posix_spawn(), use _exit instead of exit on child error
posix_spawn() tries to present semantics as if no fork() is happening
behind the scenes, so running arbitrary atexit handlers of the parent
in the child seems like the wrong thing to do.
2020-06-20 14:43:27 +02:00
Nico Weber
5208856688 LibC: Add addchdir() / addfchdir() to posix_spawn file actions
This isn't in posix yet, but it is implemented on some platforms
and it will be in a future version:
https://www.austingroupbugs.net/view.php?id=1208
2020-06-20 14:43:27 +02:00
Nico Weber
2ddca326be LibC: Add POSIX_SPAWN_SETSIGMASK
This isn't in posix yet, but it is implemented on some platforms
and it will be in a future version:
https://www.austingroupbugs.net/view.php?id=1044

It seems useful, so add it.
2020-06-20 14:43:27 +02:00
Nico Weber
39d1a43c45 LibC: Make sigprocmask error check more consistent with rest of this code 2020-06-20 14:43:27 +02:00
Nico Weber
7ffcc5a8b2 LibC: Implement file actions for posix_spawn 2020-06-19 22:11:38 +02:00
Nico Weber
68f281c864 LibC: Make spawn.h parse in C files 2020-06-19 22:11:38 +02:00
Andreas Kling
2188ed54b0 Base: Note that the "setkeymap" pledge promise is an extension 2020-06-19 21:15:25 +02:00
Nico Weber
e34299a136 Ports: Remove dropbear patch that removed calls to seteuid()
This is no longer necessary now that seteuid() / setegid()
is implemented.
2020-06-19 20:34:59 +02:00