Commit graph

3456 commits

Author SHA1 Message Date
Tim Ledbetter
ea8914aeac LibWeb: Map embedded content element attributes to dimension properties
(cherry picked from commit 728236f4d20b4dbabfe0936b79a2f63ac80f4da3)
2024-11-12 19:57:55 -05:00
Tim Ledbetter
8dee6b9ebd Libweb: Map marquee attributes to dimension properties
(cherry picked from commit baca0e5e5568b1b9b301cefa7d6cc8312b39be28)
2024-11-12 19:57:55 -05:00
Tim Ledbetter
7e456212c7 LibWeb: Map hr width attribute to the width dimension property
(cherry picked from commit 4c3101e021e323b487e8ab10026a14fdf40fa2f0)
2024-11-12 19:57:55 -05:00
Gingeh
3b9064089a LibWeb: Don't move focus when setting input value
(cherry picked from commit 1d9c404b8cb898b351ee3c69840bf943e97d499c)
2024-11-12 19:57:55 -05:00
Tim Ledbetter
bb798071a0 LibWeb: Treat dates and times with repeated separators as invalid
These would previously be treated as valid by the value sanitization
algorithm.

(cherry picked from commit f9282f65d3a4daf7df2c6033b03c70a56130aa72)
2024-11-12 19:57:55 -05:00
Ankush Chatterjee
d5ed665461 LibWeb/CSS: Add math expression support for transform-origin
(cherry picked from commit 85356094b50878e78d40d79c2a9e96ff9aac5a6b)
2024-11-12 10:45:53 -05:00
Tim Ledbetter
c7a699ed73 LibWeb: Make input type state change handling specification compliant
This change ensures that the value sanitization algorithm is run and
the text cursor is set to the correct position when the type attribute
of an input is changed.

(cherry picked from commit 1b74104c17726018788034f2ad66201889ce6225)
2024-11-12 10:45:53 -05:00
Tim Ledbetter
6db07d132f LibWeb: Use correct value when parsing datetime-local input type
(cherry picked from commit eb4e40bc49d2ad78335d0e95482a9c702764a8c9)
2024-11-12 10:45:53 -05:00
Tim Ledbetter
a77b65d46a LibWeb: Don't attempt to set selection if control has no selectable text
(cherry picked from commit 2c8fb4957871bca5694fc9e9f8932c9769967bd1)
2024-11-12 10:45:53 -05:00
Ali Mohammad Pur
66ee1a16e8 LibRegex: Don't ignore references that weren't bound in checked blocks
Fixes #2281.

(cherry picked from commit dabd60180f301ae206d6e23e0e0ff17d6c8975af)
2024-11-12 07:14:25 -05:00
Jelle Raaijmakers
957ee8276a LibWeb: Use right interface for custom SVG and MathML elements
The DOM spec gets overridden by both the SVG2 and MathML core specs in
that unknown elements should not inherit DOM::Element, but
SVG::SVGElement and MathML::MathMLElement respectively.

(cherry picked from commit 76e638b4ca10a91983877d6f6e7f037c1a720965)
2024-11-12 07:14:25 -05:00
Florian Cramer
950c5f823f LibXML: Set the doctype when parsing via Parser::parse_with_listener
This fixes at least one WPT test under /domparsing

(cherry picked from commit df7cac539e11315b0acae42cb4dbdf6ea39adcc8)
2024-11-12 07:14:25 -05:00
Magnus Johansson
099f907420 LibWeb: Fallback to auto when aspect ratio is degenerate as per spec
When aspect-ratio is degenerate (e.g. 0/1 or 1/0) we should
fallback to the same behaviour as `aspect-ratio: auto` according to spec
This commit explicitly handles this case and fixes five WPT test in
css/css-sizing/aspect-ratio (zero-or-infinity-[006-010])

(cherry picked from commit c6f77f4818a03411c14d9e60b743a7541a8280f6)
2024-11-12 07:14:25 -05:00
Ben Wiederhake
806f30d1d2 LibWeb: Fix crash when importing malformed RSAOAEP key
This fixes a crash in WPT:
WebCryptoAPI/import_export/rsa_importKey.https.any

This allows us to pass 240 tests!

