Commit graph

53064 commits

Author SHA1 Message Date
Torstennator
df4904f61d PixelPaint: Use editing masks in filter gallery
With this change the image modifications of a filter is only applied to
regions of the image where a editing mask is defined. If no editing
mask is defined the filter modifications are applied to the whole
image.
2023-08-04 12:11:13 +02:00
Torstennator
dbbf54df2c PixelPaint: Add luminosity masking for editing masks
This adds a function where editing masks can be refined by selecting
a luminosity range that is applied to the content image and mapped to
the editing mask. This function allows the editing of image regions
that match only certain luminosity values.
2023-08-04 12:11:13 +02:00
Torstennator
660d6f171c PixelPaint: Add function to visualize editing-masks
This patch adds a function to make the editing-eask visible while
beeing in mask-mode so that the user can see which parts are covered
by the masks and can therefore be modified by other tools that support
editing masks.
2023-08-04 12:11:13 +02:00
Torstennator
69650a5812 LibGUI: Add new RangeSlider widget
A new widget that allows the selection of a range between a defined min
and max value.
2023-08-04 12:11:13 +02:00
Ali Mohammad Pur
da7bf5f785 Shell: Add support for the '!' POSIX pipeline prefix
This prefix simply inverts the exit code of the pipeline, which we
implement using the 'not' builtin.
2023-08-04 13:28:59 +03:30
Ali Mohammad Pur
b6d7c5fb0e Shell: Correctly track nested expansions in POSIX mode
Previously any expansion closing sequence would've caused the entire
expansion chain to be terminated, fix this by keeping track of active
expansions and running the parser in 'skip' mode.

Fixes #19110.
2023-08-04 13:28:59 +03:30
Karol Kosek
d1f98108a9 Meta: Add ImageFormats/JPEGWriter.cpp to gn build 2023-08-04 11:05:55 +02:00
Karol Kosek
68ef7dba70 LibWeb: Add support for encoding Canvas to JPEG 2023-08-04 11:05:55 +02:00
Karol Kosek
b731705fec LibWeb: Implement HTMLCanvasElement.toBlob() 2023-08-04 11:05:55 +02:00
Karol Kosek
3239f0fb7b LibWeb: Implement HTMLCanvasElement.toDataURL() closer to spec
- Requesting an unsupported image type will now fallback to PNG
  (which is now always the case),
- Errors should return 'data:,' instead of empty string,
- Added spec comments
2023-08-04 11:05:55 +02:00
Jelle Raaijmakers
55af4addc8 CI: Disable aarch64 tests
For some reason, the tests are flaky for the aarch64 architecture when
running on a CI runner. This causes a lot of unnecessary red crosses for
PRs and since the test outcome doesn't seem to be too trustworthy, we
are better off not running these tests for now.
2023-08-04 10:27:03 +02:00
Andreas Kling
b6d9b3e886 Meta: Update maintainer list in CONTRIBUTING.md 2023-08-04 09:59:09 +02:00
Zaggy1024
a112e2f8c5 LibAudio: Add a seek point at the first sample in MP3Loader
A previous commit made it so that SeekTable doesn't provide a seek
point from `seek_point_before()` if there is not a seek point before
the requested sample index. However, MP3Loader was only setting a seek
point after the first 10 frames, meaning that it would do nothing when
seeking back to 0.

To fix this, add a seek point at byte 0 for the first sample, so that
`seek_point_before()` will never fail.
2023-08-04 08:53:19 +01:00
Andreas Kling
cf9565551a LibWeb: Don't filter CSS rules into separate list based on @namespace
Instead, perform the filtering for each rule as we go. This avoids
creating a separate list of rules, which was ~5% of runtime when
mousing around on the Discord web interface.
2023-08-04 05:28:41 +02:00
Andreas Kling
bb39ca9b4a LibWeb: Add fast_is<SVGGraphicsElement>()
This dynamic_cast was ~6% of runtime when mousing around on Discord.
2023-08-04 05:28:41 +02:00
Andreas Kling
37a618b7ad LibWeb: Add missing visit in CSSStyleSheet::visit_edges()
Gotta visit m_default_namespace_rule.
2023-08-04 05:28:41 +02:00
Tim Ledbetter
d0fd925126 watch: Use alternate buffer to display output 2023-08-04 05:25:44 +02:00
Tim Ledbetter
ba1c4bc1d1 watch: Use stdout rather than stderr to display output
Previously, the header was printed to stderr.

