Commit graph

10619 commits

Author SHA1 Message Date
Hüseyin ASLITÜRK
9ab82c0ee5 LibGfx: Add PBM image file type support 2020-06-21 16:42:46 +02:00
Hüseyin ASLITÜRK
41d5531624 LibWeb: Add "image/x‑portable‑bitmap" mime type for pbm file extension 2020-06-21 16:42:46 +02:00
Hüseyin ASLITÜRK
58c3356472 Base: Add pbm file type to QuickShow file type list 2020-06-21 16:42:46 +02:00
Hüseyin ASLITÜRK
671560a844 LibGUI: Bug fix on GUI::Image when image is nullptr
This bug cause to FilePicker crash when second image selected for preview. FilePicker sets bitmap to "nullptr" clear preview.
2020-06-21 16:42:46 +02:00
Andreas Kling
e1bd815a6a LibWeb: Generate Event and MouseEvent bindings from IDL :^)
We still have to hand-write a function to turn an Event& into a wrapper
but this is still a hue improvement. Eventually we'll find a way to
auto-generate that function as well.
2020-06-21 16:12:28 +02:00
Andreas Kling
dd29ff884f LibWeb: Generate ImageData bindings from IDL :^) 2020-06-21 15:57:10 +02:00
Andreas Kling
b959d06ace LibWeb: Generate HTMLCanvasElement bindings from IDL :^) 2020-06-21 15:37:13 +02:00
Andreas Kling
119dd2c541 LibWeb: Generate HTMLImageElement bindings from IDL :^) 2020-06-21 15:26:09 +02:00
Andreas Kling
af51dc105a LibJS+LibWeb: Add JS::Object::inherits(class_name)
To allow implementing the DOM class hierarchy in JS bindings, this
patch adds an inherits() function that can be used to ask an Object
if it inherits from a specific C++ class (by name).

The necessary overrides are baked into each Object subclass by the
new JS_OBJECT macro, which works similarly to C_OBJECT in LibCore.

Thanks to @Dexesttp for suggesting this approach. :^)
2020-06-21 15:15:52 +02:00
Andreas Kling
1914f52371 LibWeb: Add HTMLElement wrapper
Expose the "title" attribute just to expose something. :^)
2020-06-21 14:39:15 +02:00
Andreas Kling
244b243d22 LibWeb: Add EventTarget.removeEventListener() 2020-06-21 12:37:34 +02:00
Andreas Kling
d724a12732 LibWeb: Generate EventTarget bindings from IDL :^) 2020-06-21 12:31:42 +02:00
Andreas Kling
a014b2930e LibWeb: Add Element.tagName and Element.className 2020-06-21 12:01:13 +02:00
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