Commit graph

62914 commits

Author SHA1 Message Date
Andrew Kaster
1bf4a225bd Meta: Add swift-format configuration 2024-07-30 18:38:02 -06:00
Andrew Kaster
cf42bf2bca LibGfx: Factor out #rrggbb Color parsing into its own helper function 2024-07-30 18:38:02 -06:00
Diego Frias
3c5e3eef10 LibWeb: No longer return undefined on null table entry in Wasm API
Return `null` instead, as per the specification.
2024-07-30 23:43:44 +02:00
Ali Mohammad Pur
93216a875e RequestServer: Actually hold on to the preload job until it's done
This was some nonsense code left in by mistake, ref commit:
4211639e45

Fixes #904.
2024-07-30 12:03:30 -04:00
Bastiaan van der Plaat
b445b907a1 Ladybird: Update macOS app iconset 2024-07-30 12:38:44 +02:00
Sam Atkins
7daf5cdaff LibWeb: Invalidate layout if pseudo-element style changes
Pseudo-elements' style is only computed while building the layout tree.
This meant that previously, they would not have their style recomputed
in some cases. (Such as when :hover is applied to an ancestor.)

Now, when recomputing an element's style, we also return a full
invalidation if one or more pseudo-elements would exist either before or
after style recomputation.

This heuristic produces some false positives, but no false negatives.
Because pseudo-elements' style is computed during layout building, any
computation done here is then thrown away. So this approach minimises
the amount of wasted style computation. Plus it's simple, until we have
data on what approach would be faster.

This fixes the Acid2 nose becoming blue when the .nose div is hovered.
2024-07-30 09:45:45 +02:00
Sam Atkins
f23f0721bd LibWeb: Combine Element's pseudo-element data together
Rather than maintain two dynamically-allocated arrays of data for
pseudo-elements, put them in a single array, which is easier to manage.
2024-07-30 09:45:45 +02:00
Aliaksandr Kalenik
2c0f03f5b6 LibWeb: Delete BlitCornerClipping display list command
Contrary to LibGfx, where corner clipping was implemented by sampling
and blitting pixels under corners into a temporary bitmap, Skia allows
us to simply apply a mask. As a result, we no longer need the
BlitCornerClipping command, which has become a no-op.

- SampleUnderCorners is renamed to AddRoundedRectClip
- The optimization that skipped unnecessary blit and sample commands has
  been removed. However, this should not result in a performance
  regression because Skia seems to perform mask rasterization lazily.
2024-07-30 09:43:43 +02:00
Aliaksandr Kalenik
333c9270b1 LibWeb: Simplify outer box shadow's bounding box calculation
There is no need in the overly complicated OuterBoxShadowMetrics after
switching to use Skia for painting.
2024-07-30 09:43:20 +02:00
Timothy Flynn
4f5604c7db WebContent: Ignore invalid attributes set via the Inspector
Rather than crash, just ignore these values for now. We should invent a
mechanism to send feedback to the user (perhaps via the JS console).
2024-07-30 09:41:35 +02:00
Timothy Flynn
93f2af38b1 LibWebView: Escape HTML entities in attribute names
Otherwise, we can embed invalid HTML in the Inspector web view.
2024-07-30 09:41:35 +02:00
Timothy Flynn
657bbd1542 LibWeb: Append attributes to the correct element
The spec indicates we should append attributes to the top element of the
stack of open elements. We were appending the attribute to the bottom.
2024-07-30 09:41:35 +02:00
Timothy Flynn
9fe35ddddf LibWeb: Use an infallible method to add attributes to nodes
In the HTML parser spec, there are 2 instances of the following text:

    add the attribute and its corresponding value to that element

The "add the attribute" text does not have a corresponding spec link to
actually specify what to do. We currently use `set_attribute`, which can
throw an exception if the attribute name contains an invalid character
(such as '<'). Instead, switch to `append_attribute`, which allows such
attribute names. This behavior matches Firefox.

