Commit graph

3898 commits

Author SHA1 Message Date
Jelle Raaijmakers
d53cb9833b LibWeb: Add WebGLRenderbuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
6b7d5dbec6 LibWeb: Add WebGLProgram 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
5d0b206d6e LibWeb: Add WebGLFramebuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
b21857b265 LibWeb: Add WebGLBuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
e6ee7f3e64 LibWeb: Add WebGLObject interface 2024-11-13 11:41:54 +01:00
Michael Watt
3b1d1d4582 LibWeb: Compute display: contents as none for unusual elements
https://drafts.csswg.org/css-display-3/#unbox-html specifies certain
elements that have their `display` style computed as `none` when
specified as `contents`.

This fixes at least one WPT test:
http://wpt.live/css/css-display/display-contents-suppression-dynamic-001.html
2024-11-13 11:11:07 +01:00
Aliaksandr Kalenik
d0646236ca Tests/LibWeb: Import some CSSOM WPT tests 2024-11-13 11:07:14 +01:00
Luke Wilde
faf6fd1189 LibWeb: Remove LegacyOverrideBuiltIns flag from Storage
This was preventing https://ubereats.com/ from fully loading, because
they are attempting to overwrite setItem. They seem to be trying to add
error logging to setItem if it throws, as all they do is add a
try/catch block that emits an error log to their monitoring service if
it throws.

However, because Storage is a legacy platform object with a named
property setter (setItem), it will call setItem with the stringified
version of the function. This is actually expected as per the spec,
Firefox (Gecko) and Epiphany (WebKit) does this too, but Chromium does
not as it actually overwrites the function with the new function and
does not store the stringified function.

The problem is that we had the LegacyOverrideBuiltIns flag accidentally
set, so it would return the stored string instead of the built-in
function (hence the name), then it would try and call it and throw a
"not a function" error. This prevented their JS from going any further.

This fix allows their UI to fully load and be fully interactive, though
it is quite slow at the moment!
2024-11-12 15:34:36 +01:00
Ali Mohammad Pur
dabd60180f LibRegex: Don't ignore references that weren't bound in checked blocks
Fixes #2281.
2024-11-12 10:37:57 +01:00
sideshowbarker
eed20ad951 Tests: Import WPT accname/name/comp_name_from_content.html test 2024-11-11 14:56:46 -07:00
Aliaksandr Kalenik
a8c1d12e84 LibWeb: Fix percentage insets resolution for grid items
compute_inset() was incorrectly retrieving the containing block size
because containing_block() is unaware of grid areas that form a
containing block for grid items but do not exist in the layout tree.
With this change, we explicitly pass the containing block into
compute_inset(), allowing it to correctly provide the containing block
sizes for grid items.
2024-11-11 20:20:39 +01:00
Sam Atkins
676e54c397 Tests: Un-skip css-nesting/top-level-is-scope.html test
This no longer crashes.
2024-11-11 20:19:41 +01:00
Aliaksandr Kalenik
bd50a31be6 Tests/LibWeb: Import CSS floats tests from WPT 2024-11-11 13:31:35 +01:00
Gingeh
6862d33e7c LibWeb: Don't crash from clipping grid spans 2024-11-11 00:57:10 +01:00
rmg-x
9ee7d4d90a LibWeb: Add builtin Float16Array type and remove related FIXME 2024-11-10 14:48:20 -07:00
Shannon Booth
653c8f231d LibWeb: Implement HTMLElement.innerText setter 2024-11-10 21:31:30 +01:00
Aliaksandr Kalenik
dd11d48a1d LibWeb: Use available space to resolve sizes in FFC
If available space is definite it should always match the size of the
containing block. Therefore, there is no need to do containing block
node lookup.
2024-11-10 19:14:54 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Cory Virok
39f844f77c LibWeb/Tests: Added example test for how to use http-test-server.py
The example shows how to write a test that depends on custom HTTP
headers in the response. This will be useful for testing browser JS
that depends on how Ladybird processes response headers, eg CORS
headers like Access-Control-Allow-Origin and others.
2024-11-09 13:08:31 -07:00
Cory Virok
97d47a38c9 Meta: Add an HTTP echo server to help with testing Browser JS
This allows us to simulate HTTP responses from Browser JS tests.
Instead of using hacks like data URLs to "load" external data,
we can now generate an actual HTTP response that contains
arbitrary headers, body, and has a defined response delay.
2024-11-09 13:08:31 -07:00
stasoid
31bf40b659 AK: Make LexicalPath::relative_path() fallible 2024-11-09 12:42:27 -07:00
Shannon Booth
457cdd0cc3 LibWeb: Wire up UniversalGlobalScopeMixin to ShadowRealmGlobalScope 2024-11-09 12:36:12 -07:00
Shannon Booth
2ea31fad32 LibWeb: Add support for interfaces being exposed for shadow realm 2024-11-09 12:36:12 -07:00
Andreas Kling
107b20e84d LibWeb: Restrict CSS gap properties to values allowed by the spec
Gap values are now represented by Variant<LengthPercentage, NormalGap>.
NormalGap is just an empty struct to represent the `normal` keyword.

