Commit graph

6197 commits

Author SHA1 Message Date
Andrew Kaster
5be4825504 LibWeb: Report exceptions from custom element upgrades to global object
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
2024-11-24 00:15:59 +00:00
Milo van der Tier
54b0476d70 LibWeb: Handle second condition in NamedNodeMap's property names
This removes the FIXME and fixes a WPT subtest.
2024-11-23 23:21:50 +00:00
Psychpsyo
8aaa9324b2 LibWeb: Unapply CSS filters after applying them to SVG 2024-11-23 21:39:50 +00:00
Tim Ledbetter
f378f41526 LibWeb: Use correct comparison logic in NamedNodeMap::get_attribute()
Previously, we were doing a case insensitive comparison, which could
return the wrong result if the attribute name was uppercase.
2024-11-23 21:19:28 +00:00
Jonne Ransijn
a0fb092d94 LibWeb: Transform PaintableBox::hit_test positions
Elements with transforms were tested on their pre-transformed
positions, causing incorrect hits.

Copy the position transformation done in `StackingContext::hit_test`
to ensure that hit tests are done on the _actual_ position.
2024-11-23 22:06:32 +01:00
Jonne Ransijn
d2ca522540 LibWeb: Use is_viewport helper
This method exists precicely to simplify the check being done here,
so lets use it!
2024-11-23 22:06:32 +01:00
Saksham Mittal
ecdb53cca6 LibWeb: Deduplicate opacity code in ApplyFilters
The opacity is still being set separately by using
ApplyOpacity for both CSS and SVG
2024-11-23 20:20:12 +01:00
Saksham Mittal
ab1cf8f89b LibWeb: Use ApplyFilters command for SVGs 2024-11-23 20:20:12 +01:00
Saksham Mittal
8562b0e33b LibWeb: Migrate CSS filter application to new ApplyFilters command
This helps reuse this code in other areas, such as for filters for SVGs
2024-11-23 20:20:12 +01:00
Psychpsyo
628e1d9853 LibWeb: Fix incorrect spec link for the @supports rule 2024-11-23 18:44:38 +00:00
Pavel Shliak
442629064b LibCore: Remove deprecated ElapsedTimer::elapsed()
This follows FIXME in the code.
2024-11-23 19:20:03 +01:00
Andreas Kling
69367194a6 LibWeb: Make HTML tokenizer stop at insertion point after state switch
If we reach the insertion point at the same time as we switch to another
tokenizer state, we have to bail immediately without proceeding with the
next code point. Otherwise we'd fetch the next token, get an EOF marker,
and then proceed as if we're at the end of the input stream, even though
more data may be coming (with more calls to document.write()..)
2024-11-23 19:19:31 +01:00
Andreas Kling
1d554f97de LibWeb: Reset the "stop parsing" flag when entering HTML parser
Otherwise we'll always bail after processing one token, which is not
what we want.
2024-11-23 19:19:31 +01:00
Andreas Kling
7309f2a6f9 LibWeb: Add spec comments to HTML parser's "initial" insertion mode 2024-11-23 19:19:31 +01:00
Shannon Booth
e565e3c557 LibWeb: Implement BroadcastChannel.postMessage
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
The repository being in static storage is a bit of a hodgepodge, but in
line with how our current storage partitioning is done. We should
eventually move this, along with other across browsing context APIs to a
proper location at a later stage. But for now, this makes progress on
the meat of the BroadcastChannel API.
2024-11-23 16:43:55 +01:00
Shannon Booth
8f6fe1de83 LibURL+LibWeb: Make URL serialization return a String
This can only ever fail from OOM, and will never by string containing
random byte sequences.
2024-11-23 16:43:55 +01:00
Shannon Booth
9724c67be2 LibWeb: Default initialize StructuredDeserialize memory argument
This is optional in the spec, so let's make it actually optional at the
call site.
2024-11-23 16:43:55 +01:00
Shannon Booth
617b8eed75 LibWeb: Const qualify many functions in EnvironmentSettingsObject
Which also allows us to remove a const_cast :^)
2024-11-23 16:43:55 +01:00
Shannon Booth
473bebc9a8 LibWeb: Tidy up return types of BroadcastChannel
Use GC::Ptr over a raw pointer and make the name() function const
qualfied returning a reference instead of a copy.
2024-11-23 16:43:55 +01:00
Andreas Kling
d3ee49b092 LibWeb: Avoid an infinite recursion in replaced element sizing
In the case where we had a preferred aspect ratio and a natural height
but no natural width, we'd get into ping-ponging infinite recursion by
trying to find the width to resolve the height to resolve the width to
resolve the height...
2024-11-23 16:39:45 +01:00
Timothy Flynn
d0149d8fc0 LibJS: Begin implementing the relativeTo option of Duration.total 2024-11-23 14:46:00 +01:00
Timothy Flynn
70ad66d3c0 LibJS: Begin implementing the relativeTo option of Duration.round 2024-11-23 14:46:00 +01:00
Timothy Flynn
0befd52725 LibJS: Begin implementing the relativeTo option of Duration.compare 2024-11-23 14:46:00 +01:00
Timothy Flynn
06593b1894 LibJS: Implement most of GetTemporalRelativeToOption
Now that we have the Temporal.PlainDate object, we can flesh out this AO
for such relative-to objects.
2024-11-23 14:46:00 +01:00
Timothy Flynn
521638642f LibJS: Capture CalendarFields by reference in Calendar*FromFields AOs
These fields are modified by an invocation to CalendarResolveFields. All
callers currently don't care about these modifications, so they move the
CalendarFields struct into the AO. But it turns out that at least one AO
will care (InterpretTemporalDateTimeFields), thus we will need to take
by reference here.
2024-11-23 14:46:00 +01:00
Timothy Flynn
021a5f4ded LibJS: Move ISO-related structures to their own file
Currently, AbstractOperations.h needs to include Time.h for the Time
structure. Soon, Time.h will need to include AbstractOperations.h for
structures defined there. To avoid a circular include, let's put the
ISO types into their own file, so that AO.h does not need to include
any JS type header.
2024-11-23 14:46:00 +01:00
Timothy Flynn
46998e922a LibJS: Implement Temporal.PlainMonthDay/YearMonth.prototype.toPlainDate 2024-11-23 14:46:00 +01:00
Timothy Flynn
06ef32818e LibJS: Implement Temporal.PlainDate.prototype.valueOf 2024-11-23 14:46:00 +01:00
Timothy Flynn
f8b593a7df LibJS: Implement Temporal.PlainDate.prototype.toPlainMonthDay/YearMonth 2024-11-23 14:46:00 +01:00
Timothy Flynn
3aa4cdd314 LibJS: Implement Temporal.PlainDate.prototype.until/since 2024-11-23 14:46:00 +01:00
Timothy Flynn
abc6b679c3 LibJS: Check both the quotient and remainder for rounding negativity
Our BigInt implementation can store the negativity of the division
result in either the quotient or the remainder. This is exposed by an
upcoming prototype, which will reach this division with:

    -432000000000000 / 86400000000000000000000