Note we cannot yet make the unclosed-html-element.html test match the
expectations of the unclosed-body-element.html due to another bug that
would prevent checking if the expected element has the right attribute.
That will be fixed in an upcoming commit.
2024-07-30 09:41:35 +02:00
Timothy Flynn
c1b0e180ba LibWebView: Insert line numbers before each line in about:srcdoc
The behavior chosen here (fixed-width counters, alignment, etc.) matches
Firefox.
2024-07-29 18:27:16 +01:00
Sam Atkins
5abe246385 LibWeb/CSS: Treat counters() function with 1 argument as invalid
Fixes #887.
2024-07-29 12:57:43 -04:00
Aliaksandr Kalenik
0bfcf73524 LibWeb: Inline apply_backdrop_filter function into paint_backdrop_filter
No need to have a separate file for this small function.
2024-07-29 17:48:56 +02:00
Aliaksandr Kalenik
8164be7ac8 LibWeb: Delete create_gfx_paint_style() for SVG gradients
No longer used after switching to Skia.
2024-07-29 16:25:05 +01:00
Sam Atkins
2a55ab13ef LibWeb: Update DOMStringList to match PlatformObject changes
- is_supported_property_index() no longer needs to be overridden
- item_value() now returns Optional
2024-07-29 11:17:05 +01:00
Sam Atkins
06484d0663 UI/Qt: Manually paint the tab-bar background where the "add" button was
The TabBar itself does not stretch the entire width of the TabWidget,
because it leaves space for the width of the new-tab button. So, we
manually tell Qt to paint the TabBar's background into the gap.

Fixes #768.
2024-07-29 12:02:02 +02:00
Sam Atkins
e17362ab79 UI/Qt: Make TabWidget responsible for new-tab button positioning
Makes use of the fact that QTabWidget automatically reserves space
for "corner widgets", and gives us the ability to override their
location with a custom style.

Also, determine the height of the new-tab button using the height of the
tab bar, instead of a hard-coded 32px which was too tall on MacOS.
2024-07-29 12:02:02 +02:00
Jamie Mansfield
75216182c9 LibWeb: Implement DOMStringList 2024-07-29 11:19:00 +02:00
Aliaksandr Kalenik
aa08e52548 LibWeb/Painting: Delete unused LinearGradientData.h 2024-07-29 11:17:55 +02:00
Andreas Kling
627dcb90bd Meta: Update CONTRIBUTING.md for the new era
- Explain project governance (now driven by the non-profit).
- Amend human language policy to keep language neutral & professional.
- Expand on the project's neutrality in detail.
- Clarify policy on rejection of bad-faith issues/PRs.
2024-07-29 11:11:48 +02:00
sideshowbarker
634b035898 Documentation: Add guidance on X11R6 linking warning message 2024-07-28 23:45:27 -06:00
circl
0af92e05d8 Documentation: Clean up some parts of the build instructions 2024-07-28 20:45:25 -06:00
bbb651
014a069157 WebAudio: Stub remainder of AudioBufferSourceNode 2024-07-28 21:41:15 +02:00
bbb651
779e3072f9 WebAudio: Stub AudioDestinationContext
And expose it through `BaseAudioContext::destination`
2024-07-28 21:41:15 +02:00
bbb651
9c17398429 WebAudio: Import AudioNode directly in GainNode 2024-07-28 21:41:15 +02:00
bbb651
150cef62a0 WebAudio: BiquadFilterNode: Implement AudioParams and stub rest 2024-07-28 21:41:15 +02:00
bbb651
6d33cc2b3a WebAudio: Stub/implement more of AudioNode 2024-07-28 21:41:15 +02:00
Tim Ledbetter
354e5a6624 LibWeb: Set correct prototype for WorkerLocation 2024-07-28 21:40:30 +02:00
doctortheemh
7f40a19c71 LibWeb: Fix some typos with text clips
While working on this section of code, I noticed some older names were
still being used. This just brings them up to date and fixes a couple
moves.
2024-07-28 13:45:40 +02:00
Ali Mohammad Pur
4211639e45 RequestServer+LibHTTP: Cancel requests on client exit
That usually happens in "exceptional" states when the client exits
unexpectedly (crash, force quit mid-load, etc), leading to the job flush
timer firing and attempting to write to a nonexistent object (the
client).

