This mainly uses forward declarations as appropriate for input element
related files. This reduces the number of targets being built when we
change HTMLInputElement.h from 430 to 44.
(cherry picked from commit 57e4fb0caebb0074a23bef70d7558ce5e8a5f357)
Previously, we would crash when attempting to establish a web socket
connection from inside a worker, as we were assuming that the ESO's
global object was a `Window`.
(cherry picked from commit 0c0595bb31db827fc14b5d16b8645bc6aa912d60)
If we decide to fetch another linked resource, we don't care about the
earlier fetch and can safely abort it.
This fixes an issue on GitHub where we'd load the same style sheet
multiple times and invalidate style for the entire document every time
it finished fetching.
By aborting the ongoing fetch, no excess invalidation happens.
(cherry picked from commit 57e26ed6b9b2c0cf1e4f5ac3e85ca0c7f3647caa)
...unless there are :has() selectors present. Then we have to invalidate
everything for now.
(cherry picked from commit b8ce34068f5bf8ab8cf049d56b864bff52ef3dff)
Character data nodes like text and HTML comments don't have style,
so let's just exit invalidation immediately for those.
(cherry picked from commit f351f75a34619ad969f660312a2e5486f742f685)
As useful as they may be to web developers, :has() selectors complicate
the style invalidation process quite a lot.
Let's have StyleComputer keep track of whether they are present at all
in the current set of active style sheets. This will allow us to
implement fast-path optimizations when there are no :has() selectors.
(cherry picked from commit 8beb7c77002a3359ad2fe73969fc6bb2dbc75413)
When an element is invalidated, it's possible for any subsequent sibling
or any of their descendants to also need invalidation. (Due to the CSS
sibling combinators, `+` and `~`)
For DOM node insertion/removal, we must also invalidate preceding
siblings, since they could be affected by :first-child, :last-child or
:nth-child() selectors.
This increases the amount of invalidation we do, but it's more correct.
In the future, we will implement optimizations that drastically reduce
the number of elements invalidated.
(cherry picked from commit df048e10f5a84d7fd90b1115c6bb90f45acd75ec)
We now expand shorthands into their respective longhand values when
assigning to a shorthand named property on a CSSStyleDeclaration.
We also make sure that shorthands can be round-tripped by correctly
routing named property access through the getPropertyValue() AO,
and expanding it to handle shorthands as well.
A lot of WPT tests for CSS parsing rely on these mechanisms and should
now start working. :^)
Note that multi-level recursive shorthands like `border` don't work
100% correctly yet. We're going to need a bunch more logic to properly
serialize e.g `border-width` or `border` itself.
(cherry picked from commit e40ad73ae79023f64e250f854d0730c21e0f54fc)
This fixes an issue where document.write() with only text input would
leave all the character data as unflushed text in the parser.
This fixes many of the WPT tests for document.write().
(cherry picked from commit a0ed12e839f14b3ac80caca0e18a09ca256fd99d)
Instead of trying to locate the relevant StyleSheetList on style element
removal from the DOM, we now simply keep a pointer to the list instead.
This fixes an issue where using attachShadow() on an element that had
a declarative shadow DOM would cause any style elements present to use
the wrong StyleSheetList when removing themselves from the tree.
(cherry picked from commit 8543b8ad6a4d96bd0c247052572b8c2abf3929a7)
This patch implements `Range::getClientRects` and
`Range::getBoundingClientRect`. Since the rects returned by invoking
getClientRects can be accessed without adding them to the Selection,
`ViewportPaintable::recompute_selection_states` has been updated to
accept a Range as a parameter, rather than acquiring it through the
Document's Selection.
With this change, the following tests now pass:
- wpt[css/cssom-view/range-bounding-client-rect-with-nested-text.html]
- wpt[css/cssom-view/DOMRectList.html]
Note: The test
"css/cssom-view/range-bounding-client-rect-with-display-contents.html"
still fails due to an issue with Element::getClientRects, which will
be addressed in a future commit.
(cherry picked from commit 75c7dbc5d2dd045733a4c319aeab6644b5b7b36d)
The current min/max zoom levels are supposed to be: 30% and 500%.
Before, due to floating point error accumulation in incremental addition
of zoom-step into zoom-level, one extra zoom step would get allowed,
enabling user to zoom 20%-to-510%.
Now, using rounding, the intermediate zoom-level values should be as
close to the theoretical value as FP32 can represent. E.g. zoom-level of
70% (theoretical multiplier 0.7) is 0.69... .
(cherry picked from commit 96335f31d5a8c6180a4cc0254585bc01ba6742fa)
Before this change, we were cascading custom properties for each layer,
and then replacing any previously cascaded properties for the element
with only the set from this latest layer.
The patch fixes the issue by making each pass of the custom property
cascade add to the same set, and then finally assigning that set of
properties to the element.
(cherry picked from commit 95bd0602ba079e0bd7608e39bcbc3b0403ed89d1)
Before this change, if would a tab it will pass the add new tab button
(+ button).
closes#1124
(cherry picked from commit 9b79081a0601ef6649592acc1025b12c52e63d5c)
Currently we are crashing in `verify_cast<BlockContainer>(box)` on
attempt to create BFC for SVG box.
(cherry picked from commit fa907029ee6f202095011b84b109bc4a2b56c58b)
This change moves the `crypto()` getter from `Window` to
`WorkerOrWindowGlobalScope`. This aligns our implementation with the
WebCrypto specification.
(cherry picked from commit 89b6cd3fb1b9a3058dbada9e12606950b466936a)
...because calculate_inner_width() assumes layout state has resolved
paddings that could be used to account for "box-sizing: border-box".
Fixes regression introduced in 5f74da6ae8ad470ad0ce325f570faa97292384ba
(cherry picked from commit d6a31d80c05db05c34cd56ca865658a5b82dbb69)
Reftest screenshots are now captured using the dimensions specified in
the draw a bounding box from the framebuffer AO defined in the
WebDriver specification.
(cherry picked from commit b4aff45854bd0d9aaaf76cdbb4f07411bd240755)
Use this cached pointer to the containing block's used values when
obviously possible. This avoids a hash lookup each time, and these
hash lookups do show up in profiles.
(cherry picked from commit bdb67d2bcb4ab6fa49292c3365facdeab1fd0e20)
Previously `#keyword` was used in the macro, meaning all keywords
gained `""` around them
(cherry picked from commit d828d80b756468eb343aec074e7c9944d129437f)
Previously, right clicking highlighted text in the location bar would
cause the current selection to be lost.
(cherry picked from commit 6c608bac659b7e39be52ffecd68ecd46172665bc)
This change adds the [CEReactions] attributes to all ARIA attributes in
the ARIAMixin WebIDL — as required by the WebIDL in the current spec at
https://w3c.github.io/aria/#ARIAMixin, and by the WPT test case at
http://wpt.live/custom-elements/reactions/AriaMixin-string-attributes.html,
and as implemented in other existing engines.
Otherwise, without this change, Ladybird doesn’t conform to the current
spec, fails all those tests, and isn’t interoperable with other engines.
(cherry picked from commit 6bf3d34a6709b5067be0b705ce5a8ed8d4cbfa00)
Following the structure of the ReleaseActions endpoints, define
analogous classes and methods for PerformActions
(cherry picked from commit ee352e59dbd4d2b8fbfbec396cb5232a13291274)
Previously, there was a bug in the specification that would cause an
assertion failure, due to the abort event being fired before all
dependent signals were aborted.
(cherry picked from commit 3ae4ea7b10e5022079d0b203844fc93899c08a09)
Fixes a bug when "'Await' expression is not allowed in formal parameters
of an async function" is thrown for "await" encountered in a function
definition assigned to a default function parameter.
Fixes loading of https://excalidraw.com/
(cherry picked from commit 10064d0e1a89a4f48dc1e896de35a65f2ab946f4)
Added the following Routes, IPC definitions, and boilerplates for the
missing endpoints:
- Switch To Frame
- Switch To Parent Frame
- Element Clear
- Element Send Keys
(cherry picked from commit d1ba317e22d41fd948fd477d44735918a972c158)
This didn't make any sense, and was already handled by pushing a new
execution context anyway.
By simply removing these bogus lines of code, we fix a bug where
throwing inside a function whose bytecode was shorter than the calling
function would crash trying to generate an Error stack trace (because
the bytecode offset we were trying to symbolicate was actually from
the longer caller function, and not valid in the callee function.)
This makes --log-all-js-exceptions less crash prone and more helpful.
(cherry picked from commit b3f77e47690cfd07058d824ea6f0b652489778bf)
This change adds green and red pass/fail emoji indicators to an in-tree
test — to make it easier to manually scan through the test results and
quickly see which cases are passing, and which are failing.
(cherry picked from commit 6f5d0de5e780f10c63d168bb1d29c69a963376ac)
This commit implements the setter for `location.search`, allowing
updates to the query string of the URL.
(cherry picked from commit 514a2a1757b10b9b4ff020237c84f70ba5a79c4b)