(cherry picked from commit 124bd115a1342d9b4a7536fa62acedee279a12c9)
2024-11-12 07:14:25 -05:00
sideshowbarker
aa34916d45 LibWeb: Complete support for all ARIA properties in current spec
This change completes handling for all ARIA properties defined in the
current ARIA spec — by adding handling for the following properties:

- aria-braillelabel
- aria-brailleroledescription
- aria-colindextext
- aria-description
- aria-rowindextext

(cherry picked from commit ede6924db8e4440ef3bdb0fbb34d31226568e55a)
2024-11-12 07:14:25 -05:00
Ali Mohammad Pur
abfe081da1 LibRegex: Don't blindly accept inverted charclasses for atomic rewrite
(cherry picked from commit 00c45243bd62f45f402aa5e6d0d12d53591904c1)
2024-11-12 07:14:25 -05:00
Florian Cramer
60c67c02f0 LibXML: Allow empty pubid when parsing document type
(cherry picked from commit 1775021d7128ebe7fff680e13e1d37d14c62fd12)
2024-11-12 07:14:25 -05:00
Florian Cramer
cbd9e7d9fe LibXML: Allow empty systemid when parsing document type
This fixes at least one WPT under /domparsing

(cherry picked from commit 89192ecc46576b0872ff51a073d088f89223cd61)
2024-11-12 07:14:25 -05:00
Ben Wiederhake
7811ed378e LibWeb: Test subtleties in HKDF 'salt' interpretation
This also doubles as HKDF implementation test.

(cherry picked from commit 6d68d6ddb2d74f7fdcfe44169366aee9b127f1df)
2024-11-12 07:14:25 -05:00
Ben Wiederhake
6d5b1703a2 LibCrypto: Implement and test HKDF
(cherry picked from commit 8abd399a531a6beb864519fb0ae35d9c193cff03;
amended to use VERIFY instead of ASSERT in HKDF.h)
2024-11-12 07:14:25 -05:00
Timothy Flynn
1402fe99d5 LibWeb: Do not assume the shadow root has a host when updating selection
For example, if the shadow root was detached from the document in some
manner, its host will be null.

(cherry picked from commit 8fb2cc2be1d7a63eba7b1ae5c93e3db181ca393f)
2024-11-12 07:13:58 -05:00
Timothy Flynn
af3222b686 LibWeb: Update the document cursor position when the selection changes
Otherwise, it looks a bit awkward where the cursor position does not
update while the selection is elsewhere.

Note that this requires passing along the raw selection positions from
`set the selection range` to the elements. Otherwise, consider what will
happen if we set the selection start and end to the same value. By going
through the API accessor, we hit the case where the start and end are
the same value, and return the document cursor position. This would mean
the cursor position would not be updated.

The test changes here more closely match what Firefox produces now. It
is not a 100% match; the `select event fired` test case isn't right. The
problem is the event fires for the input element, but we most recently
focused the textarea element. Thus, when we retrieve the selection from
the input element, we return the document's cursor position, which is
actually in the textarea element. The fix will ultimately be to fully
implement the following:

https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-textarea/input-cursor

That is, each input / textarea element should separately track its own
text cursor position.

(cherry picked from commit fd289deb44e0fc26f54a133c637c136bf0716cd5)
2024-11-12 07:13:58 -05:00
Gingeh
b571b4317c LibXML: Read code points when parsing names
(cherry picked from commit 453e0348010561b4de922ee37e49d324eeedf3ac)
2024-11-12 04:25:50 -05:00
Ali Mohammad Pur
bc9e03ea38 AK: Cache all the line positions in LineTrackingLexer
Also updates a LibWeb text test that used to report the wrong line
number.

(cherry picked from commit 02b50d463b174e5d525c7ab8ce8dd173d550de28;
amended to exclude LineTrackingLexer from KERNEL, since that now use
make<>)
2024-11-12 04:25:50 -05:00
Timothy Flynn
3aec9df468 LibWeb: Do not unconditionally prevent escape keys from being propagated
We should only block the escape key from being sent to the web page if
the CloseWatcherManager actually closed something.

We use the escape key in the Inspector to cancel editing a DOM field.
This unconditional early return broke this feature.