This commit makes RS simply cancel such jobs; cancelled jobs in this
state simply go away instead of sending notifications around.
2024-07-28 13:02:49 +02:00
Diego Frias
41dc58f702 LibWasm: Remove unused ParseError variant 2024-07-28 13:02:36 +02:00
Diego Frias
9800ef6047 LibWasm: Introduce TRY_READ for parser
Convenience macro akin to `TRY` for reading from a stream.
2024-07-28 13:02:36 +02:00
Diego Frias
dc52998341 LibWasm: Remove Module::functions
`Module::functions` created clones of all of the functions in the
module. It provided a _slightly_ better API, but ended up costing around
40ms when instantiating spidermonkey.
2024-07-28 02:56:32 +02:00
Tim Ledbetter
2d95cc01dc UI/Qt: Don't save size and location of popup windows on exit 2024-07-28 00:54:50 +01:00
Ángel Carias
9624e0d2a2 LibWeb/DOM: Implement Node.lookupPrefix
Adds https://dom.spec.whatwg.org/#dom-node-lookupprefix
2024-07-28 00:51:55 +01:00
Sam Atkins
9e32c9329a LibWeb: Reserve enough space for span>1 columns in BorderConflictFinder
This code previously only allocated enough space in
m_col_elements_by_index for 1 slot per column, meaning that columns
with a span > 1 would write off the end of it.
2024-07-27 20:23:14 +01:00
Sam Atkins
0cec68ea99 LibWeb: Correct logic for removing end nodes from HTMLOptionsCollection
This test case would previously crash.

Found with domato.
2024-07-27 20:23:14 +01:00
Aliaksandr Kalenik
f61e54b10c LibGfx: Remove code responsible for glyph rasterization
No longer needed after switching to Skia.
2024-07-27 18:37:40 +01:00
Diego Frias
a168bec7ef AK/SIMDExtras: Fix masking logic in shuffle_or_0 2024-07-27 15:02:37 +02:00
Diego Frias
48f1861ce9 Meta: No longer ignore test-wasm results during testing
Since the Wasm runtime should be fully spec-compliant, we want to make
sure that the spec-tests always pass.
2024-07-27 15:02:37 +02:00
Sam Atkins
6ae2b8c3d9 LibWeb/CSS: Parse custom-idents more consistently
These have a few rules that we didn't follow in most cases:
- CSS-wide keywords are not allowed. (inherit, initial, etc)
- `default` is not allowed.
- The above and any other disallowed identifiers must be tested
  case-insensitively.

This introduces a `parse_custom_ident_value()` method, which takes a
list of disallowed identifier names, and handles the above rules.
2024-07-27 14:45:33 +02:00
Ali Mohammad Pur
d3f089dc26 Utilities/js: Make it possible to exit via two consecutive ^C's
Apparently this is common in the js repl world.
Fixes #743.
2024-07-27 11:49:45 +01:00
Diego Frias
a6ebd100ec AK/LEB128: Speed up reading unsigned LEB128 values
Unroll the first byte as a fast path, and remove a branch. This speeds
up the instantiation of spidermonkey by 10ms.
2024-07-27 08:19:51 +02:00
Diego Frias
fc57f5111d LibWasm: Remove needless and costly copies
Speeds up spidermonkey.wasm instantiation by around 60ms (240ms -> 180ms)
2024-07-27 08:19:51 +02:00
Diego Frias
2192c149e2 LibWasm: Stop using ConstrainedStream for function parsing
Speeds up spidermonkey.wasm instantiation by around 20ms (260ms -> 240ms)
2024-07-27 08:19:51 +02:00
Diego Frias
5cde327d46 LibWasm: Provide size hint when parsing instructions into a vector
Speeds up spidermonkey.wasm instantiation by around 20ms (280ms -> 260ms)
2024-07-27 08:19:51 +02:00
Aliaksandr Kalenik
1bd0871ed8 LibWeb+LibGfx: Use Skia for text rasterization
The main incentive is much better performance. We could have gone a bit
further in optimizing the Skia painter to blit glyphs produced by LibGfx
more efficiently from the glyph atlas, but eventually, we also want Skia
to improve correctness.

This change does not completely replace LibGfx in text handling. It's
still used at all stages, including layout, up until display list
replaying.
2024-07-27 08:18:54 +02:00