Commit graph

61982 commits

Author SHA1 Message Date
Matthew Olsson fa46393e27 LibWeb: Do not clamp the output of the cubic bezier timing function
It is fine for timing function to be outside of the range [0, 1]

(cherry picked from commit 7925efda5fbc755b3fff00dcbba301fe4f8bc1c9)
2024-06-27 13:44:46 +02:00
Matthew Olsson ae4c5512af LibWeb: Prevent overrunning loop bounds in cubic bezier calculation
(cherry picked from commit 7f902fa2dc787bd1212d977babf7ea9eedd328f0)
2024-06-27 13:44:46 +02:00
Matthew Olsson 3434572089 LibWeb: Correct observable property access order in KeyframeEffect
Apparently these are supposed to be accessed in alphabetical order

(cherry picked from commit 31618abf151180391720ba527541cca86190cc3e)
2024-06-27 13:44:46 +02:00
Matthew Olsson e8034cb476 LibWeb: Only read enumerable keyframe properties
(cherry picked from commit c85f00e373405623ecd255c36ba63c907b44de86)
2024-06-27 13:44:46 +02:00
Tim Ledbetter 1d47886430 Tests/LibWeb: Wait until document fully loaded before simulating click
This makes the `form-image-submission.html` test pass more reliably.

(cherry picked from commit 2fed064791d3117e0571453210000d285ee9359c)
2024-06-27 13:42:20 +02:00
Simon Wanner 92600b3171 LibTextCodec: Use generated lookup tables for all single byte decoders
(cherry picked from commit 0ab4722cee11d27da79bb05c1d53693f39938cf6)
2024-06-27 00:27:56 +02:00
Simon Wanner c90963161e LibTextCodec: Fix ISO-8859-1 vs. windows-1252 handling in web contexts
The Encoding specification maps ISO-8859-1 to windows-1252 and expects
the windows-1252 translation table to be used, which differs from
ISO-8859-1 for 0x80-0x9F.

Other contexts expect to get the actual ISO-8859-1 encoding, with 1-to-1
mapping to U+0000-U+00FF, when requesting it.

`decoder_for_exact_name` is introduced, which skips the mapping from
aliases to the encoding name done by `get_standardized_encoding`.

(cherry picked from commit 6b2c4599017f512279cb26c0d3c48aa5a9453007)
2024-06-27 00:27:56 +02:00
Simon Wanner dc2e64c5b0 LibTextCodec: Fix some incorrect encoding aliases
(cherry picked from commit 46d5cf0443a7061bd7a8a9e495c3f3ee54614f1e)
2024-06-27 00:27:56 +02:00
Simon Wanner 328552a269 LibTextCodec: Bring TextCodec::get_standardized_encoding closer to spec
(cherry picked from commit 09f2d79cb10f84dfaedea61264d8a9d91bdfa17c)
2024-06-27 00:27:56 +02:00
Simon Wanner 30609289b5 LibWeb: Bring TextDecoder constructor closer to spec
(cherry picked from commit 987910ad0f9978a9a618d13b3e1d299a81ce4906)
2024-06-27 00:27:56 +02:00
circl 98a5fff68b LibWeb: Restrict fetching file: and resource: URLs to internal pages
They are now blocked on pages which:
- Don't have an opaque origin (should be only user-initiated or about:)
- Aren't other file: pages
- Aren't other resource: pages

(cherry picked from commit 1f3285eb0410ff5c902e148932205d9e4b7fbd9b)
2024-06-26 23:11:35 +02:00
circl 8287790913 LibWeb: Consider resource: URLs to be trustworthy and non-opaque
This makes icons once again load in the directory listings

(cherry picked from commit d14888f31a8378f319efa18028083ff605105101)
2024-06-26 23:11:35 +02:00
Enver Balalic 18d589c520 LibWeb: Implement HTMLImageElement::decode with a few FIXMEs
Implements enough of HTMLImageElement::decode for it to not break
websites and actually load an image :)