This fixes a long-standing issue where we were incorrectly storing gaps
as CSS::Size, which led to us allowing a bunch of invalid gap values.
2024-11-09 19:21:00 +01:00
Andreas Kling
2a741f81c7 Tests: Import some WPT tests for the CSS gap properties 2024-11-09 19:21:00 +01:00
Lucas CHOLLET
d0dfc0c3e1 Tests: Import WPT tests from css-color
Specifically, they are related to parsing the `lab()`, `lch()` and
`color(xyz-d50 ...)` color functions.
2024-11-09 17:53:53 +01:00
Lucas CHOLLET
10dc7ff042 LibWeb/CSS: Support the xyz-d65 colorspace in the color() function
This also adds support for `xyz` as it defaults to `xyz-d65`. We now
pass the following WPT tests:
 - css/css-color/xyz-001.html
 - css/css-color/xyz-002.html
 - css/css-color/xyz-004.html
 - css/css-color/xyz-d65-001.html
 - css/css-color/xyz-d65-002.html
 - css/css-color/xyz-d65-004.html
2024-11-09 15:15:36 +01:00
Sam Atkins
7a104fef66 LibWeb/CSS: Make non-nested & selector have 0 specificity
If a & simple selector is on a style rule with no parent style rule,
then it behaves like :scope - but notably, :scope provides 1
specificity in the class category, but & is supposed to provide 0.

To solve this, we stop replacing it directly, and just handle the & like
any other simple selector. We know that if the selector engine ever
sees one, it's equivalent to :scope, because the nested ones will have
been replaced with :is() before that point.

This gets us one more subtest pass. :^)
2024-11-09 14:29:37 +01:00
Sam Atkins
219346011b LibWeb/CSS: Require that tag-name simple selectors go first
This fixes 1 subtest.
2024-11-09 14:29:37 +01:00
Sam Atkins
a0403ac427 LibWeb: Add & when setting nested style rule's selector text
When we first parse a nested CSSStyleRule's selectors, we treat them as
relative selectors and then patch them up with an `&` as needed.
However, we weren't doing this when assigning the `cssText` attribute.
So, let's do that!

This gives us a couple of subtest passes. :^)
2024-11-09 14:29:37 +01:00
Shannon Booth
45537efcef LibWeb: Enable callbacks for ByteStreamTeeBYOBReadRequest::on_chunk
Fixes a crash running the imported WPT test.
2024-11-09 08:10:57 -05:00
Shannon Booth
d31014d135 LibWeb: Reorder step to get chunk size after checking for aborted stream
This fixes a crash seen on:

http://wpt.live/streams/writable-streams/aborting.any.html

I believe this is a spec bug, which has been reported to the Streams
spec.
2024-11-09 08:09:54 -05:00
sideshowbarker
3594cdf948 LibWeb: Fix accessible-name computation for “tooltip” & empty-alt cases
This change fixes accessible-name computation for:

- an element that has empty text content but that also has a title
  attribute (“tooltip”) with a non-empty value
- an img element whose alt attribute is the empty string but that also
  has a “title” attribute with a non-empty value