Which has the BigInt division result:

    quotient = 0
    remainder = -432000000000000

(Our old Temporal implementation also had this bug).
2024-11-23 14:46:00 +01:00
Timothy Flynn
b319d45566 LibJS: Optimize the CalendarDateUntil AO for large year differences
For example, consider the following operation:

    const instance = new Temporal.PlainDate(2000, 5, 2);
    instance.until("-271821-04-19");

The spec would have us enter a loop to compute the difference between
these dates by incrementing an intermediate date one day at a time.
Instead, we can do some math to skip ahead much closer to the desired
date.
2024-11-23 14:46:00 +01:00
Timothy Flynn
f280a96e35 LibJS: Implement Temporal.PlainDate.prototype.with/withCalendar 2024-11-23 14:46:00 +01:00
Timothy Flynn
c2ead84bd9 LibJS: Implement Temporal.PlainDate.prototype.add/subtract/equals 2024-11-23 14:46:00 +01:00
Timothy Flynn
9fbb5a57fa LibJS: Implement stringification Temporal.PlainDate prototypes 2024-11-23 14:46:00 +01:00
Timothy Flynn
a0c55f76e7 LibJS: Implement the Temporal.PlainDate constructor
And the simple Temporal.PlainDate.prototype getters, so that the
constructed Temporal.PlainDate may actually be validated.
2024-11-23 14:46:00 +01:00
Andreas Kling
1b4763f75f LibWeb: Allow border="0" on HTMLObjectElement 2024-11-23 14:41:41 +01:00
Andreas Kling
6e85363a84 LibWeb: Allow border="0" on HTMLInputElement 2024-11-23 14:41:41 +01:00
Andreas Kling
1288452bc3 LibWeb: Honor border attribute on HTMLImageElement 2024-11-23 14:41:41 +01:00
Andreas Kling
e781aab274 LibWeb: Honor the various margin attributes in HTMLBodyElement
This one is particularly weird as there's a priority order, and we even
have to look at attributes from the container element if we're inside a
subframe.
2024-11-23 14:41:41 +01:00
Andreas Kling
7ea7352bf3 LibWeb: Bail on applying the history step when no active window
This is an ad-hoc hack papering over the fact that we can apparently
end up in these places without an active window, and proceeding without
one leads to assertions on WPT.
2024-11-23 14:41:41 +01:00
Psychpsyo
3e536a4cd7 LibWeb: Implement more IntersectionObserver attributes 2024-11-23 09:52:32 +01:00
Gingeh
7444f76b0d LibWeb: Make querySelectorAll match each element at most once 2024-11-23 09:49:33 +01:00
Gingeh
bb678e75f9 LibWeb: Reject selectors with named namespaces in querySelectorAll 2024-11-23 09:49:33 +01:00
Gingeh
ba0cc7fe46 LibWeb: Use correct case-sensitivity when matching attribute selectors
Also removed get_attribute_with_lowercase_qualified_name
because it was buggy, duplicated logic, and now unused.
2024-11-23 09:49:33 +01:00
Gingeh
a2cf1d17fd LibWeb: Require CSS combinators to be followed by a simple selector 2024-11-23 09:49:33 +01:00
Gingeh
bb5678a175 LibWeb: Don't allow trailing commas in selector lists
comma-separated list != #-multiplier
2024-11-23 09:49:33 +01:00
sideshowbarker
8965698ce7 LibWeb: Support accessible-name computation for SVG elements
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
This change adds support for computing accessible names for SVG
elements, per the https://w3c.github.io/svg-aam/#mapping_additional_nd
spec requirements. Otherwise, without this change, accessible names for
SVG elements don’t get exposed as expected.
2024-11-23 04:34:23 +00:00
Psychpsyo
b22341fc77 LibGfx: Support AVIF images with missing pixi property 2024-11-23 03:57:54 +00:00
Shannon Booth
3fffd1129c LibWeb: Implement overload resolution for sequence types
Fixes: #2508
2024-11-23 02:38:21 +00:00