1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-06-29 08:00:21 +00:00
Commit Graph

61964 Commits

Author SHA1 Message Date
Andreas Kling
225108c830 LibWeb: Set the correct prototype for SVGAElement instances
(cherry picked from commit 4db05ecf69bee07a060f2e4513e9d53b6110dcc4)
2024-06-28 23:43:59 +02:00
Andreas Kling
bdf3071bd9 Tests/LibWeb: Add test that dumps all global JS constructors
(cherry picked from commit a84261ee7a5e0b76a03225d71ec64424d4865a78)
2024-06-28 23:43:59 +02:00
Luke Warlow
cf5b1b7c10 LibWeb: Implement unsafe HTML parsing methods
Both Element's and ShadowRoot's setHTMLUnsafe, and Document's static
parseHTMLUnsafe methods are implemented.

(cherry picked from commit ce8d3d17c4f2fcca8fac0ff4a832c8f50a011fc7)
2024-06-28 10:56:27 +02:00
Edwin Hoksberg
e2bf7d1a36 LibWeb: Add attribute list that must always be compared without casing
(cherry picked from commit 2b30414c1d8641eaf4212db69e40a4381005314c)
2024-06-28 10:56:14 +02:00
Luke Warlow
27ffaad882 LibWeb: Implement dialog element's close watcher
Dialog elements now correctly establish a close watcher when
shown modally.

This means modal dialogs now correctly close with an escape key press.

(cherry picked from commit d86a6e1bec858a35935ba6839c154ba2482d33e6)
2024-06-28 10:32:12 +02:00
Luke Warlow
47bc8ecb0e LibWeb: Prevent select.click() opening the dropdown
No other browser allows opening the select element dropdown with the
select.click() function.
This change stops this happening in Ladybird.

(cherry picked from commit 564e546ff0bd78cc7ba770b53377457bf1ef88d6)
2024-06-28 10:31:53 +02:00
Liav A.
972f7581e9 Utilities/nc: Add an option to test a TCP-listening service
Similarly to OpenBSD nc, an option to just connect without transmitting
any actual data is added.

However, we don't allow UDP-mode when testing a remote service, as it
will always succeed and has no technical meaning for the user if they're
not able to view the traffic on the remote machine.
2024-06-28 10:31:23 +02:00
Liav A.
dcf7296929 Utilities/nc: Don't use LibC gethostbyname function
Instead, let's use the nicer Core::Socket API and resolve the hostname
this way.
2024-06-28 10:31:23 +02:00
Luke Warlow
1df32b7e1a LibWeb: Add HTMLSelectElement showPicker()
Adds the showPicker() function for select elements.
This doesn't do the check for "being rendered" which is in the spec.

(cherry picked from commit 5098ed6b1f881659dbdab10c74a0e17b362ce7a8)
2024-06-28 00:56:17 +02:00
Luke Warlow
33c315bad0 LibWeb: Implement CloseWatcher API
This implements most of the CloseWatcher API from the html spec.

AbortSignal support is unimplemented.

Integration with dialogs and popovers is also unimplemented.

(cherry picked from commit b216046234560df531e1a32269e5dfa18f8f240c,
manually amended to replace a single `UIEvents::KeyCode::Key_Escape`
with `KeyCode::Key_Escape` in EventHandler.cpp since we don't have
the second commit of https://github.com/LadybirdBrowser/ladybird/pull/86)
2024-06-28 00:55:43 +02:00
Luke Warlow
1739111d17 LibWeb: Refactor DOM parsing APIs
Multiple APIs have moved from the DOM Parsing and Serialization spec to
HTML.

Updates spec URLs and comments.

Delete InnerHTML file:
- Make parse_fragment a member of Element, matching serialize_fragment
on Node.
- Move inner_html_setter inline into Element and ShadowRoot as per the
spec.

Add FIXME to Range.idl for Trusted Types createContextualFragment

(cherry picked from commit 9171c3518358cd2d146ffbd7582e4c1247a1daa7)
2024-06-28 00:55:22 +02:00
Jamie Mansfield
d586afbf73 LibWeb: Don't set hashChange for classic history navigate events
See:
- https://github.com/whatwg/html/pull/10393

(cherry picked from commit 4c5fa102a381c3687e677f9b6b13752c2bcea867)
2024-06-28 00:55:02 +02:00
Nico Weber
43bef4b401 Ladybird/AppKit: Send mouse event on middle click 2024-06-27 17:49:07 -04:00
Nico Weber
8859bd3b78 Ladybird/AppKit: Send correct mouse event on right click 2024-06-27 17:47:43 -04:00
Tim Ledbetter
850859f645 LibWeb: Disallow pasting into non-editable text nodes
(cherry picked from commit 8969f2e34af196e935c57257ef7eec8f00b45d33)
2024-06-27 22:54:03 +02:00
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