Otherwise, without this change, the accessible name unexpectedly isn’t
computed correctly for those cases.
2024-11-09 08:08:05 -05:00
Timothy Flynn
52c828be2b LibWeb: Disable slow imported CSS animation tests 2024-11-08 15:02:30 -05:00
stelar7
54b5822e0b LibWeb: Add IDBVersionChangeEvent 2024-11-08 11:10:15 -07:00
stelar7
60ae5e75f8 LibWeb: Implement the IDBDatabase interface 2024-11-08 11:10:15 -07:00
Sam Atkins
1cc83db0c9 Tests: Disable an animation test that's flaky on CI 2024-11-08 10:12:42 -07:00
Andreas Kling
87dd8714c5 Tests: Import WPT tests from css/css-backgrounds/animation
These give us some basic coverage of backgrounds, borders and animation
mechanisms.
2024-11-07 22:50:33 +01:00
Sam Atkins
b0e79ce549 Tests: Import all WPT css/css-nesting tests
A few are skipped for now:
- A few ref tests fail
- Crash tests are not supported by our runner and time out
- top-level-is-scope.html crashes and needs further investigation
2024-11-07 15:11:24 +01:00
Sam Atkins
0b23dddb4b LibWeb/CSS: Clear child CSS rules' caches too
If a rule gets its caches cleared because it's moved in the OM, then its
child rules' caches are likely invalid and need clearing too.

Assuming that caches only point "upwards", this will correctly clear
them all. For the time being that will be true.
2024-11-07 15:11:24 +01:00
Sam Atkins
a9a25d4eca Tests: Add a test for @supports
This is derived from our old demo page.

Notably, we currently do claim to support `::-webkit-foo` selectors,
which is a bug. According to the spec [1], we have to parse those as
valid, but `@supports` should still fail for them [2], which is a bit
confusing.

[1] https://www.w3.org/TR/selectors-4/#compat
[2] https://drafts.csswg.org/css-conditional-4/#support-definition-ext
2024-11-07 15:11:24 +01:00
Tim Ledbetter
29f419d637 Tests: Import an xht test from WPT 2024-11-07 12:02:31 +00:00
Pavel Shliak
1389ae02be LibGfx: Fix 24bit BMPs being transparent and send them as RGBx to Skia 2024-11-07 12:27:00 +01:00
Andreas Kling
81e75530d9 LibWeb: Make :nth-* selectors match children of non-elements
Some checks failed
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Build Dev Container Image / build (push) Has been cancelled
This was covered by WPT, which caught us not allowing :nth-child(1)
to match the root HTML element, and other similar issues.
2024-11-06 21:42:53 +01:00
Andreas Kling
eeba30f988 LibWeb: Allow :link and :any-link to match SVG <a> elements 2024-11-06 21:42:53 +01:00
Andreas Kling
92d9907f8f LibWeb: Add style invalidation for :target, :focus, :active and :link 2024-11-06 21:42:53 +01:00
Andreas Kling
1045000c28 LibWeb: Style invalidation for DOM node removal needs to happen earlier
We can't invalidate after the removal has taken effect, since that means
invalidation won't be able to find potentially affected siblings and
ancestors by traversing from the invalidation target.
2024-11-06 21:42:53 +01:00
Andreas Kling
adfc69bc67 LibWeb: Add style invalidation for :defined selector 2024-11-06 21:42:53 +01:00
Andreas Kling
6c945fc353 Tests: Import more CSS selector tests from WPT 2024-11-06 21:42:53 +01:00
Andreas Kling
9dff6bca1f Tests: Import more style invalidation tests from WPT
These will help us work on style invalidation with more confidence.
2024-11-06 21:42:53 +01:00
Sam Atkins
8f21513902 Tests: Re-import tests that used ahem.css
This causes 36 new subtests to pass locally. :^)

Unfortunately at least one of these is flaky when it's able to load the
font file, apparently because we don't wait for the font and its
stylesheet to actually load before the tests run.
2024-11-06 20:03:38 +01:00
Sam Atkins
a8b3d363cc Tests: Annotate reasons for skipping LibWeb tests
Eventually we want to stop skipping these, so it's helpful to know why
they were skipped in the first place. :^)

