Commit graph

6656 commits

Author SHA1 Message Date
Aliaksandr Kalenik
b8109c3047 LibWeb/WebGL: Implement bindAttribLocation() 2024-12-05 16:42:19 +01:00
Aliaksandr Kalenik
11ddc88ed7 LibWeb/WebGL: Remove FIXME from isContextLost() IDL method
Currently this function always returns false, but that's better than
not having it at all.
2024-12-05 16:42:19 +01:00
sideshowbarker
989c2f9e87 LibWeb: Use el.aria_foo(), not el.has_attribute("aria-foo"_string)
This change replaces some element.has_attribute("aria-foo"_string) calls
with element.aria_value_foo() calls instead.
2024-12-05 08:05:01 -05:00
sideshowbarker
5d47ba1e38 LibWeb: Minor code cleanup; use HTML::AttributeNames::value, not string
This is a minor change to the Node::name_or_description code to switch
some instances of element.has_attribute("value"_string) over to instead
using element.has_attribute(HTML::AttributeNames::value).
2024-12-05 08:05:01 -05:00
Timothy Flynn
db87f173fb LibJS: Implement the RegExp.escape proposal
https://tc39.es/proposal-regex-escaping/
2024-12-05 13:56:21 +01:00
Timothy Flynn
bd1009f3c1 LibJS: Extract some JS lexer helpers to free functions
We will need these in an upcoming proposal.
2024-12-05 13:56:21 +01:00
Andreas Kling
3f461b96df LibWeb: Implement window.stop()
Fixes a handful of timeouts on WPT.
2024-12-05 12:13:09 +01:00
Luke Warlow
fdee82d203 LibWeb: Implement ::file-selector-button pseudo element
The button for a file input now matches `::file-selector-button`.
2024-12-05 10:49:57 +00:00
Aliaksandr Kalenik
c817eb8d2b LibWeb/WebGL: Implement getContextAttributes() 2024-12-05 09:57:10 +01:00
Timothy Flynn
5e534f4d83 LibJS+LibUnicode: Designate a sort order for Intl.PluralRules categories
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/62fe5db
2024-12-05 09:49:55 +01:00
Timothy Flynn
e5ec8441c9 LibJS: Remove the Intl.PluralRules GetOperands AO
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/c7bca3a
2024-12-05 09:49:55 +01:00
Aliaksandr Kalenik
110f89ee25 LibWeb/WebGL: Implement getShaderInfoLog()
With this change we have enough WebGL support to display demos on
https://ciechanow.ski/lights-and-shadows/ but most of them are not
redering correctly yet.
2024-12-05 01:23:10 +01:00
Psychpsyo
1881a8df4b LibGfx: Set png interlace handling on interlaced images 2024-12-04 20:29:15 +00:00
Psychpsyo
d4d335ebda LibWebView: Display layouting information in devtools
Specifically, you can now see whether an element is visible,
scrollable or creates a stacking context in the devtools.
2024-12-04 17:15:15 +00:00
Psychpsyo
0320494c3f LibWeb: Remove non-spec condition in scrollable overflow calculation 2024-12-04 17:14:10 +00:00
Jonne Ransijn
d5fbf7323a AK+LibJS: Allow {TRY,MUST}{,_OR_THROW_OOM} on list-initializers
List initializers may contain commas without surrounding parenthesis,
causing them to be passed as multiple macro arguments.
2024-12-04 16:45:58 +00:00
Shannon Booth
0fa54c2327 LibURL+LibWeb: Make URL::serialize return a String
Simplifying a bunch of uneeded error handling around the place.
2024-12-04 16:34:13 +00:00
Shannon Booth
d7ac0601ab LibWeb: Simplify OOM exception handling in ImportMap
In some cases by crashing on OOM, and in others removing strange use of
String::formatted altogther.
2024-12-04 16:34:13 +00:00
Shannon Booth
bd2f794873 LibJS: Make output_debug_message accept a StringView 2024-12-04 16:34:13 +00:00
Shannon Booth
e9ab3e5a80 LibWeb: Remove ExceptionOr usage for 'resolve module integrity metadata'
We do not have any exceptions to propogate.
2024-12-04 16:34:13 +00:00
Pavel Shliak
a557632716 LibWeb: Move http response method in setter 2024-12-04 16:33:54 +00:00
Pavel Shliak
134dc57458 LibWeb: Ensure segments are copied only once in set_line_dash 2024-12-04 16:33:54 +00:00
Yuval Carmon
3ff8c5c8f1 LibWeb/CSS: Block shadow host matching in DOM
Fixes an issue where selectors inside a shadow root could incorrectly
match their shadow host directly using selectors like #host,
instead of requiring :host pseudo-class selectors.

Fixes issue #2319
2024-12-04 16:19:32 +00:00
Jelle Raaijmakers
90d884a150 LibWeb: Prevent crash when editing outside of <body>
Step 9 of this algorithm might end up at the document node, which does
not have a parent.
2024-12-04 17:18:00 +01:00
Lucas CHOLLET
6804ce348e LibWeb/CSS: Interpret NaN as 0 when resolving alpha and rgb values
Fixes the crash in css/css-color/parsing/color-valid-hwb.html.

The crash was probably introduced in 248e4bb5, as it was the first
commit to VERIFY that the value given to `Color::with_opacity` were in
the correct range. As the values in color-valid-hwb.html were resolved
as NaN, the check never passed.
2024-12-04 16:11:41 +00:00
Aliaksandr Kalenik
72f093ba9f LibWeb: Null-check surface before allocating painter for context2d
Fixes https://github.com/LadybirdBrowser/ladybird/issues/2755
2024-12-04 16:58:55 +01:00
Aliaksandr Kalenik
a6810fec24 LibWeb: Allocate transparent surface based on surface null check
...in HTMLCanvasElement::to_data_url() and HTMLCanvasElement::to_blob().

