Commit graph

66623 commits

Author SHA1 Message Date
Luke Wilde
9b4bad4255 LibWeb/WebGL: Factor in subarrays for typed arrays for generic methods 2025-01-08 17:55:17 +03:00
Luke Wilde
42cce393f4 LibWeb/WebGL2: Implement drawElementsInstanced 2025-01-08 17:55:17 +03:00
Luke Wilde
c05fa44cf8 LibWeb/WebGL2: Implement vertexAttribDivisor 2025-01-08 17:55:17 +03:00
Luke Wilde
b6bc5912d6 LibWeb/WebGL: Implement tex(Sub)Image2D with TexImageSource 2025-01-08 17:55:17 +03:00
Luke Wilde
f66f01ce53 LibWeb/WebGL: Implement getUniformBlockIndex 2025-01-08 17:55:17 +03:00
Luke Wilde
216d5b33be LibWeb/WebGL: Enforce minimum size when resizing existing context
Previously the enforcement was only done on creation. Not enforcing it
on change would cause a crash if the canvas width/height was set to
zero or less.
2025-01-08 17:55:17 +03:00
Luke Wilde
8e453d5069 LibWeb/WebGL: Preserve original bound objects to return in getParameter
Required by https://qwasm2.m-h.org.uk, which adds a custom `name`
attribute to objects it generates. It then gets some of these objects
out with getParameter, and expects the `name` attribute to be there.
2025-01-08 17:55:17 +03:00
Luke Wilde
c067271897 LibWeb/WebGL2: Implement getActiveUniformBlockParameter 2025-01-08 17:55:17 +03:00
Luke Wilde
191ceb0f61 LibWeb/WebGL2: Implement getActiveUniformBlockName 2025-01-08 17:55:17 +03:00
Luke Wilde
7957793863 LibWeb/WebGL2: Implement uniformBlockBinding 2025-01-08 17:55:17 +03:00
Luke Wilde
28a73dc392 LibWeb/WebGL: Implement deleteRenderbuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
4e33d8e577 LibWeb/WebGL: Mark clear as a draw operation instead of clearColor 2025-01-08 17:55:17 +03:00
Luke Wilde
e26b524721 LibWeb/WebGL2: Implement invalidateFramebuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
2983ad10bc LibWeb/WebGL2: Correctly handle offsets in uniform(Matrix) functions 2025-01-08 17:55:17 +03:00
Luke Wilde
63b792c205 LibWeb/WebGL2: Implement bufferSubData with offset and length 2025-01-08 17:55:17 +03:00
Luke Wilde
18ea91715b LibWeb/WebGL2: Implement bufferData with offset and length 2025-01-08 17:55:17 +03:00
Tim Ledbetter
a6ab9cc983 LibWeb: Initialize AudioBufferSourceNode with correct defaults 2025-01-08 14:45:51 +00:00
Psychpsyo
9370990ff2 LibWeb: Implement user-select
This implements all values of user-select.
2025-01-08 14:37:28 +00:00
Sam Atkins
ba43dfe49a LibWeb/CSS: Remove use of Dimension in calc() parsing
Rather than partly-converting number, dimension, and ident tokens at the
start of parsing a calculation, and then later finishing it off, we can
just do the whole step in convert_to_calculation_node(). This is a
little less code, but mainly means we are left with only a single use
of the Dimension type in the codebase, so that can be removed soon.
2025-01-08 14:28:54 +00:00
Sam Atkins
5cda2ac961 LibWeb/CSS: Remove illegal <number-percentage> type
Various places in the spec allow for `<number> | <percentage>`, but this
is either/or, and they are not allowed to be combined like dimensions
and percentages are. (For example, `calc(12 + 50%)` is never valid.)

User code generally doesn't need to care about this distinction, but it
does now need to check if a calculation resolves to a number, or to a
percentage, instead of a single call.