I've grouped them together by reason, so the order has changed a little.

For some of these the reason isn't clear.
2024-11-06 20:03:38 +01:00
Gingeh
f88f41cf1e LibWeb: Reject invalid processing instructions 2024-11-06 18:48:50 +01:00
Piotr
06154b87dd LibWeb: Support for "content-language" http-equiv state
Implemented support for setting the pragma-set default language in the
`<meta/>` tag with an `http-equiv` attribute `content-language`.
2024-11-06 10:56:57 +01:00
Hermes Junior
5dabd468ed LibWeb: Fix out-of-bound crash when there's more table cells than cols
Added a getter to ensure we are within a valid range.
This behavior is accepted by other browsers,
and crashed on some pages.
2024-11-06 09:36:33 +00:00
Gingeh
cd5d8f4d95 LibWeb: Handle steps(x, start) like steps(x, jump-start) 2024-11-06 09:27:53 +00:00
Pavel Shliak
672590c360 Tests: Remove duplicated test for FloatingPointParsing 2024-11-06 09:22:44 +00:00
Pavel Shliak
5fe1d38955 Tests: Remove duplicated test for UnicodeCharacterTypes 2024-11-06 09:22:44 +00:00
Pavel Shliak
cf5521ec68 Tests: Remove duplicated test for StringView 2024-11-06 09:22:44 +00:00
Gingeh
453e034801 LibXML: Read code points when parsing names 2024-11-06 10:07:52 +01:00
Aliaksandr Kalenik
42b31820a6 LibWeb: Use UTF-16 code units length in CharacterData::replace_data()
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Range API uses UTF-16 code units to represent offsets, so replace_data()
needs to use it instead of bytes count while calculating new offsets.

Fixes incorrectly thrown exception when non-latin string is passed into
replace_data().
2024-11-06 05:46:30 +00:00
Sam Atkins
f5d67cefc1 Tests: Import a couple of CSS nesting tests from WPT
This is partly to check that importing ref tests works, and that I
didn't break the text-test import.
2024-11-05 17:58:16 +00:00
Shannon Booth
9598ed1d17 LibWeb: Hook up the HostInitializeShadowRealm callback
This is enough for a basic shadow realm to work :^)

There is more that we still need to implement here such as module
loading and fixing up the global object, but this is enough to get some
basic usage working.
2024-11-05 10:43:08 -07:00
Shannon Booth
c69a9812c8 LibWeb: Introduce the 'ShadowRealmGlobalScope' interface
This object represents the global object for a shadow realm. The IDL
generator will need to be adjusted to the '[Global]' extended attribute
and no '[Exposed]' field (the change in the test is not correct, as I
understand it), but this should be enough to get us started on
shadow realms.
2024-11-05 10:43:08 -07:00
Aliaksandr Kalenik
75e26af117 Tests/LibWeb: Import css grid alignment tests from WPT 2024-11-05 17:44:08 +01:00
Aliaksandr Kalenik
3833049fc8 Meta+Tests: Substitute Ahem font path in import-wpt-test.py 2024-11-05 17:44:08 +01:00
Sam Atkins
b7efb61fbe Tests/LibWeb: Restructure Ref and Screenshot test dirs to match others
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Now each test type has the same directories:
- input
- expected
- data

Also, tests can be in subdirectories within ./input.
2024-11-05 14:02:07 +00:00
Sam Atkins
08253d6aee Tests/LibWeb: Move assets used by multiple test types into Assets/
Having to go through multiple levels of .. is not ideal, but less odd
than reaching into another test type's data files.
2024-11-05 14:02:07 +00:00
Gingeh
a4b38dda56 LibWeb: Use substrings instead of pointers when parsing unicode ranges
Fixes a segfault when parsing a wildcard-only unicode range
2024-11-05 14:01:45 +00:00
Andreas Kling
ceedfb34d2 LibWeb: Look at both namespace & tag name in HTML parser stack checks
We were neglecting to check the namespace when looking for a specific
type of element on the stack of open elements in many cases.

