1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00
Commit graph

41124 commits

Author SHA1 Message Date
Andreas Kling
df7e64d103 LibWeb: Handle multiple class names in getElementsByClassName()
The input string is actually a space-separated list of class names,
not a single class name.
2022-09-17 18:53:26 +02:00
Andreas Kling
2371446952 LibWeb: Update layout in HTMLElement.offset{Top,Left}
We can't report layout-dependent metrics without first ensuring that
layout is up-to-date.
2022-09-17 18:53:26 +02:00
Andreas Kling
9e274d9501 LibWeb: Make Document.createElement() lowercase HTML local names
Bring createElement() a little bit closer to spec-compliance.
2022-09-17 18:53:26 +02:00
davidot
03c468fb7d LibJS: Parse date strings like "9/17/2022" 2022-09-17 18:53:14 +02:00
djwisdom
4a0f4eb07a Base: Update Magnifier.md use visual impairment vs sight impaired 2022-09-17 16:08:01 +00:00
b14ckcat
3452cbd1ed Kernel/USB: Hotplug multiple USB device crash hotfix 2022-09-17 17:11:13 +02:00
Jelle Raaijmakers
f6dfd77268 LibGL: Prevent segfault due to texture destruction
Destruction of `GL::GLContext` resulted in the destruction of
`GPU::Driver` _before_ the destruction of the allocated textures, which
in turn point to `GPU::Image` objects. Since the destruction of
`GPU::Driver` unloads the shared library, we were trying to invoke
non-existing code.

Fix this by moving `m_driver` up in `GLContext` so that it's last in
line for destruction.
2022-09-17 09:21:52 +00:00
Mykola
645f6e3c4a Base: Add a lot of emoji
This commit adds many many many flags.

📢 - U+1F4E2 LOUDSPEAKER
📣 - U+1F4E3 MEGAPHONE
📐 - U+1F4D0 TRIANGULAR RULER
🔫 - U+1F52B WATER PISTOL
🏹 - U+1F3F9 BOW AND ARROW
🔰 - U+1F530 JAPANESE SYMBOL FOR BEGINNER
🇦🇨 - U+1F1E6 U+1F1E8 FLAG: ASCENSION ISLAND
🇦🇩 - U+1F1E6 U+1F1E9 FLAG: ANDORRA
🇦🇫 - U+1F1E6 U+1F1EB FLAG: AFGHANISTAN
🇦🇮 - U+1F1E6 U+1F1EE FLAG: ANGUILLA
🇦🇱 - U+1F1E6 U+1F1F1 FLAG: ALBANIA
🇦🇷 - U+1F1E6 U+1F1F7 FLAG: ARGENTINA
🇦🇸 - U+1F1E6 U+1F1F8 FLAG: AMERICAN SAMOA
🇧🇱 - U+1F1E7 U+1F1F1 FLAG: ST. BARTHÉLEMY
🇧🇲 - U+1F1E7 U+1F1F2 FLAG: BERMUDA
🇧🇳 - U+1F1E7 U+1F1F3 FLAG: BRUNEI
🇧🇶 - U+1F1E7 U+1F1F6 FLAG: CARIBBEAN NETHERLANDS
🇧🇿 - U+1F1E7 U+1F1FF FLAG: BELIZE
🇨🇨 - U+1F1E8 U+1F1E8 FLAG: COCOS (KEELING) ISLANDS
🇨🇰 - U+1F1E8 U+1F1F0 FLAG: COOK ISLANDS
🇨🇻 - U+1F1E8 U+1F1FB FLAG: CAPE VERDE
🇨🇽 - U+1F1E8 U+1F1FD FLAG: CHRISTMAS ISLAND
🇨🇾 - U+1F1E8 U+1F1FE FLAG: CYPRUS
🇩🇬 - U+1F1E9 U+1F1EC FLAG: DIEGO GARCIA
🇩🇲 - U+1F1E9 U+1F1F2 FLAG: DOMINICA
🇩🇿 - U+1F1E9 U+1F1FF FLAG: ALGERIA
🇪🇨 - U+1F1EA U+1F1E8 FLAG: ECUADOR
🇪🇷 - U+1F1EA U+1F1F7 FLAG: ERITREA
🇪🇹 - U+1F1EA U+1F1F9 FLAG: ETHIOPIA
🇫🇯 - U+1F1EB U+1F1EF FLAG: FIJI
🇫🇰 - U+1F1EB U+1F1F0 FLAG: FALKLAND ISLANDS
🇬🇩 - U+1F1EC U+1F1E9 FLAG: GRENADA
🇬🇪 - U+1F1EC U+1F1EA FLAG: GEORGIA
🇬🇮 - U+1F1EC U+1F1EE FLAG: GIBRALTAR
🇬🇲 - U+1F1EC U+1F1F2 FLAG: GAMBIA
🇬🇵 - U+1F1EC U+1F1F5 FLAG: GUADELOUPE
🇬🇶 - U+1F1EC U+1F1F6 FLAG: EQUATORIAL GUINEA
🇬🇸 - U+1F1EC U+1F1F8 FLAG: SOUTH GEORGIA & SOUTH SANDWICH ISLANDS
🇬🇺 - U+1F1EC U+1F1FA FLAG: GUAM
🇮🇴 - U+1F1EE U+1F1F4 FLAG: BRITISH INDIAN OCEAN TERRITORY
🇰🇾 - U+1F1F0 U+1F1FE FLAG: CAYMAN ISLANDS
🇲🇸 - U+1F1F2 U+1F1F8 FLAG: MONTSERRAT
🇳🇺 - U+1F1F3 U+1F1FA FLAG: NIUE
🇳🇿 - U+1F1F3 U+1F1FF FLAG: NEW ZEALAND
🇵🇳 - U+1F1F5 U+1F1F3 FLAG: PITCAIRN ISLANDS
🇸🇭 - U+1F1F8 U+1F1ED FLAG: ST. HELENA
🇹🇦 - U+1F1F9 U+1F1E6 FLAG: TRISTAN DA CUNHA
🇹🇨 - U+1F1F9 U+1F1E8 FLAG: TURKS & CAICOS ISLANDS
🇹🇻 - U+1F1F9 U+1F1FB FLAG: TUVALU
🇻🇬 - U+1F1FB U+1F1EC FLAG: BRITISH VIRGIN ISLANDS
2022-09-17 10:14:22 +01:00
djwisdom
378f004a28 Base: Update Durrque theme for a better look and feel 2022-09-17 10:08:59 +01:00
Julian Offenhäuser
77f5f7a6f4 LibPDF: Support parsing page tree nodes that are in object streams
conditionally_parse_page_tree_node used to assume that the xref table
contained a byte offset, even for compressed objects. It now uses the
common facilities for parsing objects, at the expense of some
performance.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
6225c03256 LibPDF: Rename argument for the latin character set enumeration macro
The previous name "V" collided with one of the entries.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
633e1632d0 LibPDF: Allow whitespace other than EOL after an object marker 2022-09-17 10:07:14 +01:00
Julian Offenhäuser
65e83bed53 LibPDF: Disallow parsing indirect values as operands
An operation like 0 0 0 RG would have been confused for [ 0, 0 0 R ] G
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
04cb00dc9a LibPDF: Fix handling of differences array in custom encodings
When looking up differences in the specified encoding, we previously
didn't recognize a lot of characters, namely those that are referred to
by a string in the PDF itself, like "/germandbls".