This matches the behavior of watch on Linux.
2023-08-04 05:25:44 +02:00
Tim Ledbetter
2f3c41e033 watch: Replace LibC function calls with their LibCore equivalents 2023-08-04 05:25:44 +02:00
Bastiaan van der Plaat
958c79da64 LibWeb: Don't clear clip rect history but restore previous state 2023-08-03 20:08:53 +01:00
Bastiaan van der Plaat
9469531100 LibWeb: Convert text_indent css pixels to device pixels 2023-08-03 20:08:53 +01:00
Bastiaan van der Plaat
148d74b103 LibWeb: Use CSS text-indent property on input type="submit" elements 2023-08-03 20:08:53 +01:00
Sebastian Zaha
a89e95f57c Meta: Port GCC compile option from cmake to gn
The GCC build is extremely noisy without -Wno-literal-suffix. (Tested on
 GCC12)
2023-08-03 09:52:54 -06:00
Aliaksandr Kalenik
1e953f2acc LibWeb: Reset planned_increase while distributing space to "fr" tracks
Fixes bug when planned_increase is not reset after adding it to
base_size.
2023-08-03 17:05:57 +02:00
Sergey Bugaev
f0a5276063 LibWebView: Create BGRA bitmaps instead of BGRx
This helps the GTK version of Ladybird to import them into the GTK
rendering machinery, since GdkMemoryFormat supports BGRA and BGR, but
not BGRx.
2023-08-03 15:49:47 +01:00
MacDue
abd53a8719 Ladybird: Use AK::Url rather than prefix list to check if URL is valid
If a URL is not valid we try navigating to https:// + the url. It's
better to ask AK::Url if it thinks the url is valid than put a big list
of prefixes here, with this obscure protocols like Gemini are now
recognised and with `--enable-lagom-networking` can be viewed in
Ladybird (thanks to #2218).
2023-08-03 15:02:47 +02:00
Niklas Poslovski
6ea4be36b5 LibCore: Fallback to fstat() on systems without d_type support 2023-08-03 12:25:07 +01:00
Andreas Kling
4011a107a4 LibWeb: Propagate overflow modes from <html> or <body> to viewport
This patch implements "Overflow Viewport Propagation" from CSS-OVERFLOW.
It fixes an issue where many websites were not scrollable because they
had `overflow: scroll` on the body element and we didn't propagate it.
2023-08-03 13:21:26 +02:00
Andreas Kling
09eed8eea2 LibWeb+headless-browser: Include paint tree in layout test output
This will give us a more comprehensive look at what actually gets
rendered in the end, and also allows us to catch more behavior changes.
2023-08-03 13:21:26 +02:00
Andrew Kaster
7d7c419ce6 Ladybird: Add WebSocket server for use by Lagom networking
Hide its use behind the same flag as RequestServer in WebContent.
2023-08-03 09:55:20 +02:00
Andrew Kaster
dd694215bc LibWebView+LibProtocol: Allow app to pass custom WebSocketClients 2023-08-03 09:55:20 +02:00
Andrew Kaster
a1e5a6ac40 Ladybird: Remove Qt dependency from RequestServer
This requires two parts: Core::System::current_executable_path(), and
passing the serenity-resource-root as an argument to the process.
2023-08-03 09:55:20 +02:00
Andrew Kaster
bb831a27dd LibCore: Add Core::System::current_executable_path()
This is based on Jakt::File::current_executable_path() and all the other
sources I looked at to figure out the per-platform way to do this. My
goodness, every platform has its own bespoke way.
2023-08-03 09:55:20 +02:00
Andrew Kaster
88ccaae11e Ladybird: Rename classes ending with Ladybird
Now that all the classes for Ladybird are in the Ladybird namespace, we
don't need them named as Ladybird::FooBarLadybird. For the Qt-specific
classes, we can tack on a Qt at the end for clarity, but FontPlugin and
ImageCodecPlugin no longer have anything to do with Qt.
2023-08-03 09:55:20 +02:00
Andrew Kaster
506b03740c Ladybird: Move classes and types into the Ladybird namespace
We were super inconsistent about this, with most "new" classes living in
the Ladybird namespace, while "old" ones were in the global namespace,
or even sitting in the Browser namespace.
2023-08-03 09:55:20 +02:00
Sam Atkins
73fa58da34 LibWeb: Implement the CSS outline-offset property
This allows you to push the outline a certain distance away from the
border (or inside it, if the offset is negative).
2023-08-03 05:25:48 +02:00
Sam Atkins
fe7e797483 LibWeb: Implement the CSS outline property :^)
...along with `outline-color`, `outline-style`, and `outline-width`.

