Commit graph

65379 commits

Author SHA1 Message Date
Timothy Flynn
0b59971ef9 LibJS: Reject ambiguous annotated time strings
This missing rejection will be caught by an upcoming Temporal.PlainTime
test.
2024-11-23 19:35:36 -05:00
Timothy Flynn
c83a3db542 LibJS: Handle Temporal.PlainDate in dynamic calendar operations 2024-11-23 19:35:36 -05:00
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
Pavel Shliak
6ad93d2b21 UI/Qt: Use Qt-reported dark theme
For Qt >= 6.5, the system theme can be determined reliably, so no
guesswork is needed. A fallback remains for Qt < 6.5, but it is
hacky and less reliable.
2024-11-23 19:53:43 +00: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
Andreas Kling
701ed8470d Tests: Import a bunch of WPT tests related to dynamic markup insertion 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
30fb2bf2e1 Tests: Skip html/rendering/pixel-length-attributes.html for now
This test is too slow for GCC CI.
2024-11-23 14:41:41 +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
97aa608c13 Tests: Import WPT test for pixel length attributes 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
rmg-x
59c8e0cd5a Documentation: Remove SerenityOS references where appropriate 2024-11-23 14:29:48 +01:00
rmg-x
d389fb440f CI: Ignore changes to Documentation related files
This will prevent CI from running if:
- the only changes included are under the Documentation folder, or
- the only changes included are *.md files in the root

See:
https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-excluding-paths
2024-11-23 10:44:54 +01:00
Psychpsyo
3e536a4cd7 LibWeb: Implement more IntersectionObserver attributes 2024-11-23 09:52:32 +01:00