1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-01 11:39:22 +00:00
Commit Graph

61995 Commits

Author SHA1 Message Date
Tim Ledbetter
b62c572154 LibWeb: Fire auxclick event on middle click
Previously, no event was fired on middle click. This change also allows
the UI to open a link in a new tab on middle click.

(cherry picked from commit 31d7fa244232c2a2239dbf6017ba9e3dd191ec2e)
2024-06-27 22:53:15 +02:00
Tim Ledbetter
2554d766bc LibWeb: Add Internals.middleClick
This simulates click of the middle mouse button, which is necessary for
testing whether the `auxevent` fires correctly.

(cherry picked from commit 728fca1b1ffd8b472bc8524e5e8ec8443de011a5)
2024-06-27 22:53:15 +02:00
Aliaksandr Kalenik
030ea71dff LibWeb: Use button layout for input elements with button type
(cherry picked from commit b2dcdf009605d50503592789ac14a8406b0d3983)
2024-06-27 19:02:45 +02:00
Aliaksandr Kalenik
c6e3c0a339 LibWeb: Create BlockContainer layout node for <input type="button">
...and shadow tree with TextNode for "value" attribute is created.
This means InlineFormattingContext is used, and button's text now
respects CSS text-decoration properties and unicode-ranges.

(cherry picked from commit 8feaecd5c8d02a2fdb989a9a9671e008d1c3a7de)
2024-06-27 19:02:45 +02:00
Ali Mohammad Pur
7b47c57c54 LibWeb/CSS: Avoid capturing structured binding in generic lambda
Apple Clang doesn't like this, rather than waiting for their version of
random-clang-commit-to-call-a-release to catch up with llvm trunk, just
work around the issue.

Fixes #186.

(cherry picked from commit 8c9d3b30cf62016ffb03e425f1e7e3f2461262bf)
2024-06-27 19:02:24 +02:00
Nico Weber
aef023a7f6 Meta: Port recent changes to the GN build
4033776fb5
2024-06-27 19:02:10 +02:00
Luke Warlow
d29cef8d5f LibWebView: Allow data URLs in sanitize_url
Allow navigation to data URLs from browser UI.

(cherry picked from commit 6014727c20ad108e8345e89cba8e9eace3c157b3)
2024-06-27 17:14:22 +02:00
Shannon Booth
4033776fb5 LibWeb: Add stub for ValidityState
This fixes https://html5test.com/ as previously an exception was being
thrown after trying to access this attribute which would then result in
a popup about the test failing (and none of the test results being
shown).

(cherry picked from commit e0bbbc729b6aad04ceff5f67c3e2868b65970047,
manually amended with the output of `git clang-format master`)
2024-06-27 17:13:16 +02:00
Hexeption
c0fdc7d2dd LibWeb: Added HTMLLinkElement.as Tests
(cherry picked from commit 7ac6fd274696fe3e66971bb3b82141466879f82b)
2024-06-27 14:49:29 +02:00
Hexeption
928576e0ac LibWeb: Added HTMLLinkElement.as
(cherry picked from commit 2f4668edce2effb38563b9da229d00d3ba5dc508,
manually amended to move `||` at the start of the line to appease
clang-format)
2024-06-27 14:49:29 +02:00
Matthew Olsson
5e4e39d84a LibWeb: Remove TimingFunction in favor of EasingStyleValue::Function
Now that EasingStyleValue is a lot nicer to use, there isn't much reason
to keep TimingFunction around.

(cherry picked from commit 7950992fc21e2428a7f32954bbe893a2b2d58cf7,
manually amended with the output of `git clang-format master`)
2024-06-27 14:49:14 +02:00
Matthew Olsson
6c0859d412 Meta: Remove GenerateCSSEasingFunctions
(cherry picked from commit ac35f76e67f9a393ed5a2e5c8b7e7f56809a2a56)
2024-06-27 14:49:14 +02:00
Matthew Olsson
e301c1d038 LibWeb: Parse easing values manually
The values aren't that complex, so it doesn't make much sense to have a
dedicated generator for them. Parsing them manually also allows us to
have much more control over the produced values, so as a result of this
change, EasingStyleValue becomes much more ergonomic.

(cherry picked from commit 667e313731f06fabf2a3f75893c3e8f15a4172be,
manually amended with the output of `git clang-format master`)
2024-06-27 14:49:14 +02:00
Nico Weber
4bf4905131 Meta: Port recent changes to the GN build
f72805398b
2024-06-27 14:42:29 +02:00
Tim Ledbetter
2519dadbb3 LibURL: Convert ASCII only URLs to lowercase during parsing
This fixes an issue where entering EXAMPLE.COM into the URL bar in the
browser would fail to load as expected.

(cherry picked from commit 1a4b042664f8fddbfa70f009c5873b1f8575bf0b)
2024-06-27 14:00:51 +02:00
Tim Ledbetter
1bf09a74b7 Meta: Ensure LibURL tests are built
(cherry picked from commit fd98076aca7a75a620672a7a1632b46a62641927,
manually resolved a conflict)
2024-06-27 14:00:51 +02:00
Tim Ledbetter
7561a48ec6 LibWebView: Don't query public suffix list when sanitizing URLs
Previously, part of the procedure we used to sanitize URLs entered via
the command line would check the host against the public suffix
database. This led to some valid, but not publicly accessible URLs
being treated as invalid.

(cherry picked from commit e9f34c7bd1e72da9a57a721d4ad501e8208cc986)
2024-06-27 14:00:51 +02:00
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