This re-uses the existing border-painting code, which seems to work well
enough!

This replaces the previous code for drawing focus-outlines, with generic
outline painting for any elements that want it. Focus outlines are now
instead supported by this code in Default.css:

```css
:focus-visible {
    outline: auto;
}
```
2023-08-03 05:25:48 +02:00
Sam Atkins
5640779838 LibWeb: Allow single-value shorthand properties to parse as CompositeSV
Don't give up if we can't parse that single value for the property
directly, but let the parsing code carry on and see if we can produce a
CompositeStyleValue.
2023-08-03 05:25:48 +02:00
Sam Atkins
d98bc0da87 LibWeb: Make it clearer that several line-styles are not implemented 2023-08-03 05:25:48 +02:00
Sam Atkins
14e6bae593 LibWeb: Implement the :focus-visible pseudo-class
This is very naive for now, and matches whenever `:focus` does.
2023-08-03 05:25:48 +02:00
Sam Atkins
8520afaa11 LibWeb: Rename PaintPhase::FocusOutline -> Outline
Any element can have an outline, whether because of focus or not.
2023-08-03 05:25:48 +02:00
Andreas Kling
9e5c7abd94 LibGfx/OpenType: Return metrics from hmtx even if there is no glyf entry
This fixes an issue with some typefaces where the space character has an
advance width, but no glyf entry (and thus no ascent/descent). Before
this change, we'd render whitespace with zero advance in such cases.
2023-08-02 19:22:36 +02:00
Timothy Flynn
58e3b8cf58 Ladybird: Ensure RequestServer depends on its generated sources
Ladybird's RequestServer needs to depend on its generated IPC header
files to ensure they are generated before RequestServer is compiled,
which we currently bundle into LibWebView.
2023-08-02 12:35:05 -04:00
Karol Kosek
5b1aa2d55e LibWeb: Don't collapse boxes with CSS clear property set
I'm not sure if this is exactly correct, the link to CSS2 spec above
says something that clearance cannot separate boxes, but I'm not sure if
I understood it correctly or if I've done it in the right place.

However, this change fixes our block-and-inline/clearfix.html test again
(was regressed in previous commit).
2023-08-02 17:35:54 +02:00
Karol Kosek
142d498f14 LibWeb: Include anonymous boxes with no lines into computing BFC height
Pseudo-elements like ::before and ::after were discarded when their
content property was an empty string (ignoring whitespace), because they
are anonymous containers with no lines.

Our previous way around it was to add an empty line box (see b062a0fb7c)
however it didn't actually work for cases described in the previous
commit.

This makes avatars and cover arts square on last.fm and "fixes" the test
css-pseudo-element-should-not-be-affected-by-presentational-hints.html.
Unfortunately, this also regresses on block-and-inline/clearfix.html,
but that hopefully will be handled in subsequent commit.
2023-08-02 17:35:54 +02:00
Karol Kosek
d4b5205482 Revert "LibWeb: Make TextNode::ChunkIterator emit an empty chunk for content:"""
This reverts commit b062a0fb7c.

This made a calculation of pseudo-elements' height incorrect when they
had `height` set to `auto` and used other techniques (like setting
`padding-top`) to set height, as it was now also adding an empty line.

Additionally, the case didn't work for content containing whitespace
characters, so a pseudo-element with `content: " "` didn't have *this*
particular problem.
2023-08-02 17:35:54 +02:00
Kenneth Myhra
cf2c2cb4d7 LibWeb: Make sure we fallback to "Unsupported type" if type unrecognized
If we do not recognize the Type being serialized make sure we always
fallback to setting m_error to "Unsupported type".
2023-08-02 14:52:37 +02:00
Linus Groh
d923c2dd1b Base: Add a quote to the fortunes database 2023-08-02 13:08:59 +01:00
Sam Atkins
5cf6d51753 LibWeb: Reformat inconsistent CSS JSON files
Mostly this is about 2-space indentation, but we now also only have one
key:value pair per line.
2023-08-02 12:49:46 +01:00
Tobias Christiansen
aabdb6a801 LibWeb: Make the linter happy in Properties.json
There was a space missing and the linter complained.
2023-08-02 11:35:57 +01:00