(cherry picked from commit 099956a7cd2bec55e7e0376d54525f8a3f7b1955)
2024-11-12 04:24:58 -05:00
stelar7
816e658dfd LibWeb: Bring performance.now() closer to spec
(cherry picked from commit f6991a29559add9f0b3b4dee4a9ace2338a25511)
2024-11-12 04:24:21 -05:00
Pavel Shliak
8818cca08a LibAudio: Manage channelCountMode in DynamicsCompressorNode
That helps to pass more WPT tests
under /webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html

(cherry picked from commit f2ed59879f7781019152a18740fc5743cc513016)
2024-11-12 04:24:21 -05:00
Totto16
c1b0ac6376 LibWeb: Reject Promise in createImageBitmap for Not Implemented Types
If we don't reject the Promise, it lasts forever,
so rejecting non implemented Promises is essential,
to not timeout in e.g. WPT tests

(cherry picked from commit aab5a9e944f8b1c1a9de321047556bbcaa282a56)
2024-11-11 19:54:09 -05:00
Ali Mohammad Pur
d823e90f37 LibRegex: Restore checkpoints when restoring the state post-fork
Fixes the lockup/OOM in #968.

(cherry picked from commit cc1f0c3af2c2a237a317202ee844b97783de61ce)
2024-11-11 19:54:09 -05:00
Andreas Kling
1600dcaf19 LibWeb: Ignore boxes wholly in the negative scrollable overflow region
This fixes an issue where https://hey.com/ was horizontally scrollable
even though it shouldn't be.

(cherry picked from commit 94721385ceb17e20428b94a946d39828bdd5b74e)
2024-11-11 19:54:09 -05:00
Tim Ledbetter
f9158f4210 LibWeb: Fire iframe load event on document close
This matches the behavior of other browsers.

(cherry picked from commit e1eeb93cc6095a47371d23db0bbf55eb30215cee)
2024-11-11 19:54:09 -05:00
Noah Bright
8725bb12f2 LibWeb: Define PerformanceEventTiming
https://www.w3.org/TR/event-timing/#sec-performance-event-timing

Add idl, header and stubs for PerformanceEventTiming interface.

Two missing `PerformanceEntry` types that have come up in issues
are the `first-input` and the `event` entryTypes. Those are both
this.

Also, because both of those are this same interface, the static
methods from the parent class are difficult to implement because
of instance-specific details. Might either need subclasses or to
edit the parent and also everything that inherits from it :/

(cherry picked from commit d30ae92b82d997bc4db407c563c88f90d8260093)
2024-11-11 19:54:09 -05:00
Shannon Booth
9150241db9 LibWeb: Throw a SyntaxError on invalid URL for Location href setter
Aligning with a spec update, fixing 195 tests for:

https://wpt.live/url/failure.html
(cherry picked from commit ea971792b5da5f10cadb4f88f49c9722d88b32f6)
2024-11-11 17:22:42 -05:00
Ángel Carias
245d577235 LibWeb/DOM: Implement Node.lookupPrefix
Adds https://dom.spec.whatwg.org/#dom-node-lookupprefix

(cherry picked from commit 9624e0d2a2dc952b80e1ce1999f816f60c1ad813)
2024-11-11 15:46:34 -05:00
samu698
a37e4092bc LibWeb/HTML: Implement inner text set according to spec
Replaced the ad-hoc implementation with a spec compliant one.
This change fixes 36 WPT tests.

(cherry picked from commit 50f642613de54c73473c216fdc4d7e607e712679)
2024-11-10 21:48:40 -05:00
Bastian Müller
62894c9d3f LibWeb/XHR: Parse URL to resolve blob
(cherry picked from commit 3be93ac49fc93b905b5466896605c3375835c97c)
2024-11-10 21:48:40 -05:00
Shannon Booth
b901a8753d LibWeb: Allow splitting surrogate pairs in CharacterData.substringData()
(cherry picked from commit b999f925dcfb0417c534e1a21aa74626a06b466b)
2024-11-10 21:48:40 -05:00
Gasim Gasimzada
696021e252 LibJS: Set configurable toStringTag property for console
(cherry picked from commit c5b8e75204cb1603e2470e6cfeee3f2161a49b91)
2024-11-10 18:24:10 -05:00
Tim Ledbetter
736255ae87 LibWeb: Avoid division by zero in SourceSet width descriptor calculation
(cherry picked from commit 087d4004721193c290b18515e90b047192880a70)
2024-11-10 18:24:10 -05:00
Timothy Flynn
26551f6700 LibWeb: Always call document.close after document.write
This ensures the HTML parser completes running if it previously stopped
at an insertion point during a call to `document.write`.