We now create a mapping of those characters to the code points they are
referring to, and correctly look them up when needed.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
36828f1385 LibPDF: Don't expect glyph width arrays to contain integers
They might also contain floats, in which case we convert them to int
before use.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
97ed4106e5 LibPDF: Fix text positioning with operator TJ
As per spec, the positioning (or kerning) parameter of this operator
should translate the text matrix before the next showing of text.
Previously, this calculation was slightly wrong and also only applied
after the text was already shown.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
563d91b6c4 LibPDF: Implement loading compressed objects from object streams
Now, whenever the xref table points to a compressed object,
parse_object_with_index will look it up in the corresponding object
stream as if it were a regular object.

With this, our parser gains the bare minimum support for xref streams.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
f9beff7b5e LibPDF: Initial work on parsing xref streams
Since PDF version 1.5, a document may omit the xref table in favor of
a new kind of xref stream object. This is used to reference so-called
"compressed" objects that are part of an object stream.

With this patch we are able to parse this new kind of xref object, but
we'll have to implement object streams to use them correctly.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
4887aacec7 LibPDF: Move document-specific parsing functionality into its own class
The Parser class is now a generic PDF object parser, of which the new
DocumentParser class derives. DocumentParser now takes over all
functions relating to linearization, pages, xref and trailer handling.