(cherry picked from commit 862fc91b2cf9bee9b7f180cdf930c6c99b5dd053)
2024-06-26 23:09:54 +02:00
Andreas Kling 69514c8a18 LibWeb: Improve FIXME message about getComputedStyle() properties
Let's log which property we're trying to look up, since that's the most
interesting part!

(cherry picked from commit f7a83e57554c7a98cda165ea1fa18356a6ee54d9)
2024-06-26 23:07:42 +02:00
Andreas Kling 7cd1114f05 LibWeb: Remove unnecessary FIXME marker for CSSStyleDeclaration.cssFloat
(cherry picked from commit 4c94202e9734099b6e2839f5495b8280eec2ab2f)
2024-06-26 23:07:42 +02:00
Andreas Kling 99851591b5 LibWeb: Make CSSKeyframeRule.parentRule actually point to parent rule
(cherry picked from commit 19fa630fa7e8342673b2aaa23e451f221533f12c)
2024-06-26 23:07:42 +02:00
Andreas Kling ea2876bc6f LibWeb: Implement CSSKeyframesRule.cssRuleList
To make this straightforward, CSSKeyframesRule now uses a CSSRuleList
for internal storage.

(cherry picked from commit 7f2c833a39e150c7372299dcfe4d2d5590ae779f)
2024-06-26 23:07:42 +02:00
Andreas Kling da836c344a LibWeb: Implement CSSStyleDeclaration.parentRule
This readonly attribute returns the containing CSS rule, or null (in the
case of element inline style).

(cherry picked from commit a12d28fd3053638ce6f4215bed2d8d45cda86375)
2024-06-26 23:07:42 +02:00
Ali Mohammad Pur 1c19d3cfc4 Tests/LibWasm: Don't ignore the result of BigInt::export_data()
Prior to this commit, the test runner was ignoring the result, which
meant that values that fit in less than 128 bits were shifted to remove
the zero words (which is obviously incorrect).

(cherry picked from commit 55e1ab88ad428db20554ae6a04465f20880a06ea)
2024-06-26 22:13:13 +02:00
Diego 0520de42f1 LibWasm: Check source and destination offsets in memory.init
Overflows are no longer possible.

(cherry picked from commit 3b40667413ce0885d10491589207b9556d5161d0)
2024-06-26 22:13:13 +02:00
Diego da3aaac7ea LibWasm: Check exports for valid ref.func targets
(cherry picked from commit 0e705f431eab80635dd24857aaa4606b7907c325)
2024-06-26 22:13:13 +02:00
Diego 145fb50fe0 LibWasm: Ensure that global.get only accesses imports in const exprs
(cherry picked from commit bd97091cbb4fd12cd323cedfa11f4c6f33250958)
2024-06-26 22:13:13 +02:00
Diego 7b50f71e0e AK: Read signed LEB128 integers without 64-bit assumptions
This fixes some errors where too many bytes were allowed to be read for
signed integers of a smaller size (e.g. i32). The new parser doesn't
make 64-bit assumptions and now matches the generality of its unsigned
counterpart.

(cherry picked from commit 596dd5252d477747d466e660acca25c015ce12e4)
2024-06-26 22:13:13 +02:00
Diego f7bebbe5a8 LibWasm: Read indices as LEB128 u32s
Every type of index was previously being read as a size_t.

(cherry picked from commit 20d8ea4db13490b3a63acd1dfefcc1bdbc79deae)
2024-06-26 22:13:13 +02:00
Diego ef9f3fd091 LibWasm: Check data segment offset at correct time during instantiation
The data segment offset should be checked _before_ checking if the
contents of the segment are non-existent.

