Changed the usage from `add_libweb_test.py test_name.html` to
`add_libweb_test.py test_name.html test_type` with no default,
and supports automatically generating input/output files in the
right directories for test types Screenshot, Text, Ref, and Layout.
Co-authored-by: Sam Atkins <sam@ladybird.org>
As many other projects, Ladybird has more than a few TODO and FIXME
comments sprinkled throughout the codebase. These can be a great
inspiration or starting point for contributors looking for work, so
we mention them in the docs on contributing to the project.
When we originally implemented calc(), the result of a calculation was
guaranteed to be a single CSS type like a Length or Angle. However, CSS
Values 4 now allows more complex type arithmetic, which is represented
by the CSSNumericType class. Using that directly makes us more correct,
and allows us to remove a large amount of now ad-hoc code.
Unfortunately this is a large commit but the changes it makes are
interconnected enough that doing one at a time causes test
regressions.
In no particular order:
- Update our "determine the type of a calculation" code to match the
newest spec, which sets percent hints in a couple more cases. (One of
these we're skipping for now, I think it fails because of the FIXMEs
in CSSNumericType::matches_foo().)
- Make the generated math-function-parsing code aware of the difference
between arguments being the same type, and being "consistent" types,
for each function. Otherwise those extra percent hints would cause
them to fail validation incorrectly.
- Use the CSSNumericType as the type for the CalculationResult.
- Calculate and assign each math function's type in its constructor,
instead of calculating it repeatedly on-demand.
The `CalculationNode::resolved_type()` method is now entirely unused and
has been removed.
Add a formatter output to the flake (`nix fmt`), along with moving +
renaming the devshell so it will work by running `nix-shell` in the root
of the project.
This change updates the (advanced) build docs to explain how to do a
Debug build with the CXX `-O0` option set — which tells the compiler to
build with no optimizations at all.
Otherwise, Debug builds use the `-Og` option — which, when trying to
check frame variables in a debugger can result in an error of this form:
> error: Couldn't look up symbols: __ZN2AK6Detail10StringBaseD2Ev
> Hint: The expression tried to call a function that is not present in
> the target, perhaps because it was optimized out by
> the compiler.
The requirement to use // for comments wasn't described anywhere, so now
it is! Also updated the rule about TODO comments because we've allowed
those for a while now.
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:
* JS::NonnullGCPtr -> GC::Ref
* JS::GCPtr -> GC::Ptr
* JS::HeapFunction -> GC::Function
* JS::CellImpl -> GC::Cell
* JS::Handle -> GC::Root
The CSSOM spec tells us to potentially add up to three different IDL
attributes to CSSStyleDeclaration for every CSS property we support:
- A camelCased attribute, where a dash indicates the next character
should be uppercase
- A camelCased attribute for every -webkit- prefixed property, with the
first letter always being lowercase
- A dashed-attribute for every property with a dash in it.
Additionally, every attribute must have the CEReactions and
LegacyNullToEmptyString extended attributes specified on it.
Since we specify every property we support with Properties.json, we can
use that file to generate the IDL file and it's implementation.
We import it from the Build directory with the help of multiple import
base paths. Then, we add it to CSSStyleDeclaration via the mixin
functionality and inheriting the generated class in
CSSStyleDeclaration.
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.
`git` and `bash` are most likely already installed, `bash` is part of
`base-system`, and `git` is required to pull the repository in the
first place, but they are not included in `base-minimal` or
`base-container`, and they ARE required for a successful build,
so I have added them regardless.
`qt6-tools-devel` and `qt6-wayland-devel` were not required to compile
and link Ladybird on my machine, but I have included them as they are
installed on the other Linux distributions.
Bring together the docs on running tests, with the ones on writing them
which were hidden in Browser/Patterns.md
I've made a few adjustments while I was at it, because RunningTests.md
was a bit outdated and didn't mention `Meta/ladybird.sh test`. It's
possible they're still outdated and wrong, but I'm not familiar enough
with that area to know.
Update the base image and the feature images
Add new packages to the install.sh command
as they are now needed by some dependencies, that are built via vcpkg
Add newer clang version, but the default stays the same