This allows the use of multiple parsers in the same document's
context, which will be needed in order to handle PDF object streams.
2022-09-17 10:07:14 +01:00
Julian Offenhäuser
9f4659cc63 LibPDF: Move consume and match helper functions to the Reader class 2022-09-17 10:07:14 +01:00
Ben Wiederhake
8de7a91571 LibCompress+Tests: Demonstrate and fix faulty metadata length
The test-case is heavily inspired by:
https://github.com/google/brotli/blob/master/tests/testdata/x.compressed.01
Or in words: A metadata meta-block containing `Y` (which should be
ignored), and then the actual data (a single `Z`). The bug used to skip
one metadata byte too few, and thus read garbage.
2022-09-17 04:10:11 +00:00
Ben Wiederhake
fe48fed4fa LibWeb: Break inclusion cycle by removing unnecessary include 2022-09-17 04:00:54 +00:00
Ben Wiederhake
e909231d78 LibWeb: Break inclusion cycle through forward-declaration 2022-09-17 04:00:54 +00:00
Ben Wiederhake
4cd382c621 LibJS: Break another inclusion cycle by removing unnecessary include 2022-09-17 04:00:54 +00:00
Ben Wiederhake
6a4e2efa65 LibJS: Break inclusion cycle by removing unnecessary include 2022-09-17 04:00:54 +00:00
Ben Wiederhake
ff96747e17 LibPDF: Break inclusion cycle by removing unnecessary include 2022-09-17 04:00:54 +00:00
Ben Wiederhake
75673319ad LibDebug: Break inclusion cycle through many forward-declarations 2022-09-17 04:00:54 +00:00
Ben Wiederhake
7c5e30daaa Everywhere: Fix badly-formatted includes 2022-09-17 04:00:54 +00:00
CenTdemeern1
318a343616 Base: Add some emoji
Emoji included:
♟ - U+265F BLACK CHESS PAWN
❣ - U+2763 HEAVY HEART EXCLAMATION MARK ORNAMENT
❤ - U+2764 HEAVY BLACK HEART
🍜 - U+1F35C STEAMING BOWL
🎊 - U+1F38A CONFETTI BALL
🎟 - U+1F39F ADMISSION TICKETS
🐾 - U+1F43E PAW PRINTS
💓 - U+1F493 BEATING HEART
💔 - U+1F494 BROKEN HEART
💕 - U+1F495 TWO HEARTS
💖 - U+1F496 SPARKLING HEART
💗 - U+1F497 GROWING HEART
💘 - U+1F498 HEART WITH ARROW
💙 - U+1F499 BLUE HEART
💚 - U+1F49A GREEN HEART
💛 - U+1F49B YELLOW HEART
💜 - U+1F49C PURPLE HEART
💝 - U+1F49D HEART WITH RIBBON
📰 - U+1F4F0 NEWSPAPER
🖤 - U+1F5A4 BLACK HEART
🗑 - U+1F5D1 WASTEBASKET
🚎 - U+1F68E TROLLEYBUS
🤍 - U+1F90D WHITE HEART
🤎 - U+1F90E BROWN HEART
🧡 - U+1F9E1 ORANGE HEART
🧬 - U+1F9EC DNA DOUBLE HELIX
2022-09-17 03:57:44 +00:00
Tommaso Peduzzi
f547b9be7b PixelPaint: Scale layer and preserve aspect ratio
This patch adds the ability to scale a layer and
preserve the aspect ratio.
When the Shift key is pressed, the aspect ratio is preserved.
2022-09-16 22:53:07 +02:00
Tommaso Peduzzi
293ab2cdc9 PixelPaint: Add scaling function to move tool
This patch adds scaling function to the move tool.
When the cursor is over the lower right corner of the layer, it changes.
This is to signify that the layer can be scaled by dragging the mouse.

There is currently no preview of the scaling.
Doing a resize every time the mouse moves leads to unexpected behavior.
2022-09-16 22:53:07 +02:00
Tim Schumacher
77f124c87a Toolchain: Remove references to -lm 2022-09-16 16:09:19 +00:00
Tim Schumacher
a4f5a5d783 Meta: Remove the obsolete linter check for LibM/math.h 2022-09-16 16:09:19 +00:00
Tim Schumacher
ef9b543426 LibC: Remove the LibM interface target 2022-09-16 16:09:19 +00:00
Tim Schumacher
1b25c38b8b Everywhere: Fully remove the separate LibM directory 2022-09-16 16:09:19 +00:00
Tim Schumacher
bbcdd0dca0 Tests: Move the former LibM test into the LibC namespace 2022-09-16 16:09:19 +00:00
Tim Schumacher
81d46fa100 LibM: Move the math standard library to LibC 2022-09-16 16:09:19 +00:00
Andrew Kaster
eef989f9ed LibGPU: Don't use relative paths for libsoftgpu in Lagom environments
We can count on the dynamic loader for each platform, and the RPATH of
our build infrastrucuture, to load the lib up automagically.
2022-09-16 15:32:38 +02:00
Andrew Kaster
8ed5ed3ec0 LibGL: Make GL::create_context fallible
Propagate errors in places that are already set up to handle them, like
WebGLRenderingContext and the Tubes demo, and convert other callers
to using MUST.
2022-09-16 15:32:38 +02:00
Timothy Flynn
7e5080ea53 LibGUI: Load emoji icons for EmojiInputDialog through Gfx::Emoji
No difference when cold-loading the emoji icons, but for a warm load,
this provides a per-process cache of the loaded icons.
2022-09-16 15:20:59 +02:00
Timothy Flynn
98f99a9f7e LibGfx: Change Emoji::emoji_for_code_points to accept const code points
Span<u32 const> is the type used when converting a constant Vector<u32>
to a Span.
2022-09-16 15:20:59 +02:00
Timothy Flynn
35b74ebbfc LibGUI: Defer loading emoji icons until their first paint event
The EmojiInputDialog re-uses emoji buttons to help with performance as
filters are applied / removed. The downside of pre-creating the buttons
is that it currently takes upwards of 600ms (on my machine) to load all
emoji icons from disk at once. This will only become worse over time as
more emoji are added.