(cherry picked from commit 78c56d80f90f913e4cbc14c865af308c6af9aeae)
2024-06-26 22:13:13 +02:00
Diego d7413560f8 LibWasm: Report start function traps during instantiation
(cherry picked from commit c2a0c4f58126e9db833e482b7611c3cea18622f6)
2024-06-26 22:13:13 +02:00
Diego 53aaa56ce8 LibWasm: Add missing spec extern and prevent spec extern re-use
Add the missing `print` function to the spectest namespace. Also, spec
externs cannot be re-used because operations that modify "memory", for
example, will carry over into subsequent spec test runs. This can be
remedied in the future by implementing some sort of garbage collector
for allocations in the store.

(cherry picked from commit 1e19be412f17f99e5c3979ccf790c3ca90d637d6)
2024-06-26 22:13:13 +02:00
Diego a91f00fed7 LibWasm: Improve element validation and instantiation
(cherry picked from commit 3225e6fad2b077a160d682ec3953a9d8fb49ffec)
2024-06-26 22:13:13 +02:00
Diego 9605b0f28d LibWasm: Implement rest of table instructions
(cherry picked from commit 4c3071c7c209c2e53c73862be72c9b493f263e78)
2024-06-26 22:13:13 +02:00
Tim Ledbetter 166130e12d LibWeb: Avoid null dereference when performing mixed content checks
Previously, navigating to or from `about:newtab` caused a crash due to
inadvertent null dereferences when checking whether a request or
response to a request should be blocked as mixed content.

(cherry picked from commit 572ebe00eacd5aaeecc17207c75c6bf2327a3897)
2024-06-26 20:03:57 +02:00
Andrew Kaster 3d467182bc LibWeb: Check for navigable destruction in declarative refresh timer
If the Document's navigable has been destroyed since we started this
timer, or it's no longer the active document of its navigable, we
shouldn't navigate to it.

(cherry picked from commit 7b67fa706fd2dabfda3c72a752ac70d8c95bb060;
amended commit message to say "LibWeb:" instead of "DOM:")
2024-06-26 20:03:34 +02:00
Luke Warlow 39a8974840 LibWeb: Implement stub for ElementInternals
This implements a stub ElementInternals object which implements the
shadowRoot getter only.

Also implement attachInternals function.

(cherry picked from commit a65f1ecc375fa02deeab5d0e7ab4702972ffa72e)
2024-06-26 20:02:46 +02:00
Torstennator 490d61d694 PixelPaint: Fix broken "Color Masking" selection
This change solves a problem where the color selection via mouse click
on the color wheel was computing a wrong hue angle.
2024-06-26 20:02:27 +02:00
Torstennator bb0bfb7944 PixelPaint: Fix Color Masking crash
This change solves a crash where it was possible that the
"Color Masking" could try to access pixel coordinates that where beyond
the boundaries of the image.
2024-06-26 20:02:27 +02:00
Andreas Kling ff49762eb4 LibWebSocket: Use HTTP::HeaderMap in WebSocket code
(cherry picked from commit 0d22e0703f4d668fab78b6e4960dfdc2b607369d)
2024-06-26 18:50:27 +02:00
Tim Ledbetter 36630bf859 LibIDL+LibWeb: Mark [FIXME] interfaces as [[Unimplemented]]
Methods and attributes marked with [FIXME] are now implemented as
direct properties with the value `undefined` and are marked with the
[[Unimplemented]] attribute. This allows accesses to these properties
to be reported, while having no other side-effects.

This fixes an issue where [FIXME] methods broke feature detection on
some sites.

(cherry picked from commit 2f5cf8ac204a58dc2a6f722dd95015c6c2fb7a78)
2024-06-26 16:34:37 +02:00
Tim Ledbetter c98bcd0a10 LibJS: Add the [[Unimplemented]] attribute
Properties marked with the [[Unimplemented]] attribute behave as normal
but invoke the `VM::on_unimplemented_property_access callback` when
they are accessed.

