Commit graph

47356 commits

Author SHA1 Message Date
Aliaksandr Kalenik
8eeedce805 LibWeb: Consider transform property while finding containing block 2023-02-24 20:55:40 +01:00
Aliaksandr Kalenik
6092d81e4d LibWeb: Stop overflow clip box aggregation on reached stacking context 2023-02-24 20:55:40 +01:00
Aliaksandr Kalenik
87fa1c5e66 Revert "LibWeb: Fix clip of hidden overflow..."
This reverts commit eb1ef59603c13c43b87c099c43c4d118dc8441f6.

The idea of saving clip box to apply it to handle `overflow: hidden`
turned out to break painting if box is painted before it's containing
block (it is possible if box has negative z-index).
2023-02-24 20:55:40 +01:00
Liav A
8f3c343b88 Kernel+Userland: Unify declarations for KCOV in Kernel/API/kcov.h 2023-02-24 20:35:45 +01:00
Liav A
e7142c482a Kernel+Userland: Move prctl numbers header file to Kernel/API directory 2023-02-24 20:35:45 +01:00
Tim Ledbetter
d62c95d779 PixelPaint: Make "Add Mask" action fallible 2023-02-24 20:33:18 +01:00
Tim Ledbetter
b548a7b5ea PixelPaint: Make "Add Mask" action undoable 2023-02-24 20:33:18 +01:00
Tim Ledbetter
f1a792e6c9 PixelPaint: Save layer mask when adding to the UndoStack
This makes undoing actions performed on layer masks work as
expected.

did_modify_bitmap() is now also called on redo, to ensure the layer
mask is displayed correctly.
2023-02-24 20:33:18 +01:00
Timothy Flynn
34567bc145 LibGfx: Remove single-code point Font::glyph_or_emoji_width API
All callers are now aware of multi-code point emoji (and must remain so
going forward).
2023-02-24 20:28:23 +01:00
Timothy Flynn
16ec116133 LibGUI: Make Gfx- to text-positioning handle multi-code point glyphs 2023-02-24 20:28:23 +01:00
Timothy Flynn
36a495e87e LibGfx: Use non-emoji glyph width API to compute the width of a space 2023-02-24 20:28:23 +01:00
Timothy Flynn
8d0b0fbdd3 LibWeb: Make text fragment indexing handle multi-code point glyphs 2023-02-24 20:28:23 +01:00
Timothy Flynn
3d7b13ac03 LibWeb: Make canvas text preparation handle multi-code point glyphs 2023-02-24 20:28:23 +01:00
Rodrigo Tobar
cb04e4e9da LibPDF: Refactor *Font classes
The PDFFont class hierarchy was very simple (a top-level PDFFont class,
followed by all the children classes that derived directly from it).
While this design was good enough for some things, it didn't correctly
model the actual organization of font types:

 * PDF fonts are first divided between "simple" and "composite" fonts.
   The latter is the Type0 font, while the rest are all simple.
 * PDF fonts yield a glyph per "character code". Simple fonts char codes
   are always 1 byte long, while Type0 char codes are of variable size.

To this effect, this commit changes the hierarchy of Font classes,
introducing a new SimpleFont class, deriving from PDFFont, and acting as
the parent of Type1Font and TrueTypeFont, while Type0 still derives from
PDFFont directly. This distinction allows us now to:

 * Model string rendering differently from simple and composite fonts:
   PDFFont now offers a generic draw_string method that takes a whole
   string to be rendered instead of a single char code. SimpleFont
   implements this as a loop over individual bytes of the string, with
   T1 and TT implementing draw_glyph for drawing a single char code.
 * Some common fields between T1 and TT fonts now live under SimpleFont
   instead of under PDFfont, where they previously resided.
 * Some other interfaces specific to SimpleFont have been cleaned up,
   with u16/u32 not appearing on these classes (or in PDFFont) anymore.
 * Type0Font's rendering still remains unimplemented.

As part of this exercise I also took the chance to perform the following
cleanups and restructurings:

 * Refactored the creation and initialisation of fonts. They are all
   centrally created at PDFFont::create, with a virtual "initialize"
   method that allows them to initialise their inner members in the
   correct order (parent first, child later) after creation.
 * Removed duplicated code.
 * Cleaned up some public interfaces: receive const refs, removed
   unnecessary ctro/dtors, etc.
 * Slightly changed how Type1 and TrueType fonts are implemented: if
   there's an embedded font that takes priority, otherwise we always
   look for a replacement.
 * This means we don't do anything special for the standard fonts. The
   only behavior previously associated to standard fonts was choosing an
   encoding, and even that was under questioning.