This caused us to confuse HTML and SVG elements.
2024-11-05 12:29:27 +01:00
Andreas Kling
49b88fc095 LibWeb: Don't compare against HTML-uppercased tag names in HTML parser
Element::tag_name() returns an uppercased string for HTML elements,
which is usually not what's expected by the parser algorithms that look
at tag names.
2024-11-05 12:29:27 +01:00
Gingeh
d1b967bca5 LibWeb: Consider every row when calculating table width 2024-11-05 10:58:11 +00:00
Gingeh
c67ecf37f7 LibWeb: Implement linear easing according to latest spec 2024-11-05 10:41:29 +00:00
Kostya Farber
373c80db68 LibWeb: Start implementing letter spacing
Letter spacing is applied during text shaping and `shape_text` is used
in places other `InlineLevelIterator` so way may have more work to do,
however this is a good start :^).
2024-11-05 10:40:22 +00:00
Pavel Shliak
38bb8ce0de LibWeb: Modify table formatting according to spec
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Makes Sub, Super, TextBottom, TextTop vertical aligns equal to Baseline
2024-11-04 14:54:32 +00:00
Sam Atkins
ebbef87243 Tests: Skip flakey css/cubic-bezier-infinite-slope-crash.html test
This has been consistently timing-out on CI.
2024-11-04 12:50:44 +00:00
Piotr
e2613090ed LibWeb: Handle empty string in lang attribute
If the attribute value is the empty string `(lang="")`, the language
is set to unknown. `lang` attribute higher up in the document tree
will no longer be applied to the content of that element.
2024-11-04 12:06:32 +00:00
Quentin Ligier
e099a452b1 LibWeb: Add tests for the CSS4 color functions 2024-11-04 10:48:10 +00:00
Tim Ledbetter
56441fe3e6 LibWeb: Don't crash when input with no associated text node loses focus 2024-11-04 10:08:34 +00:00
Timothy Flynn
50a31f9728 LibWeb: Abort early processing frame/iframe attrs for null navigables
We guarded one step against a null navigable, but the very next step
also needs to be protected. Let's just abort early instead. This was
caught by the following imported WPT test:

html/dom/elements/the-innertext-and-outertext-properties/innertext-setter.html

This test adds a <frame> element and immediately removes it, but the
task to process the src attribute is already queued. Note that <iframe>
would have the same issue, but this test does not include them.
2024-11-04 09:54:32 +00:00
Timothy Flynn
16def85153 LibWeb: Implement HTMLFrameElement as a NavigableContainer
NavigableContainer is our home grown concept which already contains the
AOs needed for frame and iframe elements. This patch simply aligns our
HTMLFrameElement implementation with this class.

A couple of notes:

1. The <script> in the <head> element is intentional. The <frameset>
   element effectively takes the place of the <body> element, and we
   cannot add a <script> to a <frameset> element.

2. We don't render <frameset> or <frame> at all. Rendering is defined
   in the following spec:
   https://html.spec.whatwg.org/multipage/rendering.html#frames-and-framesets

3. If you load the test page in your browser, you won't see anything,
   regardless of (2). Our test infra adds a <pre> element to the "body"
   element (which is the <frameset> element here). Such children will
   never be rendered. In the future, we could come up with something
   better for our test infra to do, but this isn't important anyways
   for this test - we can still grab the <pre> element's innerText.
2024-11-04 09:54:32 +00:00
Timothy Flynn
cfcb29bdfd AK+LibUnicode: Add a method to trim non-ASCII whitespace from a String
Required by WebDriver.
2024-11-03 20:42:46 -05:00
Andreas Kling
969ee0f3e0 LibJS: Make DataView::byte_offset() return u32
This fixes structured serialization of DataView. It was expected
to be uniform with TypedArray, which returns u32 for byte_offset().

This was covered by a number of WPT infrastructure tests, which this
commit also imports.
2024-11-04 00:22:40 +01:00
Aliaksandr Kalenik
d13011bfbc Tests/LibWeb: Import WPT tests for CSS grid properties parsing
Increase test coverage for our grid implementation.
2024-11-03 22:02:29 +01:00
rmg-x
0db171c36e LibWeb/Crypto: Fix sizes being passed into generate_aes_key()
Previously, callers were passing the size in bytes, but the method
expected bits. This caused a crash in LibCrypto when verifying the key
size later on.