The existing parse_number_percentage[_value]() methods have been kept
for simplicity, but updated to check for number/percentage separately.
2025-01-08 14:28:54 +00:00
Sam Atkins
ab5ac82db6 LibWeb/CSS: Parse dimension and number types individually
An upcoming change requires that we can determine which property we are
parsing before we parse the value. That's the opposite of what this
code previously did, which was to parse a generic dimension or calc()
and then figure out what property would accept it.
2025-01-08 14:28:54 +00:00
Sam Atkins
87da0453c8 LibWeb/CSS: Use parse_length_percentage() in parse_position_value()
Also some minor TokenStream-usage tweaks to make that possible.
2025-01-08 14:28:54 +00:00
Sam Atkins
e5c4a4e6c6 LibWeb/CSS: Parse gradient color stop positions directly
Rather than parsing a generic dimension and then converting it, just
parse the one we want to begin with.
2025-01-08 14:28:54 +00:00
Sam Atkins
34523f67cc LibWeb/CSS: Reuse dimension style value parsing code
Otherwise we're doing the same thing in two places.
2025-01-08 14:28:54 +00:00
Sam Atkins
f3a3344b9b LibWeb/CSS: Simplify parse_hue_none_value()
The motivation was to remove the parse_dimension() call, but this got a
lot smaller.
2025-01-08 14:28:54 +00:00
Sam Atkins
563f8572d5 LibWeb/CSS: Expand out parse_dimension_value()
When we know what kind of dimension we want, it's awkward to attempt to
parse any dimension type, including quirks that only affect lengths, to
then throw it away unless it's the type we wanted in the first place.

Additionally, move the unitless angle/length behavior for SVG attributes
into these methods, where it belongs.

Instead, only try to parse the type of dimension we want. This is
currently more code, but some could be factored together later.
2025-01-08 14:28:54 +00:00
Sam Atkins
f5b716c24d LibWeb/CSS: Simplify parsing of transform-function arguments
This was duplicating the logic in parse_length_value() and pals, so we
can switch to using those directly.
2025-01-08 14:28:54 +00:00
Tim Ledbetter
983540a244 LibWeb: Add missing spec links to HTML parser 2025-01-08 12:05:08 +00:00
Tim Ledbetter
27dbe49f00 LibWeb: Initialize OfflineAudioContext with correct defaults 2025-01-08 11:24:08 +00:00
Gingeh
2cac0dc20c LibWeb: Avoid crash from zero-duration transitions 2025-01-08 11:22:53 +00:00
Gingeh
8e56109515 LibWeb/CSS: Implement the light-dark color function 2025-01-08 11:18:13 +00:00
Gingeh
4a0ac312cc LibWeb: Obtain theme-color on meta element removal and modification 2025-01-08 11:18:13 +00:00
Gingeh
df70455d3f LibWeb: Implement the color-scheme meta tag name 2025-01-08 11:18:13 +00:00
Gingeh
ce5cd012b9 LibWeb/CSS: Implement the color-scheme CSS property 2025-01-08 11:18:13 +00:00
Sam Atkins
89296b88a0 LibWeb: Bring fragment parsing up to spec
Corresponds to https://github.com/whatwg/html/pull/10874

Also, parse_fragment() returns ExceptionOr, so stop voiding the error
from append_child().
2025-01-07 16:05:59 +01:00
Sam Atkins
7d502df807 LibWeb/DOM: Add Document::in_limited_quirks_mode() helper 2025-01-07 16:05:59 +01:00
stelar7
056b774b1e LibWeb: Provide default text for Reset and Submit buttons 2025-01-07 11:41:32 +00:00
InvalidUsernameException
c790cf2194 LibWeb: Prevent paths thinner than 1px from disappearing
SVGs are rendered with subpixel precision. As such it can happen that
paths are rendered with less than 1px width or height and that they can
have a bounding box thinner than 1px. Due to an optimization such paths
were ignored when painting because their bounding box was incorrectly
calculated to be empty.

As a result horizontal or vertical lines inside SVGs were missing if:
* The SVG is displayed at viewbox size but the lines are defined with
  less than 1px.