2023-02-24 20:16:50 +01:00
Rodrigo Tobar
e8f1a2ef02 LibPDF: Add new error construction functions
These should make it easier to create specific errors, specially when
wanting to create a formatted message.
2023-02-24 20:16:50 +01:00
Rodrigo Tobar
db9fa7ff07 LibPDF: Allow show_text to return errors
Errors can (and do) occur when trying to render text, and so far we've
silently ignored them, making us think that all is well when it isn't.
Letting show_text return errors will allow us to inform the user about
these errors instead of having to hiding them.
2023-02-24 20:16:50 +01:00
Nico Weber
14c0bae704 LibGfx+Tests: Add test for webp ICC loading and fix bug
I drew the two webp files in Photoshop and saved them using the
"Save a Copy..." dialog, with ICC profile and all other boxes checked.

(I also tried saving with all the boxes unchecked, but it still wrote an
extended webp instead of a basic file.)

The lossless file exposed a bug: I didn't handle chunk padding
correctly before this patch.
2023-02-24 20:13:52 +01:00
Xexxa
7485521619 Base: Add more emoji
🧎 - U+1F9CE PERSON KNEELING
🧎‍♂️ - U+1F9CE U+200D U+2642 MAN KNEELING
🧎‍♀️ - U+1F9CE U+200D U+2640 WOMAN KNEELING
🏂 - U+1F3C2 SNOWBOARDER
🥡 - U+1F961 TAKEOUT BOX
🚇 - U+1F687 METRO
🥎 - U+1F94E SOFTBALL
2023-02-24 19:49:40 +01:00
Timothy Flynn
8be43cd3bf LibGfx: Use LibUnicode to filter code points that cannot start an emoji 2023-02-24 19:48:47 +01:00
Timothy Flynn
392c8c99aa LibGfx: Use the paths to emoji images generated alongside emoji data
Rather than formatting the paths at runtime, as vformat is quite heavy
in a profile.
2023-02-24 19:48:47 +01:00
Timothy Flynn
1484d3d9f5 LibUnicode: Add a method to check if a code point could start an emoji 2023-02-24 19:48:47 +01:00
Timothy Flynn
8c38d46c1a LibUnicode: Generate the path to emoji images alongside emoji data
This will provide for quicker emoji lookups, rather than having to
discover and allocate these paths at runtime before we find out if they
even exist.
2023-02-24 19:48:47 +01:00
Timothy Flynn
4212010ebd Base: Add a trailing newline to emoji-serenity.txt
We currently aren't parsing the last line of emoji-serenity.txt because
Core::Stream does not think the last line is readable. We should, of
course, fix Core::Stream. But keeping a trailing newline here is nice
anyways.
2023-02-24 19:48:47 +01:00
Nico Weber
f5063fe7ec file: Add a description for the image/webp mime type 2023-02-24 19:44:20 +01:00
Nico Weber
f7e152d049 LibGfx: Add scaffolding for a webp decoder
At the moment, this processes the RIFF chunk structure and extracts
the ICCP chunk, so that `icc` can now print ICC profiles embedded
in webp files. (And are image files really more than containers
of icc profiles?)

It doesn't even decode image dimensions yet.

The lossy format is a VP8 video frame. Once we get to that, we
might want to move all the image decoders into a new LibImageDecoders
that depends on both LibGfx and LibVideo. (Other newer image formats
like heic and av1f also use video frames for image data.)
2023-02-24 19:44:20 +01:00
Nico Weber
4bf639b635 LibGfx: Drop tags of unknown type instead of writing invalid icc files
We could make UnknownTagData hold on to undecoded, raw input data and
write that back out when serializing. But for now, we don't.

On the flipside, this _does_ write unknown tags that have known types.
We could have a mode where we drop unknown tags with known types.
But for now, we don't have that either.

With this, we can for example reencode
/Library/ColorSync/Profiles/WebSafeColors.icc and icc (and other
tools) can dump the output icc file. The 'ncpi' tag with type 'ncpi'
is dropped while writing it, while the unknown tag 'dscm' with
known type 'mluc' is written to the output. (That file is a v2 file,
so 'desc' has to have type 'desc' instead of type 'mluc' which
it would have in v4 files -- 'dscm' emulates an 'mluc' description
in v2 files.)
2023-02-24 19:42:00 +01:00
Kenneth Myhra
fa1ba7fadf LibWeb: Mark JS::Promise* return value for digest() with JS::NNGCPtr 2023-02-24 19:24:39 +01:00
Kenneth Myhra
f783af05ed LibWeb: Port SubtleCrypto to new String
The algorithm comparison in digest() is done using a StringView to avoid
complex error handling and promise rejection.
2023-02-24 19:24:39 +01:00
Kenneth Myhra
a8cef1fa06 LibWeb: Port Crypto to new String 2023-02-24 19:24:39 +01:00
Kenneth Myhra
450ffbe612 Ports: Update curl to 7.88.1 2023-02-24 19:20:53 +01:00
Nico Weber
b161f5ea05 LibGfx: Make ICC reader check that profile size is a multiple of 4
With this, I would've found e8bd067ce5 earlier.

