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.
For example, a few ref tests have a match like this:
```
<link rel="match"
href="/css/reference/ref-filled-green-100px-square-only.html">
```
Previously we'd interpret this as `http://css/reference/...` which made
the test runner sad.
Because of this we no longer have to handle ahem.css in a special way.
This should find:
- <link rel=stylesheet>
- CSS `@import`s
- Any resources linked from a stylesheet with `url()`
There's a good chance there are other resources we'll want to copy too,
but CSS was a big hole.
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.
This works around an issue in upstream skia where a debug build with
dynamic libraries includes an extra file in the skparagraph module
that is not compilable on macOS.
By using static linkage, we are opening ourselves up to ODR violations
that result in runtime crashes (rather than build-time link errors). For
example, we've seen this happen while trying to use Skia context in both
LibGfx and LibWeb.
In addition to changing the build-type dependent build directories, we
can take this opportunity to move the vcpkg cache directory to the Build
folder itself. This probably isn't 100% needed, but it ensures that no
leftover artifacts are used from non-dynamic vcpkg builds, and it's also
generally nice to have all build artifacts under Build.
The reason for this change is that CMake/vcpkg are unable to detect a
change to VCPKG_LIBRARY_LINKAGE. So when we switch to dynamic builds,
the switch would be non-functional, and every developer would have to
remove their Build and vcpkg cache directories manually. By changing
these directories, vcpkg is able to detect it must rebuild.
Using install(IMPORTED_RUNTIME_ARTIFACTS), we can re-export the
shared library and frameworks we imported from outside the build
tree into our install treer. This is required for simdutf as it
is a dependency of the AK library, and we need liblagom-ak.so to
be loadable when doing fuzzer and cross-compile builds for the
Lagom tools.
While traversing the DOM tree, looking for nodes that need a style
update, we were recomputing style for every node visited along the way,
even nodes that didn't themselves need a style update (but one of their
descendants did).
This avoids a bunch of completely unnecessary style recomputation on
basically every website.
This class was being copied all over the place, however, most of these
cases can be easily prevented with `auto const&` or `NonnullRawPtr<>`.
It also didn't have a move constructor, causing `Vector` to copy on
every resize as well.
Removing all these copies results in an almost 15% increase in
performance for CSS parsing, as measured with callgrind.
It is a non-null `T*` with reference semantics.
Or a `T&` whose address can be copied and re-assigned.
Or a `NonnullRefPtr` whose memory is not managed.
It can be useful when you want to store a reference in a
data structure that needs to be copyable or assignable.
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().
The spec is a bit out-of-date here, so this works around an issue with
closing top-level traversables while a dialog is open in another window
within the same agent.
For example, if a dialog is open and the session is configured to ignore
dialogs (instead of automatically closing them), then the Close Window
endpoint will have failed. We can't remove the client-side window handle
in that case.
Capabilities are configured on a per-session basis, but we were only
applying these options to the first WebContent process created. We will
need to pass these options to new windows created from that process.
This patch re-organizes capability processing so that our session can
remember them for new windows.
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.