Paths in `headless-browser` tests were being compared by string value.
With this patch, they will be compared by their real path instead,
ensuring relative paths and symlinks are handled correctly.
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
This will no longer be true once we implement at-rules nested inside
style rules, for example:
```css
.foo {
color: yellow;
@media (min-width: 800px) {
color: orange;
}
}
```
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.
This implements the `is_valid_in_the_current_context()` methods by
maintaining a stack of contexts, such as whether we're inside a style
rule, or an `@media` block, or the condition of a `@supports` rule.
This is implemented by using a GPU-accelerated surface for <canvas> when
a GPU context is available.
A side effect of this change is that all canvas modifications have to be
performed through Gfx::Painter, and whenever its content has to be
accessed, we need to take a snapshot of the corresponding GPU surface.
A new DrawPaintingSurface display list command is introduced to allow
cheap blitting of canvas content without having to read GPU surface
content into RAM.
Since the Vulkan context is currently only used by LibGfx, it could be
moved there to avoid having Vulkan as a dependency for everything that
uses LibCore.
Since the Metal context is currently only used by LibGfx, it could be
moved there to avoid having Metal as a dependency for everything that
uses LibCore.
This is required to share GPU context creation code between display list
player, which resides in LibWeb, and PainterSkia, which handles <canvas>
painting.
We want the "raw" value here. The spec sort of assumes we are sending JS
values over the wire, whereas we are actually sending AK::JsonValue. So
using the JSON clone AO here is our best bet.
Chromium has a larger list of boolean attributes, and WPT depends on it.
We must also compare attribute names case-insensitively.
Note this method is only used by WebDriver.
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.
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.