* The SVG contians 1px-thin lines, but is displayed at a size smaller
  than viewbox size.

To prevent this, the bounding box of the path is now enlarged to contain
all pixels that are partially affected.
2025-01-07 09:05:04 +00:00
Shannon Booth
b08db3dc1e LibWeb/HTML: Update editorial spec comments for Storage
See: https://github.com/whatwg/html/commit/8d2829a
2025-01-07 07:06:16 +00:00
Shannon Booth
7fee54b34e LibWeb/FileAPI: Update FIXME to point to spec bug
This is indeed a spec bug, and has been raised upstream to the FileAPI
spec.
2025-01-07 07:04:41 +00:00
Ryan Liptak
1ba15e1fa3 LibWeb: Fix hex character references accepting all alphabetic ASCII
Instead of just A-F/a-f, any char A-Z/a-z was being accepted as a valid
hexadecimal digit.
2025-01-07 00:43:41 +01:00
Ryan Liptak
df87a9689c LibWeb: Fix numeric character reference at EOF leaking its last digit
Previously, if the NumericCharacterReferenceEnd state was reached when
current_input_character was None, then the
DONT_CONSUME_NEXT_INPUT_CHARACTER macro would restore back before the
EOF, and allow the next state (after the SWITCH_TO_RETURN_STATE) to
proceed with the last digit of the numeric character reference.

For example, with something like `&#1111`, before this commit the
output would incorrectly be `<code point with the value 1111>1` instead
of just `<code point with the value 1111>`.

Instead of putting the `if (current_input_character.has_value())` check
inside NumericCharacterReferenceEnd directly, it was instead added to
DONT_CONSUME_NEXT_INPUT_CHARACTER, because all usages of the macro
benefit from this check, even if the other existing usage sites don't
exhibit any bugs without it:

- In MarkupDeclarationOpen, if the current_input_character is EOF, then
  the previous character is always `!`, so restoring and then checking
  forward for strings like `--`, `DOCTYPE`, etc won't match and the
  BogusComment state will run one extra time (once for `!` and once
  for EOF) with no practical consequences. With the `has_value()` check,
  BogusComment will only run once with EOF.

- In AfterDOCTYPEName, ConsumeNextResult::RanOutOfCharacters can only
  occur when stopping at the insertion point, and because of how
  the code is structured, it is guaranteed that current_input_character
  is either `P` or `S`, so the `has_value()` check is irrelevant.
2025-01-07 00:43:41 +01:00
Ryan Liptak
752deaf6ef LibWeb: Don't skip named-character-references test
This already passes, so there's no reason to skip it anymore
2025-01-07 00:43:41 +01:00
Andrew Kaster
223b13ae93 CMake: Enable -Wl,--no-undefined on ELF platforms
This is mostly a development helper, to move all undefined symbols
in shared libraries to link time rather than load time.

At the same time, set --no-allow-shlib-undefined and -z,defs to
further enforce the rule.
2025-01-06 12:41:47 -07:00
Andrew Kaster
5e43fec6dd CMake: Enable -Werror unconditionally 2025-01-06 12:41:47 -07:00
Psychpsyo
eb7824339b LibWeb: Improve user-select support 2025-01-06 12:22:37 +00:00
Pavel Shliak
6293556935 Meta: Update ffmpeg to 7.1 2025-01-06 12:29:02 +01:00
Aliaksandr Kalenik
5cac301bb7 LibWeb: Optimize hover style invalidation for shadow trees
With this change we skip all :hover selectors that don't belong to a
"style scope" (document or shadow root) of old/new hovered node.
2025-01-06 12:15:06 +01:00
Pavel Shliak
9e2eb93cc4 Meta: Update curl to 8.11.1 2025-01-06 11:46:49 +01:00
Tim Ledbetter
7356093af3 LibWeb: Fix selectionchange typo
This was a typo in the spec itself, which has since been fixed.
2025-01-06 08:55:00 +00:00