This fixes the problem when surface is not allocated because context is
not initialized yet, even though canvas size is non-zero.

Fixes broken WebDriver screenshot endpoint.
2024-12-04 15:15:16 +00:00
Timothy Flynn
3c64e4595a LibJS: Use exact mathematical values for Intl.DurationFormat
We can't use doubles due to precision loss for extremely large values.
2024-12-04 08:01:35 -05:00
Timothy Flynn
912e38c5fb LibCrypto: Add a BigFraction::is_zero helper 2024-12-04 08:01:35 -05:00
Timothy Flynn
e6c96ce57e LibCrypto: Convert BigFraction stringification to String 2024-12-04 08:01:35 -05:00
Timothy Flynn
5cfd50224c LibJS: Use enums instead of strings in Intl.DurationFormat AOs 2024-12-04 08:01:35 -05:00
Timothy Flynn
37fc9b6511 LibJS: Apply editorial updates to Intl.DurationFormat
To help prepare for its stage 4 promotion, this applies the editorial
updates made to Intl.DurationFormat over the last few months.
2024-12-04 08:01:35 -05:00
Milo van der Tier
1882a2e19b LibWeb/CSS: Pass Length::ResolutionContext to resolve_integer
The length resolution context might be needed even when resolving an
integer value, since it might contain a sign() function with length
values inside. This fixes a WPT subtest.
2024-12-04 12:26:50 +00:00
Milo van der Tier
8bec80ac47 LibWeb/CSS: Allow calc() values in media queries
It was initially thought that the spec disallows them, but this turned
out to be incorrect. This fixes several WPT tests.
2024-12-04 12:26:50 +00:00
Lucas CHOLLET
ad3dd547b7 LibWeb/CSS: Shorten the length of srgb serialization
The WPT tests require the shortest possible serialization that support
an 8 bits roundtrip.

As an example, `128` is serialized to `0.5` while `127` needs more
precision and thus will be serialized to `0.498`.

This commit fixes 33 WPT subtests in css/css-color.
2024-12-04 11:30:44 +00:00
Lucas CHOLLET
ded6695c52 LibWeb/CSS: Remove unused serialization helpers 2024-12-04 11:30:44 +00:00
Christoffer Sandberg
879af72850 LibWeb: Improve painting of nested inline elements
PaintableWithLines created from inline nodes need to examine their
children to fully compute their size and offset as nested children
might have textnodes that are placed before their parent.

Fixes #1286
2024-12-04 11:23:54 +00:00
Jonne Ransijn
acaf01bf7b LibWeb: Do not normalize border radii containing their initial values
Most computed border-radii contain their initial values, and since the
normalized initial border radii are always zero, there is no need to do
expensive floating point math to normalize them.
2024-12-04 08:30:22 +00:00
Jelle Raaijmakers
9b446df7f5 LibWeb: Replace local name checks with simpler is<T> in editing API 2024-12-04 06:51:59 +01:00
Jelle Raaijmakers
e308a3fd3f LibWeb: Be more defensive while traversing ancestors in editing API
In all these cases there should be an ancestor available, but it
definitely cannot hurt to be a bit more defensive about this and prevent
nullptr dereferences.
2024-12-04 06:51:59 +01:00
Jelle Raaijmakers
b6939c8035 LibWeb: Use wrap algorithm in "fix disallowed ancestors"
We have the wrap algorithm implemented now, so resolve the FIXME.
2024-12-04 06:51:59 +01:00
Jelle Raaijmakers
4f76cec096 LibWeb: Implement document.execCommand("insertParagraph") 2024-12-04 06:51:59 +01:00
Jelle Raaijmakers
2e29d3fb57 LibWeb: Fix is_allowed_child_of_node() for non-element parent node
When passing a DOM::Node that is not a DOM::Element, this method would
always try to cast to a DOM::Element.
2024-12-04 06:51:59 +01:00
Jelle Raaijmakers
a62b664d0d LibWeb: Put editing command "styleWithCSS" in alphabetical order 2024-12-04 06:51:59 +01:00
Jelle Raaijmakers
98df4c2b3c LibWeb: Make Editing::fix_disallowed_ancestors_of_node() take a GC::Ref 2024-12-04 06:51:59 +01:00
Jonne Ransijn
211dc5659c LibWeb: Fix stack-use-after-scope
The refactor in the previous commit was storing a reference to a stack
allocated `Infrastructure::Request::BodyType` which was then immediately
freed. To fix this, we can store the `Infrastructure::Request::BodyType`
in a variable beforehand, so it becomes safe to reference.
2024-12-04 01:58:22 +01:00
Jonne Ransijn
d7596a0a61 AK: Don't implicitly convert Optional<T&> to Optional<T>
C++ will jovially select the implicit conversion operator, even if it's
complete bogus, such as for unknown-size types or non-destructible
types. Therefore, all such conversions (which incur a copy) must
(unfortunately) be explicit so that non-copyable types continue to work.

NOTE: We make an exception for trivially copyable types, since they
are, well, trivially copyable.

Co-authored-by: kleines Filmröllchen <filmroellchen@serenityos.org>
2024-12-04 01:58:22 +01:00
Jonne Ransijn
d7a721951e LibWasm: Fix UB in LibWasm
Now that `Optional<T&>` are trivially copyable/movable, it is
triggering Undefined Behaviour checks on GCC. We can resolve those
by using an union.
2024-12-04 01:58:22 +01:00
Aliaksandr Kalenik
7e78d7d332 LibWeb/WebGL+Meta: Stub getSupportedExtensions() and getExtension() 2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
64fec8b2de LibWeb/WebGL: Implement texImage2D() 2024-12-03 23:35:45 +01:00