Also make the naming of local variables and parameters a little more
clear between the different AES algorithms :^)
2024-11-03 21:55:43 +01:00
Andreas Kling
64747c0397 LibWeb: Make HTML parser "current node" APIs return nullable pointer
It's actually possible for there to be no adjusted current node, when
the stack of open elements is empty. This was covered by one of the WPT
parsing tests.
2024-11-03 20:32:32 +01:00
Andreas Kling
0a47d8cb08 LibWeb: Handle more MathML/HTML integration points in the parser 2024-11-03 20:32:32 +01:00
Andreas Kling
ae39c54e51 LibWeb: Fix SVG tag adjustment for feSpotLight, feTile, feTurbulence 2024-11-03 20:32:32 +01:00
Andreas Kling
88a4a86ece Tests: Import many HTML parsing tests from WPT
I had to skip a lot of these due to assertion failures that we need to
investigate before unskipping.
2024-11-03 17:51:44 +01:00
Gingeh
c2cd191864 LibWeb: Use machine epsilon when approximating cubic bezier 2024-11-03 17:35:20 +01:00
BenJilks
80e7e6dd7d LibWeb: Layout inline elements respective of writing-mode
Use the `writing-mode` property to determine what values should be used
for computing each element's rect on the screen. If it is a vertical
mode, swap the inline and block, lengths and offsets.

This only lays out whole inline formatting contexts vertically, and does
not currently support mixing the two orientations in a single context.
2024-11-03 17:01:54 +01:00
BenJilks
c3f3e93b7e LibWeb: Add writing-mode CSS property, and its values
Introduce the `writing-mode` property, as specified in
https://drafts.csswg.org/css-writing-modes/#block-flow
2024-11-03 17:01:54 +01:00
Aliaksandr Kalenik
2bd43e3603 LibWeb: Remove save() call in DisplayListPlayerSkia::add_mask()
This save() call did not have matching restore(). For mask application
it's display list builder responsibility to emit save() and restore()
so mask is applied only to relevant portion.

Progress on https://www.jetbrains.com/
2024-11-03 11:25:01 +01:00
Timothy Flynn
13b7355ec1 LibWeb: Move some classes from the DOM namespace to the HTML namespace
The following classes are in the HTML spec and thus belong in the HTML
namespace:

* BeforeUnloadEvent
* HTMLFormControlsCollection
* RadioNodeList
2024-11-02 11:16:45 -04:00
Gingeh
c4e8eeb9a3 LibWeb: Don't crash on transformed clip-paths
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
We can remove this check and FIXME because we already support them
2024-11-02 04:30:14 +00:00
sideshowbarker
437879f849 LibWeb: Correctly descend element nodes when computing accessible name
This change implements the “is a descendant of a native host language
text alternative element” condition in the “F: Name From Content” step
at https://w3c.github.io/accname/#step2F in the “Accessible Name and
Description Computation” spec — to ensure that all descendant nodes get
included as expected in computations for accessible names for elements.

Otherwise, without this change, Ladybird unexpectedly skips descendant
element nodes when computing accessible names — which can result in the
wrong accessible name being returned.
2024-11-01 18:13:41 -04:00
Shannon Booth
472b56b47c LibWeb: Propagate exception if serializing inner node fails
Fixing a crash for the given test.
2024-11-01 14:02:14 -04:00
Shannon Booth
4dd912e686 LibWeb: Rebaseline XHTML test case
At some point we must have broken the ability of running XHTML test
cases, so the whitespace expectation changes have not been rebaselined
for this test case.
2024-11-01 14:02:14 -04:00
Andrew Kaster
36feebb1e7 LibWeb: Add Wasm Web-API streaming compilation and instantiation
This requires fixing up the "parameter is a promise" handling in
the IDL generator.
2024-11-01 10:42:24 -07:00
Andrew Kaster
ba6dcd7521 LibWeb: Refactor WebAssembly API to use spec-defined promise AOs 2024-11-01 10:42:24 -07:00