(cherry picked from commit 230314238655204b89dd0736da4537b475eb252a)
2024-11-10 17:42:37 -05:00
Kemal Zebari
9714e98dc9 LibWeb/MimeSniff: Update the MIME type sniffing algo to meet specs
The spec moved/added the xml and html checks to the beginning and
removed sniffing resource feeds.

(cherry picked from commit b8a5e18a016dc32ba065417a4d6d32bbc03f101d)
2024-11-10 10:46:01 -05:00
Andrew Kaster
1b36465eea LibWeb: Deduplicate attributes when emitting start and end tags
The HTML tokenizer specification says that we're supposed to do this
when leaving the Attribute name or when emitting the token, as
appropriate.

Hopefully 'as appropriate' can mean only when emitting the token, as
that's the easiest place to insert this logic without complicating the
tokenizer any more.

(cherry picked from commit 7aa0165fe75bb94b79bc847484c7913d249ce263)
2024-11-10 10:46:01 -05:00
Andreas Kling
bca2b88b45 LibWeb: Always blockify the root element
This is what the spec tells us to do:

    The root element’s display type is always blockified,
    and its principal box always establishes an independent
    formatting context.

    Additionally, a display of contents computes to block
    on the root element.

Spec link: https://drafts.csswg.org/css-display/#root

Fixes #1562

(cherry picked from commit f1be662f683155705f851bcf440fe30d0e606a87)
2024-11-10 10:46:01 -05:00
Tim Ledbetter
fa08ac3631 LibWeb: Fire error event when script has an execution error
We now use the "report an exception" AO when a script has an execution
error. This has mostly replaced the older "report the exception" AO in
various specifications. Using this newer AO ensures that
`window.onerror` is invoked when a script has an execution error.

(cherry picked from commit 579a289d3db849657987c3310e7b1d71d290b566)
2024-11-10 10:46:01 -05:00
Andreas Kling
16473663ea LibJS: Don't infinite loop on unknown console.log formatting specifiers
(cherry picked from commit ef9208047dc8770f6263b483d7a442df703bc42b)
2024-11-10 10:46:01 -05:00
Sam Atkins
c369a2b48c LibWeb/CSS: Correct behavior of revert inside a @layer
`revert` is supposed to revert to the previous cascade origin, but we
previously had it reverting to the previous layer. To support both,
track them separately during the cascade.

As part of this, we make `set_property_expanding_shorthands()` fall back
to `initial` if it can't find a previous value to revert to. Previously
we would just shrug and do nothing if that happened, which only works
if the value you want to revert to is whatever is currently in `style`.
That's no longer the case, because `revert` should skip over any layer
styles that have been applied since the previous origin.

(cherry picked from commit bea47a25545adfb96d83a16a3e4f4435bae05e39)
2024-11-10 10:46:01 -05:00
Jamie Mansfield
070fa6febf LibWeb/WebVTT: Implement VTTCue idl interface
(cherry picked from commit 973f774e56b519964f2f43d965035d9076658096)
2024-11-10 10:46:01 -05:00
Jamie Mansfield
b8530d3848 LibWeb/WebVTT: Implement VTTRegion idl interface
(cherry picked from commit 1a012f279a9791c685781b7189fba6cddb973f96)
2024-11-10 10:46:01 -05:00
Jamie Mansfield
7003437a43 LibWeb/HTML: Implement TextTrackCueList idl interface
(cherry picked from commit cfec88feb312f3fbffe2270009a9ba07e2fd9b3f)
2024-11-10 10:46:01 -05:00
Jamie Mansfield
24f5f7289f LibWeb/HTML: Implement TextTrackCue idl interface
(cherry picked from commit 0b2449d8d264f58b39ed2a4a69b0afb8eb762011)
2024-11-10 10:46:01 -05:00