To alleviate this, defer loading the icons until they are needed for
painting (i.e. come into view).
2022-09-16 15:20:59 +02:00
Andreas Kling
cd7262ee56 LibWeb+LibWebView+WebContent: Add Web::Platform::ImageCodecPlugin
This replaces the previous Web::ImageDecoding::Decoder interface.
While we're doing this, also move the SerenityOS implementation of this
interface from LibWebView to WebContent. That means we no longer have to
link with LibImageDecoderClient in applications that use a web view.
2022-09-16 15:15:50 +02:00
Andreas Kling
412b2313f3 LibWeb: Improve inline flow around floating boxes
This patch combines a number of techniques to make inline content flow
more correctly around floats:

- During inline layout, BFC now lets LineBuilder decide the Y coordinate
  when inserting a new float. LineBuilder has more information about the
  currently accumulated line, and can make better breaking decisions.

- When inserting a float on one side, and the top of the newly inserted
  float is below the bottommost float on the opposite side, we now reset
  the opposite side back to the start of that edge. This improves
  breaking behavior between opposite-side floats.

- After inserting a float during inline layout, we now recalculate the
  available space on the line, but don't adjust X offsets of already
  existing fragments. This is handled by update_last_line() anyway,
  so it was pointless busywork.

- When measuring whether a line can fit at a given Y coordinate, we now
  consider both the top and bottom Y values of the line. This fixes an
  issue where the bottom part of a line would bleed over other content
  (since we had only checked that the top Y coordinate of that line
  would fit.)

There are some pretty brain-dead algorithms in here that we need to make
smarter, but I didn't want to complicate this any further so I've left
FIXMEs about them instead.
2022-09-16 15:15:50 +02:00
Andreas Kling
54e7359243 LibWeb: Repaint the page immediately when using the mouse to select
Otherwise we'd repaint the next time our "caret blink" timer would fire
(or something else caused a repaint). This made selection feel sluggish.
2022-09-16 15:15:50 +02:00
Enver Balalic
11a44ffb69 LibGfx: Recurse TrueType composite glyphs until a simple glyph is found
This fixes a bug in ladybird where it was crashing while rendering
characters like ščćž in the Noto Sans Regular font.

That font renders those characters as a composite where the caret
has numberOfContours = -1. When using the rasterize_impl simple path
for that, it would negatively overflow the offsets.
2022-09-16 14:52:03 +02:00
Liav A
e6306d459a Tests/Kernel: Add tests to ensure we don't regress InodeVMObjects 2022-09-16 14:55:45 +03:00
Liav A
0c675192c9 Kernel: Send SIGBUS to threads that use after valid Inode mmaped range
According to Dr. POSIX, we should allow to call mmap on inodes even on
ranges that currently don't map to any actual data. Trying to read or
write to those ranges should result in SIGBUS being sent to the thread
that did violating memory access.
2022-09-16 14:55:45 +03:00
Liav A
3ad0e1a1d5 Kernel: Handle mmap requests on zero-length data file inodes safely 2022-09-16 14:55:45 +03:00
Liav A
c88cc8557f Kernel/FileSystem: Make Inode::{write,read}_bytes methods non-virtual
We make these methods non-virtual because we want to ensure we properly
enforce locking of the m_inode_lock mutex. Also, for write operations,
we want to call prepare_to_write_data before the actual write. The
previous design required us to ensure the callers do that at various
places which lead to hard-to-find bugs. By moving everything to a place
where we call prepare_to_write_data only once, we eliminate a possibilty
of forgeting to call it on some code path in the kernel.
2022-09-16 14:55:45 +03:00