(If this turns out to be too strict in practice, we can always relax
it again.)
2023-02-24 19:17:20 +01:00
timre13
d7f348ab50 VideoPlayer: Add button and menu item to toggle fullscreen
Add a button to the bottom toolbar and a menu item to toggle fullscreen.
Also implement toggling fullscreen mode by double-clicking the video.
2023-02-24 19:16:46 +01:00
Andreas Kling
1379720742 Ladybird: Consider HTTP response a success if it has a status code
The QNetworkReply::NetworkError enum mixes all kinds of errors into one
enum, HTTP errors, network errors, proxy errors, etc.

Instead of caring about it, we now say that HTTP requests were
successful if their response has any HTTP status code attached.

This allows LibWeb to display error pages when using Qt networking.
2023-02-24 19:15:49 +01:00
Andreas Kling
3435820e1f LibWeb: Render HTML content if present for HTTP error pages
If an HTTP response fails with an error code (e.g 403) but still has
body content, we now render the content.

We only fall back to our own built-in error page if there's no body.
2023-02-24 19:15:49 +01:00
Itamar
47f5a3ea9a HackStudio: Add 'pause debuggee' button
This button sends a SIGSTOP to the debugged process, which pauses it.
The debuggee can be resumed with the 'continue' button.
2023-02-24 19:09:27 +01:00
Itamar
91224d47d2 SystemMonitor: Add "Debug In HackStudio" action to process context menu
This action launches HackStudio with its debugger attached to the
selected process.
2023-02-24 19:09:27 +01:00
Itamar
6e5b1f5819 HackStudio: Add progress bar to Debugger initialization
During Debugger initialization, most of the time is spent creating
DebugInfo objects for the libraries that the program has loaded.
2023-02-24 19:09:27 +01:00
Itamar
0896c03744 HackStudio: Add commandline option to debug a running process 2023-02-24 19:09:27 +01:00
Itamar
58c4fe52d4 HackStudio: Fix event loop usage in debugger callbacks
These callbacks are called from a different thread than the UI thread,
so we need to explicitly use the Application's event loop to perform GUI
logic.
2023-02-24 19:09:27 +01:00
Itamar
ff6fb2cb10 HackStudio: Add ability to attach debugger to a running process 2023-02-24 19:09:27 +01:00
Itamar
eb16513165 LibDebug: Remove file path fixup for library sources
It's no longer needed as the file paths we get for libraries in the
current build process is canonical.
2023-02-24 19:09:27 +01:00
Andrew Kaster
35b07048ef CI: Make sure to brew update in macOS Azure setup
This picks up any upstream brew changes that haven't been pulled into
the default Azure VMs. For example, the ffmpeg dependency of qt is
currently broken in the 8 day old brew commit they are using.
2023-02-24 02:39:26 -07:00
Andrew Kaster
1b24fa5829 CI+Lagom: Use the same options for running test-wasm in ctest and CI
Make sure that we set SERENITY_SOURCE_DIR in ctest, and make sure to
pass the test root to the CI job.

More overhaul of test-js 'test root' finding is needed however.
2023-02-24 00:02:25 -07:00
Sam Atkins
0fb6f87d49 LibWeb: Add spec link to border-width: thin/medium/thick definitions
In the latest backgrounds-3 spec, these have official fixed values. :^)
2023-02-23 16:20:44 +00:00
Kenneth Myhra
e905f25911 LibWeb: Port Worker to new String 2023-02-23 15:48:38 +00:00
Kenneth Myhra
836cb73d29 BindingsGenerator: Release value setting members of dictionary
When a constructor has an optional dictionary as argument, and those
members are of type new string, make sure that we release_value()
setting the dictionary members.
2023-02-23 15:48:38 +00:00
Kenneth Myhra
98ef76b144 BindingsGenerator: Pass optional values as 'sv' to String::from_utf8()
Pass optional values as StringView to String::from_utf8(), otherwise
this would not compile.
2023-02-23 15:48:38 +00:00
Kenneth Myhra
be727ea871 LibWeb: Port WorkerGlobalScope to new String 2023-02-23 15:48:38 +00:00
Kenneth Myhra
9c5bdb0b86 LibWeb: Port WorkerLocation to new String 2023-02-23 15:48:38 +00:00
Kenneth Myhra
511ce240f2 BindingsGenerator: Allow stringifier to return DOMException if needed 2023-02-23 15:48:38 +00:00