(cherry picked from commit 88d425f32b3b49d5dfa8d86e6e4e2c263cd450d4)
2024-06-26 16:34:37 +02:00
Andreas Kling f72805398b LibWeb: Add the bare minimum to render SVGAElement (<a>)
(cherry picked from commit 85a4cfc59bc901e860ba60c51ad1fc9c0cf4e669)
2024-06-26 14:13:40 +02:00
Andreas Kling 19e4b138af LibWeb: Treat width: {min,max,fit}-content as auto if ratio unresolvable
This appears to match other engines.

(cherry picked from commit ae906ca4974da309c362e61ce7b6b393b8c4aed1)
2024-06-26 14:13:40 +02:00
Andreas Kling 97edca4e4e LibWeb: Fix overeager fallback to stretch-fit width for some flex items
If a flex item has a preferred aspect ratio and the flex basis is not
definite, we were falling back to using stretch-fit for the main size,
since that appeared to match other browsers.

However, we missed the case where we actually have a definite cross size
through which the preferred aspect ratio can be naturally resolved.

(cherry picked from commit db1faef786dbd1722bbe6a1f4a5616f3069bdb6a)
2024-06-26 14:13:40 +02:00
Andreas Kling 47d7a3648e LibWeb: Allow flex-basis: {min,max,fit}-content
(cherry picked from commit 9c02ace89785cbc185553dc2711f79c4ad1bf389)
2024-06-26 14:13:40 +02:00
Jamie Mansfield ef7d593463 LibWeb: Implement IDBRequest.onerror
(cherry picked from commit 68d84755f4b745351d3d494759d59ba6719b8ad8)
2024-06-26 14:13:20 +02:00
Jamie Mansfield 6d268be6fc LibWeb: Implement IDBRequest.onsuccess
(cherry picked from commit 5ebc09c83b5ffd75341f8ddca9db3a49f587ed8d)
2024-06-26 14:13:20 +02:00
Jamie Mansfield 2f0b9c6dab LibWeb: Implement IDBOpenDBRequest.onupgradeneeded
(cherry picked from commit fe3962a64d1ab019b36965ecc60fe495adfd9295)
2024-06-26 14:13:20 +02:00
Jamie Mansfield aec46809fe LibWeb: Implement IDBOpenDBRequest.onblocked
(cherry picked from commit 30db7fb323c6041367155e646270e2a58f4233ea)
2024-06-26 14:13:20 +02:00
Jamie Mansfield 214797a69a LibWeb: Implement HTMLStyleElement.disabled
(cherry picked from commit 1114bbf2f155aeaa8d6b368a4eb567469c5d4fe3)
2024-06-26 14:13:20 +02:00
Jamie Mansfield 33262421a2 LibWeb: Remove is_media_feature_name function
This was made redundant in GH-12971 (SerenityOS), and removing it drops
a FIXME :^)

See:
- https://github.com/SerenityOS/serenity/pull/12971

(cherry picked from commit be08abbf8a0a62ae46275c3133f711c27b2efa02)
2024-06-26 14:13:20 +02:00
Andreas Kling f1dcf567e4 Tests: Add a basic test for Declarative Shadow DOM
(cherry picked from commit 7ce350b8c069c13540c50631413b2150bab967d4)
2024-06-26 08:48:11 +02:00
Andreas Kling 83d0599d1c LibWeb: Add Element.getHTML() and ShadowRoot.getHTML()
(cherry picked from commit fb9f3f10f3090cc2822d2c681bd7350dda17830e)
2024-06-26 08:48:11 +02:00
Andreas Kling e4feb43e86 LibWeb: Update innerHTML & co IDL definition to match spec
This stuff has moved from a mixin defined by the DOM Parsing spec, over
to the HTML spec, where they are now defined as partial interfaces for
Element and ShadowRoot.

There's also some new functionality that we don't implement yet, so
patch marks them as FIXME properties.

(cherry picked from commit 0c47b3ff971437c4bd3923134d26ad086b5f6a75)
2024-06-26 08:48:11 +02:00